]> git.hungrycats.org Git - linux/commitdiff
[PATCH] USB: improve debugging logging during suspend and resume
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 23 Sep 2003 10:17:15 +0000 (03:17 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 23 Sep 2003 10:17:15 +0000 (03:17 -0700)
Here's a simple patch to improve logging during suspend and
resume.

drivers/usb/core/hcd-pci.c

index dc3a0734aa3b49b1cbfd402b8ad08653f814eae1..6070530a09f4efc6cd83ed6537df728e9f50b672 100644 (file)
@@ -273,17 +273,17 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)
        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 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)
                /* 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 usb_hcd_pci_resume (struct pci_dev *dev)
        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;