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) ...@@ -412,8 +412,7 @@ static int hc_reset (struct ohci_hcd *ohci)
/* Disable HC interrupts */ /* Disable HC interrupts */
writel (OHCI_INTR_MIE, &ohci->regs->intrdisable); writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
ohci_dbg (ohci, "USB HC reset_hc %s: ctrl = 0x%x ;\n", ohci_dbg (ohci, "reset, control = 0x%x\n",
hcd_to_bus (&ohci->hcd)->bus_name,
readl (&ohci->regs->control)); readl (&ohci->regs->control));
/* Reset USB (needed by some controllers); RemoteWakeupConnected /* Reset USB (needed by some controllers); RemoteWakeupConnected
...@@ -548,7 +547,6 @@ static int hc_start (struct ohci_hcd *ohci) ...@@ -548,7 +547,6 @@ static int hc_start (struct ohci_hcd *ohci)
return -ENODEV; return -ENODEV;
} }
create_debug_files (ohci);
return 0; return 0;
} }
......
...@@ -101,6 +101,7 @@ ohci_pci_start (struct usb_hcd *hcd) ...@@ -101,6 +101,7 @@ ohci_pci_start (struct usb_hcd *hcd)
ohci_stop (hcd); ohci_stop (hcd);
return -EBUSY; return -EBUSY;
} }
create_debug_files (ohci);
#ifdef DEBUG #ifdef DEBUG
ohci_dump (ohci, 1); ohci_dump (ohci, 1);
...@@ -115,6 +116,7 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state) ...@@ -115,6 +116,7 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
struct ohci_hcd *ohci = hcd_to_ohci (hcd); struct ohci_hcd *ohci = hcd_to_ohci (hcd);
unsigned long flags; unsigned long flags;
u16 cmd; u16 cmd;
u32 tmp;
if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER) { if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER) {
ohci_dbg (ohci, "can't suspend (state is %s)\n", 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) ...@@ -156,15 +158,12 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
(void) readl (&ohci->regs->control); (void) readl (&ohci->regs->control);
mdelay (500); /* No schedule here ! */ 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: case OHCI_USB_RESET:
ohci_dbg (ohci, "suspend->reset ?\n");
break;
case OHCI_USB_RESUME: case OHCI_USB_RESUME:
ohci_dbg (ohci, "suspend->resume ?\n");
break;
case OHCI_USB_OPER: case OHCI_USB_OPER:
ohci_dbg (ohci, "suspend->operational ?\n"); ohci_err (ohci, "can't suspend; hcfs %d\n", tmp);
break; break;
case OHCI_USB_SUSPEND: case OHCI_USB_SUSPEND:
ohci_dbg (ohci, "suspended\n"); ohci_dbg (ohci, "suspended\n");
......
...@@ -296,6 +296,7 @@ ohci_sa1111_start (struct usb_hcd *hcd) ...@@ -296,6 +296,7 @@ ohci_sa1111_start (struct usb_hcd *hcd)
ohci_stop (hcd); ohci_stop (hcd);
return -EBUSY; return -EBUSY;
} }
create_debug_files (ohci);
#ifdef DEBUG #ifdef DEBUG
ohci_dump (ohci, 1); 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