[linux-pm] Re: uhci-hcd suspend/resume under the new driver model

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 16, 2005 at 01:44:00PM -0500, Alan Stern wrote:
> > Needed an extra patch to compile, attached.
> 
> I didn't get your attachment.

D'oh. For real this time.

> >  However, it still doesn't survive more than one suspend/resume
> >  with devices plugged in. On the second resume, USB is dead, and
> >  it enters the same suspend_hc/wakeup_hc loop. I traced this
> >  back to the hcd never really being resumed, as the pci power
> >  state never changes from D0 as pci_set_power_state is never
> >  called here. The attached patch also addresses this - I'm not
> >  sure if it's the right way, but it works(ish):
> 
> Can _you_ elaborate on "never really being resumed"?  Since the
> state never changes from D0 much of the code in
> usb_hcd_pci_suspend never runs, as you said above.  In fact about
> the only thing that does happen is the call to
> hcd->driver->suspend.  However the reverse call to
> hcd->driver->resume does get made in usb_hcd_pci_resume even
> though the state upon entry is D0.

I meant specifically in the resume path, there's an if statement to
check if the pci power state is > D0, and only acts if that's the
case. Hopefully the first hunk of the patch attached makes this more
clear. None of the code inside that if statement was being called.

Bernard

-- 
 Bernard Blackham <bernard at blackham dot com dot au>
-------------- next part --------------
Index: linux/drivers/usb/core/hcd-pci.c
===================================================================
--- linux.orig/drivers/usb/core/hcd-pci.c	2005-03-16 23:49:50.000000000 +0800
+++ linux/drivers/usb/core/hcd-pci.c	2005-03-17 00:28:10.000000000 +0800
@@ -396,7 +396,7 @@
 
 	hcd->state = USB_STATE_RESUMING;
 
-	if (dev->current_state > PCI_D0) {
+	if (dev->dev.power.power_state.event != EVENT_ON) {
 		if (has_pci_pm) {
 #ifdef	CONFIG_USB_SUSPEND
 			pci_enable_wake (dev, dev->current_state, 0);
@@ -411,7 +411,7 @@
 		}
 		dev->dev.power.power_state = PMSG_ON;
 		retval = request_irq (dev->irq, usb_hcd_irq, SA_SHIRQ,
-				hcd->irq_descr, hcd);
+				hcd->driver->description, hcd);
 		if (retval < 0) {
 			dev_err (hcd->self.controller,
 				"can't restore IRQ after resume!\n");

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux