From: sashiko-bot@kernel.org
To: "Mateusz Nowicki" <mateusz.nowicki@posteo.net>,
linux-watchdog@vger.kernel.org
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [RFC PATCH 1/3] dt-bindings: watchdog: arm-smc-wdt: allow a list of SMC ids
Date: Wed, 04 Nov 2026 16:25:20 +0000 [thread overview]
Message-ID: <sashiko-outbox-197603@kernel.org> (raw)
In-Reply-To: <20261104161553.30115-2-mateusz.nowicki@posteo.net>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: watchdog: arm-smc-wdt: unsafe SMC ID probing list in arm,smc-id
--
commit dea383b087f6f2623ae4ede98f366e18fd9b9ed8
Author: Mateusz Nowicki <mateusz.nowicki@posteo.net>
dt-bindings: watchdog: arm-smc-wdt: allow a list of SMC ids
This commit changes the arm,smc-id property in the arm-smc-wdt binding from a
single uint32 to a uint32-array of up to 4 items so the driver can probe a
list of candidate SMC function IDs in order across different firmware
versions.
> diff --git a/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml b/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
> index 8e9d0b7e82444..9844b23ef51ce 100644
> --- a/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
> @@ -18,9 +18,14 @@ properties:
> - arm,smc-wdt
>
> arm,smc-id:
> - $ref: /schemas/types.yaml#/definitions/uint32
> + $ref: /schemas/types.yaml#/definitions/uint32-array
> + minItems: 1
> + maxItems: 4
> description: |
> - The ATF smc function id used by the firmware.
> + The ATF smc function id used by the firmware, or a list of ids for
> + firmware versions that use different ones. The ids are tried in order
> + until the firmware accepts the init call, so only ids that are known
> + to be this watchdog service on the platform belong in the list.
> Defaults to 0x82003D06 if unset.
[Severity: Medium]
Is it safe to define arm,smc-id as a list of candidate SMC function IDs to be
sequentially probed in EL3/S-EL1 secure firmware?
In drivers/watchdog/arm_smc_wdt.c, smcwd_probe() invokes smcwd_call(wdd,
SMCWD_INIT, 0, &res), which issues arm_smccc_smc() with a raw function ID and
arguments a1=0, a2=0 without any UUID or version handshake:
drivers/watchdog/arm_smc_wdt.c:smcwd_probe() {
if (of_property_read_u32(pdev->dev.of_node, "arm,smc-id",
&smc_func_id))
smc_func_id = 0x82003D06;
watchdog_set_drvdata(wdd, (void *)(uintptr_t)smc_func_id);
err = smcwd_call(wdd, SMCWD_INIT, 0, &res);
}
Because SiP and Trusted OS SMCCC function IDs are vendor- and
firmware-specific, an ID used for the watchdog in one firmware release is not
guaranteed to be unimplemented across all other firmware implementations for
that SoC. Could probing a list of candidate IDs invoke an unrelated
privileged SMC handler on firmware versions that assign one of the earlier
IDs to another service, causing unintended secure-world side effects or
binding the watchdog driver to the wrong service if it returns 0?
Also, existing Devicetree consumers (such as older kernels calling
of_property_read_u32() on arm,smc-id) only read the first cell and will fail
if the active firmware uses a subsequent ID in the array. Since a running
firmware image implements a single watchdog SMC ID, should differences
between mutually exclusive firmware builds be handled by the bootloader
updating the Devicetree, a DT overlay, or board-specific DTS files rather
than encoding a trial-and-error probing list in the SoC dtsi?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261104161553.30115-1-mateusz.nowicki@posteo.net?part=1
next prev parent reply other threads:[~2026-11-04 16:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 16:16 [RFC PATCH 0/3] watchdog: arm_smc_wdt: allow a list of SMC function ids Mateusz Nowicki
2026-11-04 16:16 ` [RFC PATCH 1/3] dt-bindings: watchdog: arm-smc-wdt: allow a list of SMC ids Mateusz Nowicki
2026-11-04 16:25 ` sashiko-bot [this message]
2026-11-04 16:47 ` Marek Vasut
2026-11-04 16:16 ` [RFC PATCH 2/3] watchdog: arm_smc_wdt: try every id of arm,smc-id Mateusz Nowicki
2026-11-04 16:16 ` [RFC PATCH 3/3] arm64: dts: st: list both watchdog SMC ids on stm32mp23 and stm32mp25 Mateusz Nowicki
2026-11-04 16:39 ` [RFC PATCH 0/3] watchdog: arm_smc_wdt: allow a list of SMC function ids Guenter Roeck
2026-11-04 16:46 ` Marek Vasut
2026-11-04 18:10 ` mateusz.nowicki
2026-11-04 18:59 ` Guenter Roeck
2026-11-05 2:13 ` Julius Werner
2026-11-05 10:04 ` mateusz.nowicki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-197603@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=mateusz.nowicki@posteo.net \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.