ChangeSet 1.1325.4.7, 2003/09/23 17:17:15-07:00, stern@rowland.harvard.edu

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

Here's a simple patch to improve logging during suspend and
resume.


 drivers/usb/core/hcd-pci.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)


diff -Nru a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
--- a/drivers/usb/core/hcd-pci.c	Thu Sep 25 14:32:08 2003
+++ b/drivers/usb/core/hcd-pci.c	Thu Sep 25 14:32:08 2003
@@ -273,17 +273,17 @@
 	int			retval = 0;
 
 	hcd = pci_get_drvdata(dev);
+	dev_dbg (hcd->controller, "suspend D%d --> D%d\n",
+			dev->current_state, state);
+
 	switch (hcd->state) {
 	case USB_STATE_HALT:
 		dev_dbg (hcd->controller, "halted; hcd not suspended\n");
 		break;
 	case USB_STATE_SUSPENDED:
-		dev_dbg (hcd->controller, "suspend D%d --> D%d\n",
-				dev->current_state, state);
+		dev_dbg (hcd->controller, "hcd already suspended\n");
 		break;
 	default:
-		dev_dbg (hcd->controller, "suspend to state %d\n", state);
-
 		/* remote wakeup needs hub->suspend() cooperation */
 		// pci_enable_wake (dev, 3, 1);
 
@@ -292,6 +292,9 @@
 		/* driver may want to disable DMA etc */
 		hcd->state = USB_STATE_QUIESCING;
 		retval = hcd->driver->suspend (hcd, state);
+		if (retval)
+			dev_dbg (hcd->controller, "suspend fail, retval %d\n",
+					retval);
 	}
 
  	pci_set_power_state (dev, state);
@@ -311,6 +314,9 @@
 	int			retval;
 
 	hcd = pci_get_drvdata(dev);
+	dev_dbg (hcd->controller, "resume from state D%d\n",
+			dev->current_state);
+
 	if (hcd->state != USB_STATE_SUSPENDED) {
 		dev_dbg (hcd->controller, "can't resume, not suspended!\n");
 		return -EL3HLT;
