Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Gaurav Kohli" <gaurav.kohli@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 1/6] dt-bindings: thermal: thermal-zones: add hardware-binning trip properties
Date: Fri, 02 Oct 2026 10:55:13 +0000	[thread overview]
Message-ID: <20261002105513.D178F1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261002-thermal_bin-v1-1-5a29be7e8ec5@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] dt-bindings: thermal: backward compatibility broken by oneOf temperature exclusivity
- [Medium] dt-bindings: thermal: ambiguous temperature selection for overlapping hw masks
- [Low] dt-bindings: thermal: missing min/max constraints on temperature-bin
--

commit b87ec3c80f04fa5778f69e6acbc48a25d9b23994
Author: Amit Kucheria <amit.kucheria@oss.qualcomm.com>

dt-bindings: thermal: thermal-zones: add hardware-binning trip properties

This commit adds new optional device tree properties, `temperature-bin` and
`thermal-hw-bin`, to allow specifying different thermal trip temperatures
based on hardware revisions encoded in fuses. It aims to support SoC SKUs
with different thermal characteristics.

> diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> index 999ad40a20d5c..cbe72c2ef87c0 100644
> --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> @@ -152,6 +152,51 @@ patternProperties:
[ ... ]
> +            temperature-bin:
> +              $ref: /schemas/types.yaml#/definitions/int32-array
> +              description: |
> +                An array of integers expressing trip temperatures in

[Severity: Low]
The original `temperature` property enforces logical bounding constraints
(such as minimum and maximum). This new `temperature-bin` array lacks the
corresponding `items` minimum and maximum constraints, which might allow
invalid or physically impossible temperature values to pass validation.

Should we add `items` constraints here to enforce valid temperature ranges?

[ ... ]
> +            thermal-hw-bin:
> +              $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +              description: |
> +                Optional bitmask(s) describing the hardware revisions for
[ ... ]
> +                When used together with 'temperature-bin', the number of
> +                sub-groups must equal the number of entries in
> +                'temperature-bin'.

[Severity: Medium]
The binding specifies how a sub-group matches, but it doesn't specify a
precedence rule if multiple bitmask sub-groups evaluate to true at the same
time.

If a hardware revision sets multiple fuse bits and matches overlapping
masks, which entry in `temperature-bin` is selected?

Could we add a clear precedence rule here, such as the first matching
sub-group taking precedence, to avoid inconsistent thermal configurations?

[ ... ]
> @@ -179,8 +224,14 @@ patternProperties:
[ ... ]
> +          oneOf:
> +            - required:
> +                - temperature
> +            - required:
> +                - temperature-bin

[Severity: High]
This `oneOf` requirement strictly forbids the presence of both `temperature`
and `temperature-bin`.

If a device tree is updated to use `temperature-bin`, the author is forced
to remove `temperature`. When an older kernel (which only understands
`temperature`) boots with this updated device tree, it will fail to parse
the thermal trip point completely. Missing trip points result in a complete
loss of thermal protection, which can lead to hardware damage from
overheating.

Should we allow `temperature` as a fallback property for older OSes by
using `anyOf` instead of `oneOf`?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261002-thermal_bin-v1-0-5a29be7e8ec5@oss.qualcomm.com?part=1

  reply	other threads:[~2026-10-02 10:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 10:46 [PATCH 0/6] thermal: Add hardware-binned trip point support Gaurav Kohli
2026-10-02 10:46 ` [PATCH 1/6] dt-bindings: thermal: thermal-zones: add hardware-binning trip properties Gaurav Kohli
2026-10-02 10:55   ` sashiko-bot [this message]
2026-10-02 10:46 ` [PATCH 2/6] thermal: add hardware-binning trip-point filtering support Gaurav Kohli
2026-10-02 10:59   ` sashiko-bot
2026-10-02 10:46 ` [PATCH 3/6] dt-bindings: thermal: qcom-tsens: document qcm6490 tsens Gaurav Kohli
2026-10-02 10:46 ` [PATCH 4/6] thermal: qcom: tsens: add hardware-bin trip-point filtering Gaurav Kohli
2026-10-02 10:57   ` sashiko-bot
2026-10-02 10:47 ` [PATCH 5/6] arm64: dts: qcom: kodiak: use thermal hw-bin trips Gaurav Kohli
2026-10-02 10:47 ` [PATCH 6/6] arm64: dts: qcom: hamoa: add thermal hw-bin support Gaurav Kohli

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=20261002105513.D178F1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gaurav.kohli@oss.qualcomm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox