Re: [PATCH v4 0/3] hwmon: (pmbus/max31785) refactor inter-access delay handling
From: Guenter Roeck
Date: Fri Mar 20 2026 - 09:58:03 EST
On 3/19/26 16:50, Pradhan, Sanman wrote:
From: Sanman Pradhan <psanman@xxxxxxxxxxx>
This v4 series addresses the review feedback regarding 32-bit atomicity
of the inter-access delay timestamp and resolves the email address mismatch
identified in the v3 submission.
To prevent torn reads/writes of the 64-bit next_access_backoff timestamp
on 32-bit architectures, this series now includes a prerequisite patch
adding a spinlock in struct pmbus_data to protect accesses to that field.
Here is the AI feedback, which essentially confirms
that the spinlock is insufficient.
https://sashiko.dev/#/patchset/20260319234945.151487-1-sanman.pradhan%40hpe.com
Also, the error check for i2c_transfer() is incomplete.
Thanks,
Guenter
Changes in v4:
- Introduced a new patch (1/3) to protect 64-bit next_access_backoff
accesses with a spinlock, avoiding torn reads/writes on 32-bit
systems.
- Updated the export patch (2/3) so pmbus_wait() and pmbus_update_ts()
use that protection when accessing next_access_backoff.
- Standardized all commits and signatures on psanman@xxxxxxxxxxx to
resolve the From/SOB mismatch.
Changes in v3:
- Dropped the u16 -> u8 wrapper type fix (already applied upstream).
- Fixed a comment style nit in max31785_read_long_data().
- Added an explicit max31785_wait() before pmbus_do_probe() to ensure
proper timing spacing during the handover to the PMBus core.
Changes in v2:
- Export pmbus_wait() and pmbus_update_ts() from the core.
- Use core timing helpers in max31785 to replace local usleep_range()
boilerplate and private timing state.
Sanman Pradhan (3):
hwmon: (pmbus) add spinlock to protect 64-bit timestamp
hwmon: (pmbus) export pmbus_wait and pmbus_update_ts
hwmon: (pmbus/max31785) use access_delay for PMBus-mediated accesses
drivers/hwmon/pmbus/max31785.c | 191 ++++++++++---------------------
drivers/hwmon/pmbus/pmbus.h | 9 ++
drivers/hwmon/pmbus/pmbus_core.c | 29 +++--
3 files changed, 87 insertions(+), 142 deletions(-)