Commit ee7d8010 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: improve debugging logging during suspend and resume

Here's a simple patch to improve logging during suspend and
resume.
parent 5e897bdd
...@@ -273,17 +273,17 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state) ...@@ -273,17 +273,17 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)
int retval = 0; int retval = 0;
hcd = pci_get_drvdata(dev); hcd = pci_get_drvdata(dev);
dev_dbg (hcd->controller, "suspend D%d --> D%d\n",
dev->current_state, state);
switch (hcd->state) { switch (hcd->state) {
case USB_STATE_HALT: case USB_STATE_HALT:
dev_dbg (hcd->controller, "halted; hcd not suspended\n"); dev_dbg (hcd->controller, "halted; hcd not suspended\n");
break; break;
case USB_STATE_SUSPENDED: case USB_STATE_SUSPENDED:
dev_dbg (hcd->controller, "suspend D%d --> D%d\n", dev_dbg (hcd->controller, "hcd already suspended\n");
dev->current_state, state);
break; break;
default: default:
dev_dbg (hcd->controller, "suspend to state %d\n", state);
/* remote wakeup needs hub->suspend() cooperation */ /* remote wakeup needs hub->suspend() cooperation */
// pci_enable_wake (dev, 3, 1); // pci_enable_wake (dev, 3, 1);
...@@ -292,6 +292,9 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state) ...@@ -292,6 +292,9 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)
/* driver may want to disable DMA etc */ /* driver may want to disable DMA etc */
hcd->state = USB_STATE_QUIESCING; hcd->state = USB_STATE_QUIESCING;
retval = hcd->driver->suspend (hcd, state); retval = hcd->driver->suspend (hcd, state);
if (retval)
dev_dbg (hcd->controller, "suspend fail, retval %d\n",
retval);
} }
pci_set_power_state (dev, state); pci_set_power_state (dev, state);
...@@ -311,6 +314,9 @@ int usb_hcd_pci_resume (struct pci_dev *dev) ...@@ -311,6 +314,9 @@ int usb_hcd_pci_resume (struct pci_dev *dev)
int retval; int retval;
hcd = pci_get_drvdata(dev); hcd = pci_get_drvdata(dev);
dev_dbg (hcd->controller, "resume from state D%d\n",
dev->current_state);
if (hcd->state != USB_STATE_SUSPENDED) { if (hcd->state != USB_STATE_SUSPENDED) {
dev_dbg (hcd->controller, "can't resume, not suspended!\n"); dev_dbg (hcd->controller, "can't resume, not suspended!\n");
return -EL3HLT; return -EL3HLT;
......
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