Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH] hwmon: (pmbus/max34440): Do not treat ASCII MFR_REVISION as MAX34451ETNA6+
@ 2026-11-28  2:52 William A. Kennington III
  2026-11-28  2:55 ` sashiko-bot
  2026-11-28 10:35 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: William A. Kennington III @ 2026-11-28  2:52 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Alexis Czezar Torreno, Uwe Kleine-König, Andrew Davis,
	Carlos Jones Jr, Kees Cook, linux-hwmon,
	William A. Kennington III

Per the MAX34451 datasheet, legacy MAX34451 parts return two ISO/IEC
8859-1 characters in MFR_REVISION (0x9b). On an NPCM730 BMC, both
MAX34451 devices (MFR_ID 0x4d, MFR_MODEL 0x59) return 0x3236.

Comparing rv >= MAX34451ETNA6_MFR_REV (0x0012) and rv >=
MAX34451ETNA8_MFR_REV (0x0014) without checking the upper byte
misidentifies these legacy chips as MAX34451ETNA8+. That switches
PSC_VOLTAGE_OUT from 1 mV/LSB to 8 mV/LSB, reporting every voltage
rail 8x too high, and exposes unsupported VIN channels reading -8 mV.

Require rv < 0x0100 before applying the ETNA6+/ETNA8+ quirks. Tested
on that hardware: the voltage rails read 1x again and the bogus VIN
channels disappear.

Fixes: 19932f844f3f ("hwmon: (pmbus/max34440) Fix support for max34451")
Fixes: 596f410c05b1 ("hwmon: (pmbus/max34440): add support for newer version of max34451")
Signed-off-by: William A. Kennington III <william@wkennington.com>
---
 drivers/hwmon/pmbus/max34440.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/max34440.c b/drivers/hwmon/pmbus/max34440.c
index b59e9fd42401..390dc32f6f41 100644
--- a/drivers/hwmon/pmbus/max34440.c
+++ b/drivers/hwmon/pmbus/max34440.c
@@ -352,7 +352,14 @@ static int max34451_set_supported_funcs(struct i2c_client *client,
 	if (rv < 0)
 		return rv;
 
-	if (data->id == max34451 && rv >= MAX34451ETNA6_MFR_REV) {
+	/*
+	 * Legacy MAX34451 parts report MFR_REVISION (0x9b) as two ISO/IEC
+	 * 8859-1 characters (e.g. 0x3236), whereas MAX34451ETNA6+ / ETNA8+
+	 * use single-byte binary revisions 0x0012 / 0x0014. Require a zero
+	 * upper byte so legacy parts keep 1 mV/LSB scaling and do not
+	 * expose unsupported VIN/IIN channels.
+	 */
+	if (data->id == max34451 && rv >= MAX34451ETNA6_MFR_REV && rv < 0x0100) {
 		max34451_na6 = true;
 		data->info.format[PSC_VOLTAGE_IN] = direct;
 		data->info.format[PSC_CURRENT_IN] = direct;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hwmon: (pmbus/max34440): Do not treat ASCII MFR_REVISION as MAX34451ETNA6+
  2026-11-28  2:52 [PATCH] hwmon: (pmbus/max34440): Do not treat ASCII MFR_REVISION as MAX34451ETNA6+ William A. Kennington III
@ 2026-11-28  2:55 ` sashiko-bot
  2026-11-28 10:35 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-28  2:55 UTC (permalink / raw)
  To: William A. Kennington III; +Cc: linux-hwmon

> Per the MAX34451 datasheet, legacy MAX34451 parts return two ISO/IEC
> 8859-1 characters in MFR_REVISION (0x9b). On an NPCM730 BMC, both
> MAX34451 devices (MFR_ID 0x4d, MFR_MODEL 0x59) return 0x3236.
> 
> Comparing rv >= MAX34451ETNA6_MFR_REV (0x0012) and rv >=
> MAX34451ETNA8_MFR_REV (0x0014) without checking the upper byte
> misidentifies these legacy chips as MAX34451ETNA8+. That switches
> PSC_VOLTAGE_OUT from 1 mV/LSB to 8 mV/LSB, reporting every voltage
> rail 8x too high, and exposes unsupported VIN channels reading -8 mV.
> 
> Require rv < 0x0100 before applying the ETNA6+/ETNA8+ quirks. Tested
> on that hardware: the voltage rails read 1x again and the bogus VIN
> channels disappear.
> 
> Fixes: 19932f844f3f ("hwmon: (pmbus/max34440) Fix support for max34451")
> Fixes: 596f410c05b1 ("hwmon: (pmbus/max34440): add support for newer version of max34451")
> Signed-off-by: William A. Kennington III <william@wkennington.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261128025223.2680033-1-william@wkennington.com?part=1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hwmon: (pmbus/max34440): Do not treat ASCII MFR_REVISION as MAX34451ETNA6+
  2026-11-28  2:52 [PATCH] hwmon: (pmbus/max34440): Do not treat ASCII MFR_REVISION as MAX34451ETNA6+ William A. Kennington III
  2026-11-28  2:55 ` sashiko-bot
@ 2026-11-28 10:35 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2026-11-28 10:35 UTC (permalink / raw)
  To: William A. Kennington III
  Cc: Alexis Czezar Torreno, Uwe Kleine-König, Andrew Davis,
	Carlos Jones Jr, Kees Cook, linux-hwmon

On Sat, Nov 28, 2026 at 02:52:23AM +0000, William A. Kennington III wrote:
> Per the MAX34451 datasheet, legacy MAX34451 parts return two ISO/IEC
> 8859-1 characters in MFR_REVISION (0x9b). On an NPCM730 BMC, both
> MAX34451 devices (MFR_ID 0x4d, MFR_MODEL 0x59) return 0x3236.
> 
> Comparing rv >= MAX34451ETNA6_MFR_REV (0x0012) and rv >=
> MAX34451ETNA8_MFR_REV (0x0014) without checking the upper byte
> misidentifies these legacy chips as MAX34451ETNA8+. That switches
> PSC_VOLTAGE_OUT from 1 mV/LSB to 8 mV/LSB, reporting every voltage
> rail 8x too high, and exposes unsupported VIN channels reading -8 mV.
> 
> Require rv < 0x0100 before applying the ETNA6+/ETNA8+ quirks. Tested
> on that hardware: the voltage rails read 1x again and the bogus VIN
> channels disappear.
> 
> Fixes: 19932f844f3f ("hwmon: (pmbus/max34440) Fix support for max34451")
> Fixes: 596f410c05b1 ("hwmon: (pmbus/max34440): add support for newer version of max34451")
> Signed-off-by: William A. Kennington III <william@wkennington.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/pmbus/max34440.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/pmbus/max34440.c b/drivers/hwmon/pmbus/max34440.c
> index b59e9fd42401..390dc32f6f41 100644
> --- a/drivers/hwmon/pmbus/max34440.c
> +++ b/drivers/hwmon/pmbus/max34440.c
> @@ -352,7 +352,14 @@ static int max34451_set_supported_funcs(struct i2c_client *client,
>  	if (rv < 0)
>  		return rv;
>  
> -	if (data->id == max34451 && rv >= MAX34451ETNA6_MFR_REV) {
> +	/*
> +	 * Legacy MAX34451 parts report MFR_REVISION (0x9b) as two ISO/IEC
> +	 * 8859-1 characters (e.g. 0x3236), whereas MAX34451ETNA6+ / ETNA8+
> +	 * use single-byte binary revisions 0x0012 / 0x0014. Require a zero
> +	 * upper byte so legacy parts keep 1 mV/LSB scaling and do not
> +	 * expose unsupported VIN/IIN channels.
> +	 */
> +	if (data->id == max34451 && rv >= MAX34451ETNA6_MFR_REV && rv < 0x0100) {
>  		max34451_na6 = true;
>  		data->info.format[PSC_VOLTAGE_IN] = direct;
>  		data->info.format[PSC_CURRENT_IN] = direct;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-28 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28  2:52 [PATCH] hwmon: (pmbus/max34440): Do not treat ASCII MFR_REVISION as MAX34451ETNA6+ William A. Kennington III
2026-11-28  2:55 ` sashiko-bot
2026-11-28 10:35 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox