aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ohci-hcd.c')
-rw-r--r--drivers/usb/host/ohci-hcd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 56b43f2a0e52..67c1aa5eb1c1 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -382,8 +382,7 @@ sanitize:
382 goto sanitize; 382 goto sanitize;
383 } 383 }
384 spin_unlock_irqrestore (&ohci->lock, flags); 384 spin_unlock_irqrestore (&ohci->lock, flags);
385 set_current_state (TASK_UNINTERRUPTIBLE); 385 schedule_timeout_uninterruptible(1);
386 schedule_timeout (1);
387 goto rescan; 386 goto rescan;
388 case ED_IDLE: /* fully unlinked */ 387 case ED_IDLE: /* fully unlinked */
389 if (list_empty (&ed->td_list)) { 388 if (list_empty (&ed->td_list)) {
@@ -485,6 +484,10 @@ static int ohci_init (struct ohci_hcd *ohci)
485 // flush the writes 484 // flush the writes
486 (void) ohci_readl (ohci, &ohci->regs->control); 485 (void) ohci_readl (ohci, &ohci->regs->control);
487 486
487 /* Read the number of ports unless overridden */
488 if (ohci->num_ports == 0)
489 ohci->num_ports = roothub_a(ohci) & RH_A_NDP;
490
488 if (ohci->hcca) 491 if (ohci->hcca)
489 return 0; 492 return 0;
490 493
@@ -561,10 +564,8 @@ static int ohci_run (struct ohci_hcd *ohci)
561 msleep(temp); 564 msleep(temp);
562 temp = roothub_a (ohci); 565 temp = roothub_a (ohci);
563 if (!(temp & RH_A_NPS)) { 566 if (!(temp & RH_A_NPS)) {
564 unsigned ports = temp & RH_A_NDP;
565
566 /* power down each port */ 567 /* power down each port */
567 for (temp = 0; temp < ports; temp++) 568 for (temp = 0; temp < ohci->num_ports; temp++)
568 ohci_writel (ohci, RH_PS_LSDA, 569 ohci_writel (ohci, RH_PS_LSDA,
569 &ohci->regs->roothub.portstatus [temp]); 570 &ohci->regs->roothub.portstatus [temp]);
570 } 571 }
@@ -720,6 +721,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs)
720 721
721 if (ints & OHCI_INTR_RD) { 722 if (ints & OHCI_INTR_RD) {
722 ohci_vdbg (ohci, "resume detect\n"); 723 ohci_vdbg (ohci, "resume detect\n");
724 ohci_writel (ohci, OHCI_INTR_RD, &regs->intrstatus);
723 if (hcd->state != HC_STATE_QUIESCING) 725 if (hcd->state != HC_STATE_QUIESCING)
724 schedule_work(&ohci->rh_resume); 726 schedule_work(&ohci->rh_resume);
725 } 727 }
@@ -861,7 +863,7 @@ static int ohci_restart (struct ohci_hcd *ohci)
861 * and that if we try to turn them back on the root hub 863 * and that if we try to turn them back on the root hub
862 * will respond to CSC processing. 864 * will respond to CSC processing.
863 */ 865 */
864 i = roothub_a (ohci) & RH_A_NDP; 866 i = ohci->num_ports;
865 while (i--) 867 while (i--)
866 ohci_writel (ohci, RH_PS_PSS, 868 ohci_writel (ohci, RH_PS_PSS,
867 &ohci->regs->roothub.portstatus [temp]); 869 &ohci->regs->roothub.portstatus [temp]);