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)
Mon, Mar 2, 3:23 PM
Unknown Object (File)
Fri, Feb 27, 10:42 PM
Unknown Object (File)
Fri, Feb 27, 12:15 PM
Unknown Object (File)
Fri, Feb 27, 3:23 AM
Unknown Object (File)
Feb 2 2026, 11:08 PM
Unknown Object (File)
Jan 22 2026, 1:22 AM
Unknown Object (File)
Dec 6 2025, 2:16 PM
Unknown Object (File)
Nov 28 2025, 2:28 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