- Subject: Re: [patch 19/26] USB: mutual exclusion for EHCI init and port resets
- From: David Brownell <david-b@xxxxxxxxxxx>
- Date: Mon, 19 Nov 2007 10:41:28 -0800
- Cc: tytso@xxxxxxx, zwane@xxxxxxxxxxxxxxxx, jmforbes@xxxxxxxxxxx, cavokz@xxxxxxxxx, reviews@xxxxxxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, rdunlap@xxxxxxxxxxxx, stern@xxxxxxxxxxxxxxxxxxx, cebbert@xxxxxxxxxx, davej@xxxxxxxxxx, mkrufky@xxxxxxxxxxx, dely.l.sy@xxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx, davem@xxxxxxxxxxxxx, alan@xxxxxxxxxxxxxxxxxxx, chuckw@xxxxxxxxxxxxxxxx
- In-reply-to: <20071119181920.GT15425@xxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
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 SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[Home]
[Video for Linux]
[Photo]
[Yosemite Forum]
[Yosemite Photos]
[Video Projectors]
[PDAs]
[Hacking TiVo]
[Linux Kernel]
[Linux SCSI]
[XFree86]
[Devices]
[Big List of Linux Books]
[Free Dating]