All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jerome Tollet" <jerome.tollet@gmail.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v6 1/3] hwmon: it87: describe per-chip temperature resources
Date: Sat, 29 Aug 2026 21:17:13 +0000	[thread overview]
Message-ID: <20260829211714.4C8971F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260829210036.61136-2-jerome.tollet@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The driver queries extended temperature limits and offsets for channels 4-6 from the hardware but fails to expose them in sysfs, making the newly added feature inaccessible to userspace.
--

commit a00b7b5308a4440e2558cdfeab430801514fd5ce
Author: benoit.masson <yahoo@perenite.com>

    hwmon: it87: describe per-chip temperature resources
    
    Add per-chip temp limit/offset/map counts and wire the driver
    to use them.
    
    This keeps existing chips on the previous defaults while allowing newer
    chips to advertise larger resources.

> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> index 87edb1b6048bb..1af815b5d33a9 100644
> --- a/drivers/hwmon/it87.c
> +++ b/drivers/hwmon/it87.c
[ ... ]
> @@ -379,18 +397,24 @@ static const struct it87_devices it87_devices[] = {
>  		.name = "it8728",
>  		.model = "IT8728F",
>  		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
> -		  | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_FIVE_FANS
> +		  | FEAT_TEMP_PECI | FEAT_FIVE_FANS
>  		  | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2
>  		  | FEAT_FANCTL_ONOFF,
> +		.num_temp_limit = 6,

[Severity: Medium]
With num_temp_limit updated to 6 for newer chips to support reading
temperature limits and offsets for channels 4-6 from the hardware, do these
new attributes need to be exposed to userspace?

The driver's sysfs mapping array statically lacks limit and offset
attributes for temp4-6:

drivers/hwmon/it87.c:it87_attributes_temp[] {
    ...
	&sensor_dev_attr_temp4_input.dev_attr.attr,	/* 21 */
	&sensor_dev_attr_temp5_input.dev_attr.attr,
	&sensor_dev_attr_temp6_input.dev_attr.attr,
	NULL
}

Additionally, the hardcoded logic in it87_temp_is_visible() restricts these
attributes:

drivers/hwmon/it87.c:it87_temp_is_visible() {
    ...
	if (index >= 21) {
		i = index - 21 + 3;
		a = 0;
	}
    ...
}

This logic forces a = 0 (input) for all attributes beyond index 21, which
structurally prevents the visibility of min, max, or offset attributes for
temp 4-6 even if they were appended to the array.

Does the sysfs attribute mapping and visibility logic need to be updated so
that userspace can access the newly queried hardware limits?

> +		.num_temp_offset = 3,
> +		.num_temp_map = 3,
>  		.peci_mask = 0x07,
>  	},

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260829210036.61136-1-jerome.tollet@gmail.com?part=1

  reply	other threads:[~2026-08-29 21:17 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29 17:05 [PATCH v5 0/4] hwmon: it87: add IT8613E support Jerome Tollet
2026-08-29 17:05 ` [PATCH v5 1/4] hwmon: it87: describe per-chip temperature resources Jerome Tollet
2026-08-29 17:20   ` sashiko-bot
2026-08-29 17:05 ` [PATCH v5 2/4] hwmon: it87: prepare for extended PWM temp maps Jerome Tollet
2026-08-29 17:20   ` sashiko-bot
2026-08-29 17:05 ` [PATCH v5 3/4] hwmon: it87: expose additional temperature limits Jerome Tollet
2026-08-29 17:17   ` sashiko-bot
2026-08-29 17:05 ` [PATCH v5 4/4] hwmon: it87: add IT8613E support Jerome Tollet
2026-08-29 17:23   ` sashiko-bot
2026-08-29 21:00 ` [PATCH v6 0/3] " Jerome Tollet
2026-08-29 21:00   ` [PATCH v6 1/3] hwmon: it87: describe per-chip temperature resources Jerome Tollet
2026-08-29 21:17     ` sashiko-bot [this message]
2026-08-29 21:00   ` [PATCH v6 2/3] hwmon: it87: prepare for extended PWM temp maps Jerome Tollet
2026-08-29 21:14     ` sashiko-bot
2026-08-29 21:00   ` [PATCH v6 3/3] hwmon: it87: add IT8613E support Jerome Tollet
2026-08-29 21:15     ` sashiko-bot
2026-08-29 22:01   ` [PATCH v7 0/3] " Jerome Tollet
2026-08-29 22:01     ` [PATCH v7 1/3] hwmon: it87: describe per-chip PWM temperature maps Jerome Tollet
2026-08-29 22:08       ` sashiko-bot
2026-08-30  0:01       ` Guenter Roeck
2026-08-29 22:01     ` [PATCH v7 2/3] hwmon: it87: prepare for extended PWM temp maps Jerome Tollet
2026-08-29 22:14       ` sashiko-bot
2026-08-30  0:01       ` Guenter Roeck
2026-08-29 22:01     ` [PATCH v7 3/3] hwmon: it87: add IT8613E support Jerome Tollet
2026-08-29 22:11       ` sashiko-bot
2026-08-30  0:02       ` Guenter Roeck
2026-08-29 22:53   ` [PATCH v6 0/3] " Guenter Roeck
2026-08-30  5:19     ` Jerome Tollet

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=20260829211714.4C8971F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jerome.tollet@gmail.com \
    --cc=linux-hwmon@vger.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.