[RFC/PATCH v3 1/2] watchdog_ioctl: Add decoding of WDIOC_GETSUPPORT and WDIOC_SETOPTIONS ioctls

Eugene Syromyatnikov evgsyr at gmail.com
Sun Aug 25 14:15:51 UTC 2024


On Sun, Aug 25, 2024 at 01:07:28PM +0530, Sahil wrote:
> On Sunday, August 25, 2024 8:04:38 AM GMT+5:30 Eugene Syromyatnikov wrote:
> > I wonder if PRINT_FIELD_X makes more sense here—sometimes developers
> > tend to encode major/minor revisions as multiples of 16.  Do you have
> > any insight in what actually appears here in the wild, by chance?
> >
> 
> I have an intel TCO watchdog driver and it's firmware_version field is set to 6.
> In the linux kernel in "drivers/watchdog/iTCO_wdt.c", I see that this driver can
> take values from 0 through 6 as the firmware version [1].
> 
> For several drivers it's hardcoded to 0 (eg: Hardware Watchdog for SGI IP22) or
> 1 (eg: Wafer 5823 WDT).
> 
> For the PowerPC Book-E watchdog driver, the firmware_version is defined as the
> cpu spec's "pvr_value" [2] which can take values 0x8020, 0x8021 [3].
> 
> I am beginning to think PRINT_FIELD_X will be neater for the firmware_version.
> What are your thoughts on this?

I concur, I'd rather err on the side of printing it as a hexadecimal
number, as there is a variety of the ways it is used and interpreted,
and since there is at least one precedent of interpreting the version
as hexadecimal.

> Thanks,
> Sahil
> 
> [1] https://github.com/torvalds/linux/blob/master/drivers/watchdog/iTCO_wdt.c#L546
> [2] https://github.com/torvalds/linux/blob/master/drivers/watchdog/booke_wdt.c#L225
> [3] https://www.nxp.com/docs/en/reference-manual/E500CORERM.pdf (Section 1.2)
> 
> 


More information about the Strace-devel mailing list