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: <Pine.LNX.4.44L0.0711191403400.3005-100000@iolanthe.rowland.org>
Date:	Mon, 19 Nov 2007 14:04:50 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	David Brownell <david-b@...bell.net>
cc:	stable@...nel.org,
	USB development list <linux-usb-devel@...ts.sourceforge.net>,
	Kernel development list <linux-kernel@...r.kernel.org>,
	<gregkh@...e.de>, <zwane@....linux.org.uk>, <tytso@....edu>,
	<torvalds@...ux-foundation.org>, <reviews@...cw.f00f.org>,
	<rdunlap@...otime.net>, <mkrufky@...uxtv.org>,
	<jmforbes@...uxtx.org>, <dely.l.sy@...el.com>,
	<davem@...emloft.net>, <davej@...hat.com>,
	<chuckw@...ntumlinux.com>, <cebbert@...hat.com>,
	<cavokz@...il.com>, <alan@...rguk.ukuu.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [patch 19/26] USB: mutual exclusion for EHCI init and port resets

On Mon, 19 Nov 2007, David Brownell wrote:

> Still needs the following update, IMO ... 
> 
> ======	CUT HERE
> A recent patch added software synchronization during EHCI startup,
> so ports aren't switched away from the companion controllers after
> resets have started.  This patch adds a short delay letting hardware
> get a chance to finish that port switching before any new resets begin.
> 
> That is, both sides of that hardware race window need to be closed.
> 
> Signed-off-by: David Brownell <dbrownell@...rs.sourceforge.net>
> ---
>  drivers/usb/host/ehci-hcd.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> --- g26.orig/drivers/usb/host/ehci-hcd.c	2007-11-13 16:07:12.000000000 -0800
> +++ g26/drivers/usb/host/ehci-hcd.c	2007-11-13 16:13:01.000000000 -0800
> @@ -594,12 +594,15 @@ static int ehci_run (struct usb_hcd *hcd
>  	 * from the companions to the EHCI controller.  If any of the
>  	 * companions are in the middle of a port reset at the time, it
>  	 * could cause trouble.  Write-locking ehci_cf_port_reset_rwsem
> -	 * guarantees that no resets are in progress.
> +	 * guarantees that no resets are in progress.  After we set CF,
> +	 * a short delay lets the hardware catch up; new resets shouldn't
> +	 * start before the port switching actions complete.
>  	 */
>  	down_write(&ehci_cf_port_reset_rwsem);
>  	hcd->state = HC_STATE_RUNNING;
>  	ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag);
>  	ehci_readl(ehci, &ehci->regs->command);	/* unblock posted writes */
> +	msleep(5);
>  	up_write(&ehci_cf_port_reset_rwsem);
>  
>  	temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase));

This addition certainly won't hurt.  Did we ever get any feedback as to 
whether it actually helped?

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