Skip to content

hwmon: (pmbus/max34440): block unsupported registers that triggers ALERT on initialization, support max34451etna8+, and support max34452 - #3417

Open
actorreno wants to merge 3 commits into
mainfrom
fix/max34451_init_alerts
Open

hwmon: (pmbus/max34440): block unsupported registers that triggers ALERT on initialization, support max34451etna8+, and support max34452#3417
actorreno wants to merge 3 commits into
mainfrom
fix/max34451_init_alerts

Conversation

@actorreno

@actorreno actorreno commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Commit 1:
MAX34451 and ADPM chips do not support standard PMBus VIN/IIN limit registers, manufacturer specific min/max registers, or undercurrent or undertemperature fault limits. STATUS_BYTE and STATUS_OTHER are also not available. Accessing these non-existent registers during driver initialization triggers a CML error and asserts ALERT. Handled by
blocking these functions during read/write.

Commit 2:
MAX34451 added a new version etna8+. This adjusted the coefficients for direct format

Commit 3:
Carlos created patch to support MAX34452, to avoid possible conflict upstream, submitting his work together in this series
MAX34452 PMBus 16-Channel V/I Monitor and 12-Channel Sequencer/Marginer. The device is similar to MAX34451
and shares the same configuration function.

PR Description

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

@actorreno
actorreno marked this pull request as ready for review July 6, 2026 06:54

@nunojsa nunojsa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment from me. Please send the patch... Also looks like a Fixes tag is sensible

*/
if (data->id == max34451 || data->id == adpm12160 ||
data->id == adpm12200 || data->id == adpm12250)
return -ENXIO;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not EOPNOTSUPP?

@actorreno actorreno Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just what claude suggested, it means No Such Device or Address so I agreed on the address part.
Now that I think about it, is this address the device itself and not the register addresses within?

But since the driver already uses ENXIO in other parts that also blocks functions, I think this is still ok for consistency.

@gastmaier
gastmaier force-pushed the mirror_ci/groeck/linux-staging/hwmon-next branch 2 times, most recently from b9080e0 to edb01f8 Compare July 8, 2026 00:02
@actorreno
actorreno force-pushed the fix/max34451_init_alerts branch 3 times, most recently from b99b81f to 9181623 Compare July 8, 2026 04:09
@actorreno

actorreno commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

v2:

The request was totally removing CML alert triggering, so I had to edit and find all pmbus initialization register access and block all non supported. Aside from the limit registers of VIN/IIN/IOUT/VOUT/TEMP, I also had to block STATUS_BYTE and STATUS_OTHER

@actorreno
actorreno requested a review from nunojsa July 8, 2026 04:33
@actorreno actorreno changed the title hwmon: (pmbus/max34440): block unsupported VIN and IIN limit registers hwmon: (pmbus/max34440): block unsupported registers that triggers ALERT on initialization Jul 8, 2026
@gastmaier
gastmaier force-pushed the mirror_ci/groeck/linux-staging/hwmon-next branch from edb01f8 to 2aac463 Compare July 10, 2026 00:07
@actorreno
actorreno force-pushed the fix/max34451_init_alerts branch from 1c5f7cc to 5913aa9 Compare July 10, 2026 08:35
@actorreno actorreno changed the title hwmon: (pmbus/max34440): block unsupported registers that triggers ALERT on initialization hwmon: (pmbus/max34440): block unsupported registers that triggers ALERT on initialization, support max34451etna8+, and support max34452 Jul 10, 2026
@actorreno

Copy link
Copy Markdown
Contributor Author

added fixes tag to commit 1

added more patches on this series
commit 2: add support to max34451etna8+
commit 3: adds carlos' code regarding support for max34452

@gastmaier
gastmaier force-pushed the mirror_ci/groeck/linux-staging/hwmon-next branch 3 times, most recently from 168c8e2 to 4e21503 Compare July 13, 2026 00:09
@actorreno
actorreno force-pushed the fix/max34451_init_alerts branch 2 times, most recently from 424e22f to 49faee3 Compare July 13, 2026 03:00
@gastmaier
gastmaier force-pushed the mirror_ci/groeck/linux-staging/hwmon-next branch from 4e21503 to 97e15ef Compare July 14, 2026 00:02

@nunojsa nunojsa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure what to think about the 4 fixes tag. I guess they make sense... But the tested tag does make much sense if not from someone else!

Also for the latest one , are you just carrying code from Carlos or did you changed some stuff? If you changed, a Co-developed tag would make sense.

Comment thread drivers/hwmon/pmbus/max34440.c Outdated
break;
default:
ret = -ENODATA;
break;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just return directly

Comment thread drivers/hwmon/pmbus/max34440.c Outdated
data->id == adpm12200 || data->id == adpm12250)
return -ENXIO;
ret = -ENODATA;
break;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment thread drivers/hwmon/pmbus/max34440.c Outdated
break;
default:
ret = -ENODATA;
break;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments. On top, you can also drop ret

@actorreno

Copy link
Copy Markdown
Contributor Author

noted on the return and stuff

i suppose i did edit carlos' code since he made it before I added these changes. Will add the codevelop tag

@gastmaier
gastmaier force-pushed the mirror_ci/groeck/linux-staging/hwmon-next branch 2 times, most recently from 721dbd5 to 4010bbc Compare July 16, 2026 00:00
@actorreno
actorreno force-pushed the fix/max34451_init_alerts branch 2 times, most recently from 92c3391 to 64140c2 Compare July 16, 2026 07:17
@gastmaier
gastmaier force-pushed the mirror_ci/groeck/linux-staging/hwmon-next branch 4 times, most recently from d21303e to f74258c Compare July 20, 2026 02:10
@gastmaier
gastmaier force-pushed the mirror_ci/groeck/linux-staging/hwmon-next branch 2 times, most recently from 8411d1b to a17a53a Compare July 22, 2026 00:00
@actorreno
actorreno force-pushed the fix/max34451_init_alerts branch from 64140c2 to 120dc2a Compare July 24, 2026 00:57
@actorreno
actorreno changed the base branch from mirror_ci/groeck/linux-staging/hwmon-next to main July 24, 2026 00:58
MAX34451 and ADPM chips do not support standard PMBus VIN/IIN limit
registers, manufacturer specific min/max registers, or undercurrent
or undertemperature fault limits. STATUS_BYTE and STATUS_OTHER are also
not available. Accessing these non-existent registers during driver
initialization triggers a CML error and asserts ALERT. Handled by
blocking these functions during read/write.

Fixes: 7a001db ("hwmon: (pmbus/max34440) Add support for MAX34451.")
Fixes: 629cf8f ("hwmon: (pmbus/max34440) Add support for ADPM12160")
Fixes: 2e0b52f ("hwmon: (pmbus/max34440): add support adpm12200")
Fixes: 479bfeb ("hwmon: (pmbus/max34440): add support adpm12250")
Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Link: https://lore.kernel.org/r/20260716-max34451_fixes-v1-1-a941b27eaecb@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
The MAX34451 released a newer version called max34451etna8+.
This simply changes the direct format coefficients

Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Link: https://lore.kernel.org/r/20260722-max34451_fixes-v2-2-bbddb18ec1d6@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
@actorreno
actorreno force-pushed the fix/max34451_init_alerts branch from 120dc2a to d1de48f Compare July 24, 2026 00:59
@actorreno

Copy link
Copy Markdown
Contributor Author

Upstream applied
cherry-picked commits here and now PRed changed to main branch.

Add support for Maxim MAX34452 PMBus 16-Channel V/I Monitor and
12-Channel Sequencer/Marginer. The device is similar to MAX34451
and shares the same configuration function.

The MAX34452 supports:
- 16 configurable voltage/current monitoring channels
- 5 temperature sensors (pages 16-20)
- Dynamic channel configuration via MFR_CHANNEL_CONFIG
- IOUT average monitoring

Signed-off-by: Carlos Jones Jr <carlosjr.jones@analog.com>
Co-Developed by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Link: https://lore.kernel.org/r/20260722-max34451_fixes-v2-3-bbddb18ec1d6@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
@actorreno
actorreno force-pushed the fix/max34451_init_alerts branch from d1de48f to fbfdbda Compare July 24, 2026 01:05
@actorreno
actorreno requested a review from nunojsa July 24, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants