Plan 9 from Bell Labs’s /sources/contrib/mospak/9-portusbehci-reset/9-portusbehci-reset.diff

Copyright © 2026 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


--- sys/src/9/port/usbehci.c
+++ sys/src/9/port/usbehci.c
@@ -1630,7 +1630,6 @@
 	ulong *portscp;
 	Eopio *opio;
 	Ctlr *ctlr;
-	int i;
 
 	if(on == 0)
 		return 0;
@@ -1657,12 +1656,8 @@
 	 * usb 2 spec: reset must finish within 20 ms.
 	 * linux says spec says it can take 50 ms. for hubs.
 	 */
-	for(i = 0; *portscp & Psreset && i < 50; i++)
-		delay(10);
-	if (*portscp & Psreset)
-		iprint("ehci %#p: port %d didn't reset within %d ms; sts %#lux\n",
-			ctlr->capio, port, i * 10, *portscp);
-	*portscp &= ~Psreset;		/* force appearance of reset done */
+	delay(50);
+	*portscp &= ~Psreset;		/* terminate reset */
 	coherence();
 	delay(10);			/* ehci spec: enable within 2 ms. */
 

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2026 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.