/* dump driver info, then registers in spec order */
ohci_dbg_sw (ohci, &next, &size,
- "%s version " DRIVER_VERSION "\n", hcd_name);
+ "bus %s, device %s\n"
+ "%s version " DRIVER_VERSION "\n",
+ hcd->self.controller->bus->name,
+ hcd->self.controller->bus_id,
+ hcd_name);
+
+ if (bus->controller->power.power_state) {
+ size -= scnprintf (next, size,
+ "SUSPENDED (no register access)\n");
+ goto done;
+ }
ohci_dump_status(ohci, &next, &size);
/* roothub */
ohci_dump_roothub (ohci, 1, &next, &size);
+done:
spin_unlock_irqrestore (&ohci->lock, flags);
-
return PAGE_SIZE - size;
}
static CLASS_DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL);
ohci_dump (ohci, 1);
hc_reset (ohci);
}
-
+
if (ints & OHCI_INTR_WDH) {
if (HCD_IS_RUNNING(hcd->state))
writel (OHCI_INTR_WDH, ®s->intrdisable);
- dl_done_list (ohci, dl_reverse_done_list (ohci), ptregs);
+ spin_lock (&ohci->lock);
+ dl_done_list (ohci, ptregs);
+ spin_unlock (&ohci->lock);
if (HCD_IS_RUNNING(hcd->state))
writel (OHCI_INTR_WDH, ®s->intrenable);
}
writel (OHCI_INTR_WDH, &ohci->regs->intrdisable);
(void) readl (&ohci->regs->intrdisable);
+
+ /* Check for a pending done list */
+ if (ohci->hcca->done_head)
+ dl_done_list (ohci, NULL);
+
spin_unlock_irq (&ohci->lock);
#ifdef CONFIG_PMAC_PBOOK
enable_irq (to_pci_dev(hcd->self.controller)->irq);
#endif
- /* Check for a pending done list */
- if (ohci->hcca->done_head)
- dl_done_list (ohci, dl_reverse_done_list (ohci), NULL);
writel (OHCI_INTR_WDH, &ohci->regs->intrenable);
/* assume there are TDs on the bulk and control lists */
{
int branch;
+ if (ohci->hcd.state == USB_STATE_QUIESCING)
+ return -EAGAIN;
+
ed->state = ED_OPER;
ed->ed_prev = 0;
ed->ed_next = 0;
u32 td_dma;
struct td *td_rev = NULL;
struct td *td = NULL;
- unsigned long flags;
-
- spin_lock_irqsave (&ohci->lock, flags);
td_dma = le32_to_cpup (&ohci->hcca->done_head);
ohci->hcca->done_head = 0;
td_rev = td;
td_dma = le32_to_cpup (&td->hwNextTD);
}
- spin_unlock_irqrestore (&ohci->lock, flags);
return td_rev;
}
}
/* maybe reenable control and bulk lists */
- if (HCD_IS_RUNNING(ohci->hcd.state) && !ohci->ed_rm_list) {
+ if (HCD_IS_RUNNING(ohci->hcd.state)
+ && ohci->hcd.state != USB_STATE_QUIESCING
+ && !ohci->ed_rm_list) {
u32 command = 0, control = 0;
if (ohci->ed_controltail) {
* scanning the (re-reversed) donelist as this does.
*/
static void
-dl_done_list (struct ohci_hcd *ohci, struct td *td, struct pt_regs *regs)
+dl_done_list (struct ohci_hcd *ohci, struct pt_regs *regs)
{
- unsigned long flags;
+ struct td *td = dl_reverse_done_list (ohci);
- spin_lock_irqsave (&ohci->lock, flags);
while (td) {
struct td *td_next = td->next_dl_td;
struct urb *urb = td->urb;
td = td_next;
}
- spin_unlock_irqrestore (&ohci->lock, flags);
}