Commit 0061714a authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: ohci-hcd, minor d3cold resume fix

The ohci d3cold resume path kept re-creating the sysfs files,
and that seemed eventually to cause an oops.  This patch
only creates them on first initialization, not re-init;
and includes some minor debug message tweaks.
parent 5757f1dc
......@@ -412,8 +412,7 @@ static int hc_reset (struct ohci_hcd *ohci)
/* Disable HC interrupts */
writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
ohci_dbg (ohci, "USB HC reset_hc %s: ctrl = 0x%x ;\n",
hcd_to_bus (&ohci->hcd)->bus_name,
ohci_dbg (ohci, "reset, control = 0x%x\n",
readl (&ohci->regs->control));
/* Reset USB (needed by some controllers); RemoteWakeupConnected
......@@ -548,7 +547,6 @@ static int hc_start (struct ohci_hcd *ohci)
return -ENODEV;
}
create_debug_files (ohci);
return 0;
}
......
......@@ -101,6 +101,7 @@ ohci_pci_start (struct usb_hcd *hcd)
ohci_stop (hcd);
return -EBUSY;
}
create_debug_files (ohci);
#ifdef DEBUG
ohci_dump (ohci, 1);
......@@ -115,6 +116,7 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
struct ohci_hcd *ohci = hcd_to_ohci (hcd);
unsigned long flags;
u16 cmd;
u32 tmp;
if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER) {
ohci_dbg (ohci, "can't suspend (state is %s)\n",
......@@ -156,15 +158,12 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
(void) readl (&ohci->regs->control);
mdelay (500); /* No schedule here ! */
switch (readl (&ohci->regs->control) & OHCI_CTRL_HCFS) {
tmp = readl (&ohci->regs->control) | OHCI_CTRL_HCFS;
switch (tmp) {
case OHCI_USB_RESET:
ohci_dbg (ohci, "suspend->reset ?\n");
break;
case OHCI_USB_RESUME:
ohci_dbg (ohci, "suspend->resume ?\n");
break;
case OHCI_USB_OPER:
ohci_dbg (ohci, "suspend->operational ?\n");
ohci_err (ohci, "can't suspend; hcfs %d\n", tmp);
break;
case OHCI_USB_SUSPEND:
ohci_dbg (ohci, "suspended\n");
......
......@@ -296,6 +296,7 @@ ohci_sa1111_start (struct usb_hcd *hcd)
ohci_stop (hcd);
return -EBUSY;
}
create_debug_files (ohci);
#ifdef DEBUG
ohci_dump (ohci, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment