Re: USB suspend problem with kernel 2.6.17

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Thu, 13 Sep 2007, Tiago Salem Herrmann wrote:

> 
> > That file is missing lots of stuff.  None of the debugging information 
> > is present.  Did you remember to do
> >
> > 	echo 9 >/proc/sys/kernel/printk
> >
> > or the equivalent (Alt-SysRq-9)?
> >
> >   
> Oh, sorry. It was my mistake. A new file is at
> 
> http://users.mandriva.com.br/~salem/dmesg_suspend3.txt

Hmmm.  It's still a little weird, and I can't be certain of what's 
going wrong.  It looks like the firmware may enable the EHCI controller 
and leave it in a configured state when the external drive is present, 
causing ehci-hcd to think that the controller didn't lose power.  All 
that logic was messed up in kernels earlier than 2.6.20, anyway.

So try out this patch and see what happens.

Alan Stern



Index: 2.6.17/drivers/usb/host/ehci-pci.c
===================================================================
--- 2.6.17.orig/drivers/usb/host/ehci-pci.c
+++ 2.6.17/drivers/usb/host/ehci-pci.c
@@ -254,27 +254,6 @@ static int ehci_pci_resume(struct usb_hc
 	/* Mark hardware accessible again as we are out of D3 state by now */
 	set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
 
-	/* If CF is clear, we lost PCI Vaux power and need to restart.  */
-	if (readl(&ehci->regs->configured_flag) != FLAG_CF)
-		goto restart;
-
-	/* If any port is suspended (or owned by the companion),
-	 * we know we can/must resume the HC (and mustn't reset it).
-	 * We just defer that to the root hub code.
-	 */
-	for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) {
-		u32	status;
-		port--;
-		status = readl(&ehci->regs->port_status [port]);
-		if (!(status & PORT_POWER))
-			continue;
-		if (status & (PORT_SUSPEND | PORT_RESUME | PORT_OWNER)) {
-			usb_hcd_resume_root_hub(hcd);
-			return 0;
-		}
-	}
-
-restart:
 	ehci_dbg(ehci, "lost power, restarting\n");
 	usb_root_hub_lost_power(hcd->self.root_hub);
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.