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]
Date:	Tue, 19 Sep 2006 10:25:15 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Jiri Kosina <jikos@...os.cz>
cc:	David Brownell <david-b@...bell.net>,
	Andrew Morton <akpm@...l.org>,
	<dbrownell@...rs.sourceforge.net>, <weissg@...nna.at>,
	<linux-usb-devel@...ts.sourceforge.net>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [linux-usb-devel] [PATCH] USB: consolidate error values from
 EHCI, UHCI and OHCI _suspend()

On Tue, 19 Sep 2006, Jiri Kosina wrote:

> On Mon, 18 Sep 2006, David Brownell wrote:
> 
> > > EHCI, UHCI and OHCI USB host drivers are not consistent when returining 
> > > error values from their _suspend() functions, in case that the device is 
> > > not in suspended state. This could confuse users, so let all three of them 
> > > return -EBUSY.
> > Shouldn't you also update uhci_suspend()?  Currently it just ignores 
> > hcd->state ...
> 
> You are right that the patch is possibly not fully correct. I was trying 
> to fix the situation I was getting into with the bug in usb_resume_both() 
> (see my "[PATCH] 2.6.18-rc6-mm2 - usb_resume_both() - fix suspend/resume" 
> mail from yesterday), but now it is obvious that the EINVAL from UHCI is 
> of a "different kind" than EBUSY from OHCI and UHCI (though they are 
> triggered in the same situations -- when the previous resume was not done 
> correctly).

Sort of.  The real trigger is that the PM core tries to suspend the 
upper-level PCI device but the lower-level root-hub device has not been 
suspended.  You saw this occurring because during the previous resume, the 
root-hub device's power.power_state.event was not updated, causing the PM 
core to think the root hub was still suspended when in fact it wasn't.

> As far as I can see, the UHCI driver is, strangely enough, not using 
> hcd->state at all. 
> 
> (by the way, EHCI and OHCI seem to have broken (read: missing) locking 
> when accessing the hcd->state. Should I fix it by per-hcd spinlock, or 
> does the patch already exist somewhere?)

Believe it or not, these two paragraphs are closely connected.  The reason 
uhci-hcd doesn't use hcd->state at all is because there is no locking to 
protect it!

My feeling has long been that hcd->state deserves to disappear.  It tries 
to serve too many functions.  Please don't add any code in a futile 
attempt to preserve it.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ