]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/host/ohci-hub.c
Merge git://git.infradead.org/users/willy/linux-nvme
[~andy/linux] / drivers / usb / host / ohci-hub.c
index 2f00040fc408c78a4ef1e9bdab138344249d1fa5..836772dfabd3e0deb077f0441981feb29c462d4b 100644 (file)
@@ -111,6 +111,7 @@ __acquires(ohci->lock)
        if (!autostop) {
                ohci->next_statechange = jiffies + msecs_to_jiffies (5);
                ohci->autostop = 0;
+               ohci->rh_state = OHCI_RH_SUSPENDED;
        }
 
 done:
@@ -140,7 +141,7 @@ __acquires(ohci->lock)
 
        if (ohci->hc_control & (OHCI_CTRL_IR | OHCI_SCHED_ENABLES)) {
                /* this can happen after resuming a swsusp snapshot */
-               if (hcd->state == HC_STATE_RESUMING) {
+               if (ohci->rh_state != OHCI_RH_RUNNING) {
                        ohci_dbg (ohci, "BIOS/SMM active, control %03x\n",
                                        ohci->hc_control);
                        status = -EBUSY;
@@ -274,6 +275,7 @@ skip_resume:
                (void) ohci_readl (ohci, &ohci->regs->control);
        }
 
+       ohci->rh_state = OHCI_RH_RUNNING;
        return 0;
 }
 
@@ -336,11 +338,8 @@ static void ohci_finish_controller_resume(struct usb_hcd *hcd)
        /* If needed, reinitialize and suspend the root hub */
        if (need_reinit) {
                spin_lock_irq(&ohci->lock);
-               hcd->state = HC_STATE_RESUMING;
                ohci_rh_resume(ohci);
-               hcd->state = HC_STATE_QUIESCING;
                ohci_rh_suspend(ohci, 0);
-               hcd->state = HC_STATE_SUSPENDED;
                spin_unlock_irq(&ohci->lock);
        }