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
The following reply was made to PR port-i386/57662; it has been noted by GNATS.
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: Alexander Schreiber <als%thangorodrim.ch@localhost>
Cc: matthew green <mrg%eterna.com.au@localhost>,
port-i386-maintainer%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
netbsd-bugs%netbsd.org@localhost, gnats-bugs%netbsd.org@localhost
Subject: Re: port-i386/57662: StarTech ICUSB23208FD 8-Port USB-to-Serial Adapter Hub fails on Alix with NetBSD/i386 9.3
Date: Sat, 28 Oct 2023 01:51:45 +0000
This is a multi-part message in MIME format.
--=_3GH/d8a4GiEuk6sY511/abKYWvHzDwXu
Can you please try the attached patch and see if it makes a
difference?
Note that it might not fix whatever the underlying problem is, but it
should at least cause the timeout on ehci sync to work instead of
hanging forever.
--=_3GH/d8a4GiEuk6sY511/abKYWvHzDwXu
Content-Type: text/plain; charset="ISO-8859-1"; name="pr57662-ehcisyncloop"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="pr57662-ehcisyncloop.patch"
From 2ccb4d42055737abfb68af0222d8871cbbc8cb6e Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Sat, 28 Oct 2023 01:42:37 +0000
Subject: [PATCH] ehci(4): Fix cv_timedwait loop in ehci_sync_hc.
Stop when
now - starttime >=3D delta,
i.e., when at least delta ticks have elapsed since the start, not
when
endtime - now > delta,
i.e., more than delta ticks _remain_ to sleep, which is never going
to happen (except on arithmetic overflow).
As is, what will happen in the case that should time out is that we
wake up after delta ticks, and find now =3D getticks() is exactly
endtime, so we retry cv_timedwait with timo=3D(endtime - now)=3D0 which
means sleep indefinitely with no timeout as if with cv_wait.
PR kern/57662
XXX pullup-10
---
sys/dev/usb/ehci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index 111957b34bd8..b59ad33b6395 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -2277,7 +2277,7 @@ ehci_sync_hc(ehci_softc_t *sc)
*/
while (sc->sc_doorbelllwp =3D=3D curlwp) {
now =3D getticks();
- if (endtime - now > delta) {
+ if (now - starttime >=3D delta) {
sc->sc_doorbelllwp =3D NULL;
cv_signal(&sc->sc_doorbell);
DPRINTF("doorbell timeout", 0, 0, 0, 0);
--=_3GH/d8a4GiEuk6sY511/abKYWvHzDwXu--
Home |
Main Index |
Thread Index |
Old Index