From ee7d801060e1e7bbbb5137512fc6a95f15097395 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Tue, 23 Sep 2003 03:17:15 -0700 Subject: [PATCH] [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 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index dc3a0734aa3b4..6070530a09f4e 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -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; -- 2.53.0