Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Daniel Lezcano" <daniel.lezcano@oss.qualcomm.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org,
	linux-hwmon@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/3] platform: arm64: lenovo-thinkpad-t14s: Wire EC thermal events to hwmon
Date: Tue, 30 Jun 2026 15:05:00 +0000	[thread overview]
Message-ID: <20260630150501.34CDF1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260630145307.10745-3-daniel.lezcano@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch adds HWMON_T_ALARM to the hwmon temperature channels to support thermal alarms but fails to expose or handle hwmon_temp_alarm in the is_visible and read callbacks, rendering the alarm attribute invisible and inaccessible.
--

commit 100b1ed0167b57e72fe6d235a080f1fbdce5fee9
Author: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>

platform: arm64: lenovo-thinkpad-t14s: Wire EC thermal events to hwmon

This commit wires up EC thermal zone status change notifications to the
hwmon notification framework. It associates hwmon temperature channels
with EC events and adds thermal alarm capabilities.

> diff --git a/drivers/platform/arm64/lenovo-thinkpad-t14s.c b/drivers/platform/arm64/lenovo-thinkpad-t14s.c
> index 35a6f8b0cb6b1..5fafb01a2b332 100644
> --- a/drivers/platform/arm64/lenovo-thinkpad-t14s.c
> +++ b/drivers/platform/arm64/lenovo-thinkpad-t14s.c

[ ... ]

> @@ -640,13 +653,14 @@ static const struct hwmon_ops t14s_ec_hwmon_ops = {
>  };
>  
>  static const struct hwmon_channel_info *t14s_ec_hwmon_info[] = {
> +	HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
>  	HWMON_CHANNEL_INFO(temp,
> -			   HWMON_T_INPUT | HWMON_T_LABEL,
> -			   HWMON_T_INPUT | HWMON_T_LABEL,
> -			   HWMON_T_INPUT | HWMON_T_LABEL,
> -			   HWMON_T_INPUT | HWMON_T_LABEL,
> -			   HWMON_T_INPUT | HWMON_T_LABEL,
> -			   HWMON_T_INPUT | HWMON_T_LABEL),
> +			   HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_ALARM,
> +			   HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_ALARM,
> +			   HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_ALARM,
> +			   HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_ALARM,
> +			   HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_ALARM,
> +			   HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_ALARM),
>  	NULL
>  };

[Severity: Medium]
Since HWMON_T_ALARM is added here, do t14s_ec_hwmon_is_visible() and
t14s_ec_hwmon_read() also need to be updated to handle hwmon_temp_alarm?

If t14s_ec_hwmon_is_visible() is not updated to support hwmon_temp_alarm,
it falls through to returning 0:

static umode_t t14s_ec_hwmon_is_visible(...)
{
        switch (type) {
        case hwmon_temp:
                if (attr == hwmon_temp_input ||
                    attr == hwmon_temp_label)
                        return 0444;
                break;
        default:
                return 0;
        }

        return 0;
}

Will this prevent the sysfs file from being created by the hwmon core,
meaning hwmon_notify_event() will attempt to notify on a non-existent file,
and userspace will not be able to read the alarm state?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260630145307.10745-1-daniel.lezcano@oss.qualcomm.com?part=2

  parent reply	other threads:[~2026-06-30 15:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 14:53 [PATCH v2 0/3] Lenovo ThinkPad T14s EC thermal monitoring and thermal zone integration Daniel Lezcano
2026-06-30 14:53 ` [PATCH v2 1/3] platform: arm64:: lenovo-thinkpad-t14s-ec: Add hwmon support for temperatures Daniel Lezcano
2026-06-30 14:58   ` sashiko-bot
2026-06-30 15:08   ` Ilpo Järvinen
2026-06-30 14:53 ` [PATCH v2 2/3] platform: arm64: lenovo-thinkpad-t14s: Wire EC thermal events to hwmon Daniel Lezcano
2026-06-30 15:03   ` Ilpo Järvinen
2026-06-30 15:05   ` sashiko-bot [this message]
2026-06-30 14:53 ` [PATCH v2 3/3] arm64: dts: qcom: x1e78100-t14s: Add thermal zones for keyboard skin and charging sensors Daniel Lezcano
2026-06-30 14:59   ` sashiko-bot

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=20260630150501.34CDF1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@oss.qualcomm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --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