Re: [PATCH v3 2/3] docs: watchdog: npcm: Add reset status description
Tomer Maimon <[email protected]>
| Newsgroups | org.kernel.vger.linux-watchdog,dev.linux.lists.sashiko-reviews,org.kernel.vger.linux-devicetree |
|---|---|
| Message-ID | <CAP6Zq1jT-bfHvw65EsDKdqMCLVK1Yw3dd0NaxpOCw3zx+hVMTA@mail.gmail.com> |
Hi, On Sun, 5 Jul 2026 at 17:06, <[email protected]> wrote: > > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [High] The watchdog driver abuses standard Watchdog UAPI constants to report non-watchdog platform reset causes, violating the userspace ABI contract. > -- > > commit 72fd6c8b87d96376853f3dcd5ef1597495cf9817 > Author: Tomer Maimon <[email protected]> > > docs: watchdog: npcm: Add reset status description > > Add documentation describing how the NPCM watchdog driver reports reset > causes through bootstatus on NPCM750 and NPCM845 systems. > > > diff --git a/Documentation/watchdog/npcm_wdt.rst b/Documentation/watchdog/npcm_wdt.rst > > new file mode 100644 > > index 0000000000000..cdc45ade9e0d9 > > --- /dev/null > > +++ b/Documentation/watchdog/npcm_wdt.rst > > [ ... ] > > > +.. list-table:: Reset-cause mapping > > + :header-rows: 1 > > + > > + * - Platform > > + - Reset indication > > + - Bootstatus flag > > + - Reported meaning > > + * - NPCM750 and NPCM845 > > + - ``PORST`` > > + - ``WDIOF_OVERHEAT`` > > + - power-on reset > > + * - NPCM750 and NPCM845 > > + - ``CORST`` > > + - ``WDIOF_FANFAULT`` > > + - core reset > > [Severity: High] > Is it correct to map generic Watchdog UAPI thermal and fan failure flags to > standard platform reset indications? > Yes, it is something that was already discussed with the WD maintainer; This is why it is mentioned in the rst document > The generic Watchdog API defines strict semantics for its status flags. > For instance, WDIOF_OVERHEAT means a reset due to CPU overheat, and > WDIOF_FANFAULT means a fan failed. By mapping standard SoC reset causes like > Power-On Reset (PORST) to WDIOF_OVERHEAT and Core Reset (CORST) to > WDIOF_FANFAULT, might this break the userspace ABI contract? > > During a normal cold boot, reading the SoC latch would unconditionally expose > this to userspace via the WDIOC_GETBOOTSTATUS ioctl or sysfs. Standard > userspace monitoring daemons (like systemd or wdctl) reading bootstatus > might erroneously conclude the system suffered a thermal event or fan failure, > potentially triggering unintended emergency actions or false alarms. > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2 Thanks, Tomer