lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200609141514.49527.rjw@sisk.pl>
Date:	Thu, 14 Sep 2006 15:14:48 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Alan Stern <stern@...land.harvard.edu>
Cc:	Andrew Morton <akpm@...l.org>, Mattia Dongili <malattia@...ux.it>,
	Kernel development list <linux-kernel@...r.kernel.org>,
	USB development list <linux-usb-devel@...ts.sourceforge.net>
Subject: Re: [linux-usb-devel] 2.6.18-rc6-mm1 (-mm2): ohci resume problem

On Wednesday, 13 September 2006 23:55, Alan Stern wrote:
> On Wed, 13 Sep 2006, Rafael J. Wysocki wrote:
> 
> > > Try this patch instead.  It looks for problems occurring a little earlier 
> > > in the call chain.
> > 
> > I've applied both patches at a time (I hope they don't conflict).
> > 
> > The dmesg output is attached.
> 
> The dmesg output shows the root-hub device state is set wrong.
> 
> I have to leave now, so I can't give you another patch to try.  You can 
> experiment as follows...
> 
> Look in drivers/usb/host/ehci-pci.c, at ehci_pci_resume().  The part of 
> interest is everything following the "restart:" statement label.
> 
> Try adding some ehci_dbg() lines in there (copy the form of the line just
> after restart:).  We want to follow the value of
> hcd->self.root_hub->state.  Initially it should be equal to
> USB_STATE_SUSPENDED (= 8), and it shouldn't change.  But somewhere it is
> getting set to USB_STATE_CONFIGURED (= 7).  I don't know where, but almost 
> certainly somewhere in this routine.  If you can find out where that 
> happens, I'd appreciate it.

Done, but it shows hcd->self.root_hub->state is already 7 right after restart.

I've used the following patch to verify this:

---
 drivers/usb/host/ehci-pci.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-2.6.18-rc6-mm2/drivers/usb/host/ehci-pci.c
===================================================================
--- linux-2.6.18-rc6-mm2.orig/drivers/usb/host/ehci-pci.c
+++ linux-2.6.18-rc6-mm2/drivers/usb/host/ehci-pci.c
@@ -291,14 +291,19 @@ static int ehci_pci_resume(struct usb_hc
 
 restart:
 	ehci_dbg(ehci, "lost power, restarting\n");
+	ehci_dbg(ehci, "root hub state: %d\n", hcd->self.root_hub->state);
 	usb_root_hub_lost_power(hcd->self.root_hub);
+	ehci_dbg(ehci, "root hub state: %d\n", hcd->self.root_hub->state);
 
 	/* Else reset, to cope with power loss or flush-to-storage
 	 * style "resume" having let BIOS kick in during reboot.
 	 */
 	(void) ehci_halt(ehci);
+	ehci_dbg(ehci, "root hub state: %d\n", hcd->self.root_hub->state);
 	(void) ehci_reset(ehci);
+	ehci_dbg(ehci, "root hub state: %d\n", hcd->self.root_hub->state);
 	(void) ehci_pci_reinit(ehci, pdev);
+	ehci_dbg(ehci, "root hub state: %d\n", hcd->self.root_hub->state);
 
 	/* emptying the schedule aborts any urbs */
 	spin_lock_irq(&ehci->lock);
@@ -306,12 +311,15 @@ restart:
 		ehci->reclaim_ready = 1;
 	ehci_work(ehci, NULL);
 	spin_unlock_irq(&ehci->lock);
+	ehci_dbg(ehci, "root hub state: %d\n", hcd->self.root_hub->state);
 
 	/* restart; khubd will disconnect devices */
 	retval = ehci_run(hcd);
+	ehci_dbg(ehci, "root hub state: %d\n", hcd->self.root_hub->state);
 
 	/* here we "know" root ports should always stay powered */
 	ehci_port_power(ehci, 1);
+	ehci_dbg(ehci, "root hub state: %d\n", hcd->self.root_hub->state);
 
 	return retval;
 }

The output of dmesg is attached.

Greetings,
Rafael


-- 
You never change things by fighting the existing reality.
		R. Buckminster Fuller

Download attachment "dmesg-debug-3.log.gz" of type "application/x-gzip" (15082 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ