Download raw body.
Small tsleep_nsec(9) fix
On Sat, May 23, 2026 at 08:11:19AM +0200, Marcus Glocker wrote:
> On Sat, May 23, 2026 at 03:53:18PM +1000, Jonathan Gray wrote:
>
> > On Sat, May 23, 2026 at 06:50:43AM +0200, Marcus Glocker wrote:
> > > Found while poking around for other stuff:
> > >
> > > Use the real sc address for tsleep identification instead of the
> > > stack pointer address.
> > >
> > > Ok?
> >
> > these would be better as &nowake as there is no wakeup()
>
> Like that?
not quite, use the global nowake
sys/sys/systm.h:extern int nowake; /* dead wakeup(9) channel */
sys/kern/kern_synch.c:int nowake;
>
> Worth grepping the whole tree for sleeps without wake an apply the
> same pattern (i have no time just right now)?
>
>
> Index: sys/dev/i2c/ietp.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/i2c/ietp.c,v
> diff -u -p -u -p -r1.4 ietp.c
> --- sys/dev/i2c/ietp.c 23 May 2026 05:11:32 -0000 1.4
> +++ sys/dev/i2c/ietp.c 23 May 2026 06:09:18 -0000
> @@ -331,10 +331,12 @@ ietp_activate(struct device *self, int a
> void
> ietp_sleep(struct ietp_softc *sc, int ms)
> {
> + int nowake;
> +
> if (cold)
> delay(ms * 1000);
> else
> - tsleep_nsec(sc, PWAIT, "ietp", MSEC_TO_NSEC(ms));
> + tsleep_nsec(&nowake, PWAIT, "ietp", MSEC_TO_NSEC(ms));
> }
>
> int
> Index: sys/dev/i2c/ihidev.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/i2c/ihidev.c,v
> diff -u -p -u -p -r1.42 ihidev.c
> --- sys/dev/i2c/ihidev.c 23 May 2026 05:11:32 -0000 1.42
> +++ sys/dev/i2c/ihidev.c 23 May 2026 06:09:18 -0000
> @@ -297,10 +297,12 @@ ihidev_activate(struct device *self, int
> void
> ihidev_sleep(struct ihidev_softc *sc, int ms)
> {
> + int nowake;
> +
> if (cold)
> delay(ms * 1000);
> else
> - tsleep_nsec(sc, PWAIT, "ihidev", MSEC_TO_NSEC(ms));
> + tsleep_nsec(&nowake, PWAIT, "ihidev", MSEC_TO_NSEC(ms));
> }
>
> int
> Index: sys/dev/i2c/sambat.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/i2c/sambat.c,v
> diff -u -p -u -p -r1.2 sambat.c
> --- sys/dev/i2c/sambat.c 22 May 2026 21:01:06 -0000 1.2
> +++ sys/dev/i2c/sambat.c 23 May 2026 06:09:18 -0000
> @@ -248,7 +248,7 @@ sambat_mbox_write(struct sambat_softc *s
> uint8_t data)
> {
> uint8_t buf[5];
> - int error;
> + int error, nowake;
>
> buf[0] = SAM_MBOX_WRITE_PREFIX;
> buf[1] = 0x00;
> @@ -276,7 +276,7 @@ sambat_mbox_write(struct sambat_softc *s
> if (cold)
> delay(5000);
> else
> - tsleep_nsec(sc, PWAIT, "sambat", USEC_TO_NSEC(5000));
> + tsleep_nsec(&nowake, PWAIT, "sambat", USEC_TO_NSEC(5000));
>
> return 0;
> }
>
>
Small tsleep_nsec(9) fix