summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-hub.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2016-01-25 23:44:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-04 00:14:52 +0300
commitf96fba0dbf8f6b0eaa313b4c230f93c9bb0dd759 (patch)
tree71a582d57c0b91863595d06c8008b5debb05d219 /drivers/usb/host/ehci-hub.c
parentfcc5184ec1521c7d85124421e593660c94e9a9fb (diff)
downloadlinux-f96fba0dbf8f6b0eaa313b4c230f93c9bb0dd759.tar.xz
USB: EHCI: improve handling of the ehci->iaa_in_progress flag
This patch improves the way ehci-hcd handles the iaa_in_progress flag. The current code is somewhat careless in this regard: The flag is meaningless when the root hub isn't running, most particularly after the root hub has been suspended. But in start_iaa_cycle(), the driver checks the flag before checking the root hub's state. They should be checked in the opposite order. That routine also sets the flag too early, before it has definitely committed to starting an IAA cycle. The flag is turned off in end_unlink_async(). Upcoming changes will call that routine at other times, not just at the end of an IAA cycle. The two actions are logically separate (although related), so we separate out a new routine to be called in place of end_unlink_async() whenever an IAA cycle ends: end_iaa_cycle(). iaa_in_progress should be turned off when the root hub is suspended -- we certainly don't want it still to be set when the root hub resumes. Therefore the call to end_unlink_async() in ehci_bus_suspend() should also be replaced with a call to end_iaa_cycle(). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-hub.c')
-rw-r--r--drivers/usb/host/ehci-hub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 086a7115d263..6d84ce2edc27 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -347,7 +347,8 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
goto done;
ehci->rh_state = EHCI_RH_SUSPENDED;
- end_unlink_async(ehci);
+ /* Any IAA cycle that started before the suspend is now invalid */
+ end_iaa_cycle(ehci);
unlink_empty_async_suspended(ehci);
ehci_handle_start_intr_unlinks(ehci);
ehci_handle_intr_unlinks(ehci);