From: sashiko-bot@kernel.org
To: "Daniel Lezcano" <daniel.lezcano@oss.qualcomm.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v2 12/12] dt-bindings: thermal: cooling-devices: Update support for 3 cells cooling device
Date: Thu, 23 Apr 2026 00:23:24 +0000 [thread overview]
Message-ID: <20260423002325.38A8FC19425@smtp.kernel.org> (raw)
In-Reply-To: <20260422174305.2899095-13-daniel.lezcano@oss.qualcomm.com>
Sashiko AI review found 1 potential issue(s):
- [High] Schema Validation Loophole: Relaxing the global `#cooling-cells` property allows invalid device tree configurations to pass schema validation.
--
commit 4d1db5332aa8215862512cf05a640de7afe86998
Author: Gaurav Kohli <gaurav.kohli@oss.qualcomm.com>
dt-bindings: thermal: cooling-devices: Update support for 3 cells cooling device
This commit extends the thermal cooling device binding to support a 3 cells
specifier in addition to the 2 cells format. It updates the core
#cooling-cells property to an enum allowing both 2 and 3 arguments, and
adds an explicit constraint to pwm-fan.yaml.
> diff --git a/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml b/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml
> --- a/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml
> +++ b/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml
[ ... ]
> @@ -44,10 +44,14 @@ select: true
> properties:
> "#cooling-cells":
> description:
> - Must be 2, in order to specify minimum and maximum cooling state used in
> + Must be 2 or 3. If 2, specifies minimum and maximum cooling state used in
> the cooling-maps reference. The first cell is the minimum cooling state
> and the second cell is the maximum cooling state requested.
> - const: 2
> + If 3, the first cell specifies the thermal mitigation device specifier
> + index for devices that support multiple thermal mitigation mechanisms.
> + The two other cells are respectively the minimum cooling state and the
> + maximum cooling state.
> + enum: [2, 3]
By relaxing the core schema to allow 3 cells globally, does this
unintentionally create a validation loophole for other cooling providers?
Many specific cooling provider bindings (such as nvidia,tegra210-emc.yaml
or CPU nodes via arm/cpus.yaml) completely omitted local #cooling-cells
constraints because they relied entirely on this core schema to enforce
const: 2.
Since the core schema now allows 3 cells, any device binding lacking an
explicit const: 2 override will silently accept 3 cells, even if the
hardware or driver only supports 2.
Have all other existing cooling providers been audited and updated to ensure
they have a local const: 2 constraint where needed, similar to what was done
for pwm-fan.yaml?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260422174305.2899095-1-daniel.lezcano@oss.qualcomm.com?part=12
next prev parent reply other threads:[~2026-04-23 0:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 17:42 [PATCH v2 00/12] Support cooling device with ID in the OF Daniel Lezcano
2026-04-22 17:42 ` [PATCH v2 01/12] thermal/driver/tegra/soctherm: Use devm_ variant when registering a cooling device Daniel Lezcano
2026-04-22 21:38 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 02/12] thermal/of: Move OF code where it belongs to Daniel Lezcano
2026-04-22 21:49 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 03/12] thermal/core: Make thermal_cooling_device_init_complete() non static Daniel Lezcano
2026-04-22 17:42 ` [PATCH v2 04/12] thermal/core: Remove node pointer parameter when registering a tz Daniel Lezcano
2026-04-22 22:25 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 05/12] thermal/of: Move the node pointer assignation in the OF code file Daniel Lezcano
2026-04-22 22:50 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 06/12] hwmon:: Use non-OF thermal cooling device register function Daniel Lezcano
2026-04-22 17:42 ` [PATCH v2 07/12] thermal/core: Put of_node field cooling device structure under Kconfig option Daniel Lezcano
2026-04-22 23:19 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 08/12] thermal/of: Rename the devm_thermal_of_cooling_device_register() function Daniel Lezcano
2026-04-22 17:42 ` Daniel Lezcano
2026-04-22 23:33 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 09/12] thermal/of: Introduce cooling device of_index Daniel Lezcano
2026-04-22 23:48 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 10/12] thermal/of: Pass the of_index and add a function to register with an index Daniel Lezcano
2026-04-22 17:43 ` [PATCH v2 11/12] thermal/of: Process cooling device index in cooling-spec Daniel Lezcano
2026-04-22 17:43 ` [PATCH v2 12/12] dt-bindings: thermal: cooling-devices: Update support for 3 cells cooling device Daniel Lezcano
2026-04-23 0:23 ` sashiko-bot [this message]
2026-04-23 8:33 ` Krzysztof Kozlowski
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=20260423002325.38A8FC19425@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=daniel.lezcano@oss.qualcomm.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=sashiko@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.