Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Gaurav Kohli" <gaurav.kohli@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 4/6] thermal: qcom: tsens: add hardware-bin trip-point filtering
Date: Fri, 02 Oct 2026 10:57:51 +0000	[thread overview]
Message-ID: <20261002105751.740BD1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261002-thermal_bin-v1-4-5a29be7e8ec5@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] thermal/tsens: tsens_probe swallows -EPROBE_DEFER permanently disabling hw-bin
- [Low] kconfig: QCOM_TSENS selects THERMAL_BIN without THERMAL_OF dependency
--

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

thermal: qcom: tsens: add hardware-bin trip-point filtering

This commit introduces hardware-bin trip-point filtering for TSENS sensors
on Qualcomm SoCs. It adds a struct tsens_hw_bin_desc to read manufacturing
bins from nvmem cells, synthesizing these into hw-version bitfields that
the thermal core can use to filter supported hardware bins.

> diff --git a/drivers/thermal/qcom/Kconfig b/drivers/thermal/qcom/Kconfig
> index a8cf7e2582010..6aab493333121 100644
> --- a/drivers/thermal/qcom/Kconfig
> +++ b/drivers/thermal/qcom/Kconfig
> @@ -3,6 +3,7 @@ config QCOM_TSENS
>  	tristate "Qualcomm TSENS Temperature Alarm"
>  	depends on NVMEM_QCOM_QFPROM
>  	depends on ARCH_QCOM || COMPILE_TEST
> +	select THERMAL_BIN

[Severity: Low]
Does selecting THERMAL_BIN here without inheriting a dependency on THERMAL_OF
cause an unmet direct dependency warning?

If the kernel is configured with COMPILE_TEST enabled but OF/THERMAL_OF
disabled, this select forces THERMAL_BIN on, violating its explicit
dependency on THERMAL_OF. This can lead to build failures under WERROR.

>  	help
>  	  This enables the thermal sysfs driver for the TSENS device. It shows

[ ... ]

> diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
> index b5ec70201e2f3..26ba63da7163f 100644
> --- a/drivers/thermal/qcom/tsens.c
> +++ b/drivers/thermal/qcom/tsens.c

[ ... ]

> @@ -1425,6 +1602,12 @@ static int tsens_probe(struct platform_device *pdev)
>  	priv->feat = data->feat;
>  	priv->fields = data->fields;
>  
> +	ret = tsens_populate_hw_bin_info(priv, data);
> +	if (ret)
> +		dev_warn(&pdev->dev,
> +			 "thermal-bin failed to read FUSE data (%d): trips with temperature-bin will use first entry\n",
> +			 ret);

[Severity: Medium]
Does catching all errors here permanently disable hardware binning if the
nvmem provider is not yet ready?

If the nvmem provider (qfprom) probes after tsens,
nvmem_cell_read_variable_le_u32() in tsens_populate_hw_bin_info() will
return -EPROBE_DEFER. By logging a warning and continuing instead of
returning the error to the driver core, the probe completes and the
fallback state with default trip points becomes permanent.

Should this explicitly check for and propagate -EPROBE_DEFER?

> +
>  	platform_set_drvdata(pdev, priv);
>  
>  	device_init_wakeup(dev, !data->no_irq_wake);

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

  reply	other threads:[~2026-10-02 10:57 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
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 [this message]
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=20261002105751.740BD1F000FF@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