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)
Wed, Nov 12, 10:37 PM
Unknown Object (File)
Mon, Nov 10, 11:39 PM
Unknown Object (File)
Tue, Nov 4, 9:35 PM
Unknown Object (File)
Tue, Nov 4, 9:46 AM
Unknown Object (File)
Sun, Nov 2, 11:46 PM
Unknown Object (File)
Mon, Oct 27, 12:54 AM
Unknown Object (File)
Sat, Oct 25, 9:27 AM
Unknown Object (File)
Oct 20 2025, 12:16 AM
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