Skip to content

hwmon: (pmbus) PMBus fixes and improvements

Guenter Roeck linux-hwmon lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5hwmon: (pmbus) Mark lowest/average/highest/rated attributes as read-onlydrivers/hwmon/pmbus/pmbus_core.c+42 -60 replies
2/5hwmon: (pmbus) Introduce the concept of "write-only" attributesdrivers/hwmon/pmbus/pmbus_core.c+24 -80 replies
3/5hwmon: (pmbus/core) Protect regulator operations with mutexdrivers/hwmon/pmbus/pmbus_core.c+89 -252 replies
4/5hwmon: (pmbus) Add support for guarded PMBus lockdrivers/hwmon/pmbus/pmbus.h drivers/hwmon/pmbus/pmbus_core.c+13 -00 replies
5/5hwmon: (pmbus_core) Use guard() for mutex protectiondrivers/hwmon/pmbus/pmbus_core.c+108 -1710 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSanman Pradhan
SeriesR-b
1/5
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] hwmon: (pmbus) PMBus fixes and improvements

The first patch of the series marks lowest/average/highest/rated attributes as read-only. Those are values provided by the chip and must not be modified during runtime (if that is even supported by the chip).

The second patch adds support for write-only attributes. As it turned out, reading the "reset_history" attributes returned random values. The code now returns 0 when reading those attributes to avoid ABI hiccups.

The third patch adds locking for regulator operations to avoid interference with other PMBus operations.

The last two patches introduce and start using guard() and scoped_guard() for PMBus locking to simplify the code, especially for error handling.

Change log since RFT/RFC: All patches were tested with real hardware.

----------------------------------------------------------------
Guenter Roeck (5):
hwmon: (pmbus) Mark lowest/average/highest/rated attributes as read-only
hwmon: (pmbus) Introduce the concept of "write-only" attributes
hwmon: (pmbus/core) Protect regulator operations with mutex
hwmon: (pmbus) Add support for guarded PMBus lock
hwmon: (pmbus_core) Use guard() for mutex protection

 drivers/hwmon/pmbus/pmbus.h      |   5 +
 drivers/hwmon/pmbus/pmbus_core.c | 373 +++++++++++++++++++++++----------------
 2 files changed, 222 insertions(+), 156 deletions(-)