All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "John den Heijer" <jdenheijer74@gmail.com>, linux-hwmon@vger.kernel.org
Subject: Re: [RFC PATCH v2 2/3] hwmon: (asus-ec-sensors) add opt-in MAXIMUS XI HERO EXT fan RPM
Date: Sat, 28 Nov 2026 19:19:46 +0000	[thread overview]
Message-ID: <sashiko-outbox-238991@kernel.org> (raw)
In-Reply-To: <20261128191225.2990-3-jdenheijer74@gmail.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] hwmon: (asus-ec-sensors) stale init flag in
  asus_ec_prepare_ext_fans()
- [Low] hwmon: (asus-ec-sensors) undocumented enable_ext_fan module
  parameter
- [Low] hwmon: (asus-ec-sensors) unexplained RPM threshold and param in
  changelog
--

commit e9b20b7038826b0be65d8cbba573ea701113d8d0
Author: John den Heijer <jdenheijer74@gmail.com>

hwmon: (asus-ec-sensors) add opt-in MAXIMUS XI HERO EXT fan RPM

This commit adds opt-in support for reading the three extension fan card
tachometer channels on the ROG MAXIMUS XI HERO motherboard via a new
enable_ext_fan module parameter.

> diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
> index 6e06256a5e2d6..45beba10fd5c5 100644
> --- a/drivers/hwmon/asus-ec-sensors.c
> +++ b/drivers/hwmon/asus-ec-sensors.c

[ ... ]

> @@ -1306,6 +1330,30 @@ static int asus_ec_bank_switch(u8 bank, u8 *old)
>  	return ec_write(ASUS_EC_BANK_REGISTER, bank);
>  }
>  
> +static int asus_ec_prepare_ext_fans(struct ec_sensors_data *ec)
> +{
> +	u8 enabled, channels;
> +	int status;
> +
> +	status = ec_read(ASUS_EC_EXT_FAN_ENABLE_REGISTER, &enabled);
> +	if (status)
> +		return status;
> +	if (ec->ext_fan_initialized && (enabled & BIT(7)))
> +		return 0;
> +
> +	status = ec_write(ASUS_EC_EXT_FAN_ENABLE_REGISTER, enabled | BIT(7));
> +	if (status)
> +		return status;
> +	status = ec_read(ASUS_EC_EXT_FAN_CHANNEL_REGISTER, &channels);
> +	if (status)
> +		return status;
> +	status = ec_write(ASUS_EC_EXT_FAN_CHANNEL_REGISTER,
> +			  channels | GENMASK(2, 0));
> +	if (!status)
> +		ec->ext_fan_initialized = true;
> +	return status;
> +}

[Severity: Medium]
Can a transient failure when accessing ASUS_EC_EXT_FAN_CHANNEL_REGISTER
after a lost latch leave the extension fan channels unconfigured on all
later polls?

Once the first poll sets ec->ext_fan_initialized = true, a later lost latch
clears BIT(7) in ASUS_EC_EXT_FAN_ENABLE_REGISTER without clearing
ec->ext_fan_initialized.  If re-enabling BIT(7) in
ASUS_EC_EXT_FAN_ENABLE_REGISTER succeeds on recovery, but reading or
writing ASUS_EC_EXT_FAN_CHANNEL_REGISTER fails, both
ec->ext_fan_initialized and BIT(7) remain set.  Subsequent calls to
asus_ec_prepare_ext_fans() will then take the early return and skip
restoring GENMASK(2, 0) in ASUS_EC_EXT_FAN_CHANNEL_REGISTER.

Clearing ec->ext_fan_initialized = false before writing
ASUS_EC_EXT_FAN_ENABLE_REGISTER would ensure recovery retries the full
sequence.

[ ... ]

> @@ -1503,8 +1557,11 @@ static int asus_ec_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
>  		return ret;
>  
>  	sensor_info = get_sensor_info(state, sidx);
> +	ec_sensor = get_ec_sensor_type(state, sidx);
> +	if (state->ext_fan_enabled && ec_sensor >= ec_sensor_fan_ext_1 &&
> +	    ec_sensor <= ec_sensor_fan_ext_3 && value < ASUS_EC_EXT_FAN_RPM_MIN)
> +		value = 0;

[Severity: Low]
This isn't a bug, but neither the commit message nor a comment explains why
extension fan readings below ASUS_EC_EXT_FAN_RPM_MIN (0xa5) are clamped to
0, and the commit message does not mention the enable_ext_fan module
parameter used to opt in.

[ ... ]

> @@ -1745,6 +1808,9 @@ module_exit(asus_ec_exit);
>  module_param_named(mutex_path, mutex_path_override, charp, 0);
>  MODULE_PARM_DESC(mutex_path,
>  		 "Override ACPI mutex path used to guard access to hardware");
> +module_param(enable_ext_fan, bool, 0);
> +MODULE_PARM_DESC(enable_ext_fan,
> +		 "Enable Fan Extension Card sensors on ROG MAXIMUS XI HERO");

[Severity: Low]
Should the new enable_ext_fan module parameter also be documented under the
Module Parameters section in Documentation/hwmon/asus_ec_sensors.rst?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261128191225.2990-1-jdenheijer74@gmail.com?part=2

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 19:12 [RFC PATCH v2 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card John den Heijer
2026-11-28 19:12 ` [RFC PATCH v2 1/3] hwmon: (asus-ec-sensors) propagate EC read and selector errors John den Heijer
2026-11-28 19:17   ` sashiko-bot
2026-11-30  8:55   ` Eugene Shalygin
2026-11-30 10:27     ` John den Heijer
2026-11-28 19:12 ` [RFC PATCH v2 2/3] hwmon: (asus-ec-sensors) add opt-in MAXIMUS XI HERO EXT fan RPM John den Heijer
2026-11-28 19:19   ` sashiko-bot [this message]
2026-11-28 19:12 ` [RFC PATCH v2 3/3] hwmon: (asus-ec-sensors) add MAXIMUS XI HERO EXT thermistors John den Heijer
2026-11-28 19:19 ` [RFC PATCH v2 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card 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=sashiko-outbox-238991@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jdenheijer74@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.