NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-i386/57662: StarTech ICUSB23208FD 8-Port USB-to-Serial Adapter Hub fails on Alix with NetBSD/i386 9.3



Also: Can you try this patch on top as well?
From fe71f2d88628e0a801d04fc4ad4b4667272c065f Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Sat, 28 Oct 2023 02:01:10 +0000
Subject: [PATCH] ehci(4): Fix bug causing missed wakeups since ehci.c 1.308.

For reasons beyond me now, I used cv_signal on the same cv that is
used to wait for the doorbell to be available _and_ to wait for the
host controller to acknowledge the doorbell.  Which means when the
host controller acknowledges the doorbell, we might wake some thread
waiting for the doorbell to be available -- and leave the thread
waiting for the doorbell acknowledgment hanging indefinitely.

PR port-i386/57662

XXX pullup-10
---
 sys/dev/usb/ehci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index b59ad33b6395..3ffdec9c6657 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -826,7 +826,7 @@ ehci_doorbell(void *addr)
 	if (sc->sc_doorbelllwp == NULL)
 		DPRINTF("spurious doorbell interrupt", 0, 0, 0, 0);
 	sc->sc_doorbelllwp = NULL;
-	cv_signal(&sc->sc_doorbell);
+	cv_broadcast(&sc->sc_doorbell);
 	mutex_exit(&sc->sc_lock);
 }
 
@@ -2279,7 +2279,7 @@ ehci_sync_hc(ehci_softc_t *sc)
 		now = getticks();
 		if (now - starttime >= delta) {
 			sc->sc_doorbelllwp = NULL;
-			cv_signal(&sc->sc_doorbell);
+			cv_broadcast(&sc->sc_doorbell);
 			DPRINTF("doorbell timeout", 0, 0, 0, 0);
 #ifdef DIAGNOSTIC		/* XXX DIAGNOSTIC abuse, do this differently */
 			printf("ehci_sync_hc: timed out\n");


Home | Main Index | Thread Index | Old Index