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: [RFC PATCH] hwmon: it87: Add basic IT8613E fan monitoring support
Date: Sat, 29 Aug 2026 11:19:27 +0000	[thread overview]
Message-ID: <20260829111927.A3D441F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260829110829.34269-1-jerome.tollet@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unconditional execution of PWM, limit, and voltage configuration in it87_resume() bypasses chip safety guards.
--

commit 38aeab66f2bad568170fc7c7a3bf957b47ace77f
Author: Jerome Tollet <jerome.tollet@gmail.com>

hwmon: it87: Add basic IT8613E fan monitoring support
    
The IT8613E is not recognized by the in-tree it87 driver. Full
support was proposed previously but withdrawn after problems were found
in the temperature and PWM paths.

Add conservative support limited to fan input monitoring. Detect device
ID 0x8613, check the fan pin muxes, use the existing 16-bit tachometer
layout, and expose enabled fan inputs read-only.
    
Link: https://lore.kernel.org/linux-hwmon/20260114221210.98071-1-yahoo@perenite.com/

> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> index 87edb1b6048bb..2f58004246c39 100644
> --- a/drivers/hwmon/it87.c
> +++ b/drivers/hwmon/it87.c

[ ... ]

> @@ -3355,7 +3396,8 @@ static void it87_init_device(struct platform_device *pdev)
>  		data->auto_pwm[i][3] = 0x7f;	/* Full speed, hard-coded */
>  	}
>  
> -	it87_check_limit_regs(data);
> +	if (!has_fan_input_only(data))
> +		it87_check_limit_regs(data);
>  
>  	/*
>  	 * Temperature channels are not forcibly enabled, as they can be
> @@ -3364,7 +3406,8 @@ static void it87_init_device(struct platform_device *pdev)
>  	 * run-time through the temp{1-3}_type sysfs accessors if needed.
>  	 */
>  
> -	it87_check_voltage_monitors_reset(data);
> +	if (!has_fan_input_only(data))
> +		it87_check_voltage_monitors_reset(data);
>  
>  	it87_check_tachometers_reset(pdev);

[Severity: High]
Since we need to guard these register writes during initialization, do we
also need to guard them during system resume?

Looking at it87_resume() in drivers/hwmon/it87.c, these functions are called
unconditionally:

static int it87_resume(struct device *dev)
{
        ...
        it87_check_pwm(dev);
        it87_check_limit_regs(data);
        it87_check_voltage_monitors_reset(data);
        ...
}

Could this bypass the has_fan_input_only() guards on the resume path and
attempt to write to unsupported PWM, voltage limit, and VIN enable registers
on the IT8613E chip?

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

      reply	other threads:[~2026-08-29 11:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29 11:08 [RFC PATCH] hwmon: it87: Add basic IT8613E fan monitoring support Jerome Tollet
2026-08-29 11:19 ` sashiko-bot [this message]

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=20260829111927.A3D441F000E9@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.