Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] hwmon: (pmbus) Add PMBUS_FORCE_PAGE_CHANGE flag
@ 2026-11-22 17:09 Felix Radensky
  2026-11-22 17:09 ` [PATCH v2 1/3] hwmon: (pmbus/core) Keep cached page and phase in sync with the chip Felix Radensky
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Felix Radensky @ 2026-11-22 17:09 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Vadim Pasternak, Felix Radensky, linux-hwmon, linux-doc

As discussed in [1], this series adds the PMBUS_FORCE_PAGE_CHANGE device
flag, which makes pmbus_set_page() change the page of a chip with a
single page as well, and converts mp2975 to it. The mp2975 driver then
accesses the page 3 voltage reference with pmbus_set_page() also in a
single rail configuration, instead of writing PAGE directly.

Patch 1 keeps the page and phase cached by pmbus_set_page() in sync
with the chip. It invalidates them when changing them fails, so that the
next access sends PAGE and PHASE again, and updates them only when the
respective command is sent. Without it, a PAGE or PHASE write accepted
by the chip, but reported as failed, or a failed or mismatched PAGE
read-back, leaves the chip on a value other than the cached one, and an
access to a page without phases updates the cached phase without
sending PHASE. This already applies to chips with multiple pages or
phases, and would apply to chips using the new flag as well.

Patch 3 depends on commit 00944852275e ("hwmon: (pmbus/mp2975) Get vout
fault limits dynamically"), which is in v7.4-rc3, but not in hwmon-next
yet. The series is based on v7.4-rc3, and applies to hwmon-next with
that commit on top.

Tested on a switch platform carrying twelve MP2975 devices, twenty one
rails in total. On a single rail device, the change to page 3 is now
issued by the core and read back, while reading a sensor of the rail
issues no PAGE command. 400 page 3 excursions on a single rail device,
and 800 on a dual rail device, each followed by a read of the other
rail, showed no page 3 or other rail register value in place of a sensor
value. The limits of all rails matched those reported before the series,
and in2_crit of the rail supplying the CPU core voltage followed the CPU
between 1145mV and 1725mV. On this platform, patch 1 changes the bus
traffic only after a failed transfer, which was not exercised.

Changes in v2:
- Patch 1: update the cached page and phase only once the PAGE or PHASE
  command succeeded, not also when no command is sent, that is for a
  virtual page, and for a page without phases or with virtual phases
  (Sashiko)

v1: https://lore.kernel.org/linux-hwmon/20261122073322.1712843-1-fradensky@nvidia.com/

[1] https://lore.kernel.org/linux-hwmon/8e4410db-66df-44b8-9617-1013545d7b43@roeck-us.net/

Felix Radensky (3):
  hwmon: (pmbus/core) Keep cached page and phase in sync with the chip
  hwmon: (pmbus/core) Add PMBUS_FORCE_PAGE_CHANGE flag
  hwmon: (pmbus/mp2975) Use PMBUS_FORCE_PAGE_CHANGE

 Documentation/hwmon/pmbus-core.rst | 12 +++++++++++-
 drivers/hwmon/pmbus/mp2975.c       | 29 +++++++++--------------------
 drivers/hwmon/pmbus/pmbus_core.c   | 15 ++++++++++++---
 include/linux/pmbus.h              | 11 +++++++++++
 4 files changed, 43 insertions(+), 24 deletions(-)


base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
-- 
2.34.1


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

end of thread, other threads:[~2026-11-22 17:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 17:09 [PATCH v2 0/3] hwmon: (pmbus) Add PMBUS_FORCE_PAGE_CHANGE flag Felix Radensky
2026-11-22 17:09 ` [PATCH v2 1/3] hwmon: (pmbus/core) Keep cached page and phase in sync with the chip Felix Radensky
2026-11-22 17:09 ` [PATCH v2 2/3] hwmon: (pmbus/core) Add PMBUS_FORCE_PAGE_CHANGE flag Felix Radensky
2026-11-22 17:09 ` [PATCH v2 3/3] hwmon: (pmbus/mp2975) Use PMBUS_FORCE_PAGE_CHANGE Felix Radensky
2026-11-22 17:16 ` [PATCH v2 0/3] hwmon: (pmbus) Add PMBUS_FORCE_PAGE_CHANGE flag sashiko-bot

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