aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-q.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-07-11 11:21:48 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 19:50:14 -0400
commitc0c53dbc32ea05a1e1dd9dba4772327da9a11750 (patch)
treec292857a1d2c6e1c4b16bb08649df71fd92178e2 /drivers/usb/host/ehci-q.c
parent2f5bb665ba7a14c5842fa2e1cde2be039843a2a2 (diff)
USB: EHCI: add new root-hub state: STOPPING
This patch (as1571) adds a new state for ehci-hcd's root hubs: EHCI_RH_STOPPING. This value is used at times when the root hub is being stopped and we don't know whether or not the hardware has finished all its DMA yet. Although the purpose may not be apparent, this distinction will come in useful later on. Future patches will avoid actions that depend on the root hub being operational (like turning on the async or periodic schedules) when they see the state is EHCI_RH_STOPPING. 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-q.c')
-rw-r--r--drivers/usb/host/ehci-q.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 5193612c96e..285d5a0f3f7 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -433,7 +433,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
433 433
434 /* stop scanning when we reach qtds the hc is using */ 434 /* stop scanning when we reach qtds the hc is using */
435 } else if (likely (!stopped 435 } else if (likely (!stopped
436 && ehci->rh_state == EHCI_RH_RUNNING)) { 436 && ehci->rh_state >= EHCI_RH_RUNNING)) {
437 break; 437 break;
438 438
439 /* scan the whole queue for unlinks whenever it stops */ 439 /* scan the whole queue for unlinks whenever it stops */
@@ -441,7 +441,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
441 stopped = 1; 441 stopped = 1;
442 442
443 /* cancel everything if we halt, suspend, etc */ 443 /* cancel everything if we halt, suspend, etc */
444 if (ehci->rh_state != EHCI_RH_RUNNING) 444 if (ehci->rh_state < EHCI_RH_RUNNING)
445 last_status = -ESHUTDOWN; 445 last_status = -ESHUTDOWN;
446 446
447 /* this qtd is active; skip it unless a previous qtd 447 /* this qtd is active; skip it unless a previous qtd
@@ -1241,7 +1241,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1241 wmb (); 1241 wmb ();
1242 1242
1243 /* If the controller isn't running, we don't have to wait for it */ 1243 /* If the controller isn't running, we don't have to wait for it */
1244 if (unlikely(ehci->rh_state != EHCI_RH_RUNNING)) { 1244 if (unlikely(ehci->rh_state < EHCI_RH_RUNNING)) {
1245 /* if (unlikely (qh->unlink_next != 0)) 1245 /* if (unlikely (qh->unlink_next != 0))
1246 * this will recurse, probably not much 1246 * this will recurse, probably not much
1247 */ 1247 */
@@ -1263,7 +1263,7 @@ static void scan_async (struct ehci_hcd *ehci)
1263 enum ehci_timer_action action = TIMER_IO_WATCHDOG; 1263 enum ehci_timer_action action = TIMER_IO_WATCHDOG;
1264 1264
1265 timer_action_done (ehci, TIMER_ASYNC_SHRINK); 1265 timer_action_done (ehci, TIMER_ASYNC_SHRINK);
1266 stopped = (ehci->rh_state != EHCI_RH_RUNNING); 1266 stopped = (ehci->rh_state < EHCI_RH_RUNNING);
1267 1267
1268 ehci->qh_scan_next = ehci->async->qh_next.qh; 1268 ehci->qh_scan_next = ehci->async->qh_next.qh;
1269 while (ehci->qh_scan_next) { 1269 while (ehci->qh_scan_next) {