On Wed, Dec 02, 2020 at 11:43:32PM +0100, Mark Kettenis wrote:
> > From: "Constantine A. Murenin" <[email protected]>
> > Date: Wed, 2 Dec 2020 14:04:52 -0800
> >
> > Not sure if you've seen it, but ipmi(4) has been disabled for over 12
> > years, because it's broken on some machines, so, this code is not
> > necessarily guaranteed to be correct as-is.
> >
> > http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/i386/conf/GENERIC#rev1.632
> > http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/amd64/conf/GENERIC#rev1.238
>
> The driver is actually enabled on arm64. And I'll probably enable it
> on powerpc64 at some point.
kettenis@/sthen@:
In that case, could one or both of you test this diff?
I doubt anyone remembers why we spin until tsleep(9) returns
EWOULDBLOCK. If we can confirm that the driver still works with a 1ms
block in this spot then that's good enough for me.
So, does this still work?
Index: ipmi.c
===================================================================
RCS file: /cvs/src/sys/dev/ipmi.c,v
retrieving revision 1.112
diff -u -p -r1.112 ipmi.c
--- ipmi.c 29 Mar 2020 09:31:10 -0000 1.112
+++ ipmi.c 2 Dec 2020 20:31:57 -0000
@@ -1497,7 +1497,8 @@ ipmi_poll_thread(void *arg)
printf("%s: no SDRs IPMI disabled\n", DEVNAME(sc));
goto done;
}
- while (tsleep(sc, PWAIT, "ipmirun", 1) != EWOULDBLOCK)
+ while (tsleep_nsec(sc, PWAIT, "ipmirun",
+ MSEC_TO_NSEC(1)) != EWOULDBLOCK)
continue;
}