USB: EHCI: expedite unlinks when the root hub is suspended

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, March 18, 2009 - 9:59 am

Gitweb:     http://git.kernel.org/linus/391016f6e2fe3b9979b4c6880a76e5e434d6947c
Commit:     391016f6e2fe3b9979b4c6880a76e5e434d6947c
Parent:     508db8c954d55ed30f870d2c24d741ba6269d13c
Author:     Alan Stern <stern@rowland.harvard.edu>
AuthorDate: Mon Mar 16 14:21:56 2009 -0400
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Tue Mar 17 14:01:29 2009 -0700

    USB: EHCI: expedite unlinks when the root hub is suspended
    
    This patch (as1225) fixes a bug in ehci-hcd.  The condition for
    whether unlinked QHs can become IDLE should not be that the controller
    is halted, but rather that the controller isn't running.  In other
    words when the root hub is suspended, the hardware doesn't own any
    QHs.
    
    This fixes a problem that can show up during hibernation: If a QH is
    only partially unlinked when the root hub is frozen, then when the
    root hub is thawed the QH won't be in the IDLE state.  As a result it
    can't be used properly for new URB submissions.
    
    Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
    Reported-by: Brandon Philips <brandon@ifup.org>
    Tested-by: Brandon Philips <brandon@ifup.org>
    Acked-by: David Brownell <dbrownell@users.sourceforge.net>
    Cc: Stable <stable@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/host/ehci-q.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 3712b92..ecc9b66 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1095,7 +1095,8 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
 	prev->qh_next = qh->qh_next;
 	wmb ();
 
-	if (unlikely (ehci_to_hcd(ehci)->state == HC_STATE_HALT)) {
+	/* If the controller isn't running, we don't have to wait for it */
+	if (unlikely(!HC_IS_RUNNING(ehci_to_hcd(ehci)->state))) {
 		/* if (unlikely (qh->reclaim != 0))
 		 *	this will recurse, probably not much
 		 */
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
USB: EHCI: expedite unlinks when the root hub is suspended, Linux Kernel Mailing ..., (Wed Mar 18, 9:59 am)