Page MenuHomeFreeBSD

watchdog: Convert to using sbintime_t format
ClosedPublic

Authored by jhibbits on Feb 28 2025, 6:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 8:42 PM
Unknown Object (File)
Sat, Oct 11, 8:42 PM
Unknown Object (File)
Sat, Oct 11, 8:42 PM
Unknown Object (File)
Sat, Oct 11, 11:39 AM
Unknown Object (File)
Thu, Sep 25, 4:29 PM
Unknown Object (File)
Wed, Sep 24, 1:09 AM
Unknown Object (File)
Tue, Sep 23, 3:48 PM
Unknown Object (File)
Tue, Sep 23, 3:18 PM
Subscribers

Details

Summary

Some watchdogs are now based on a countdown timer instead of a bit
check. To deal with these, convert the watchdog framework to use
sbintime_t instead of power-of-2-nanoseconds. This allows more
precision, and more variety of watchdog timeouts. Keep the old method
as a compatibility layer, so that drivers can be migrated slowly, as
needed.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/watchdog/watchdog.c
198

Spurious line?

390

Hmm, you could just let these all fall through to the default case for now. Even if you want explicit case statements maybe just use:

case WDIOC_GETTIMEOUT:
case WDIOC_GETTIMELEFT:
...
default:
           error = ENIOCTL;

This looks ok to me.

This revision is now accepted and ready to land.Aug 14 2025, 5:07 PM