Page MenuHomeFreeBSD

watchdog: Convert to using sbintime_t format
Needs ReviewPublic

Authored by jhibbits on Feb 28 2025, 6:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 3, 4:54 AM
Unknown Object (File)
Tue, May 27, 4:13 AM
Unknown Object (File)
Apr 17 2025, 11:32 AM
Unknown Object (File)
Apr 6 2025, 9:22 AM
Unknown Object (File)
Mar 1 2025, 5:43 PM
Unknown Object (File)
Mar 1 2025, 5:24 PM
Unknown Object (File)
Mar 1 2025, 3:11 PM
Subscribers

Details

Reviewers
jhb
phk
stevek
imp
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 62697
Build 59581: arc lint + arc unit

Event Timeline

sys/dev/watchdog/watchdog.c
202

Spurious line?

395

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;