Re: [PATCH v5 2/3] hwmon: (pmbus/adm1266) add powerup_counter debugfs entry

From: Guenter Roeck

Date: Wed May 20 2026 - 23:22:18 EST


On Wed, May 20, 2026 at 03:42:41PM -0700, Abdurrahman Hussain wrote:
> The ADM1266 maintains a 16-bit non-volatile POWERUP_COUNTER register
> (0xE4, datasheet Rev. D, Table 93) that increments on every power
> cycle and cannot be reset by the host. Each blackbox record already
> embeds the counter at record time, so the standalone live value is
> primarily useful for matching a captured record back to the boot it
> came from when correlating logs.
>
> Expose it as a read-only debugfs file alongside sequencer_state. The
> block-read returns two payload bytes in little-endian order.
>
> Take pmbus_lock around the block-read so the access serialises with
> any pmbus_core sequence that sets PAGE on the device. Without it, a
> PAGE write from another thread could interleave between a PAGE set
> and a paged read elsewhere in the driver and corrupt either side's
> view of the device state machine.
>
> Signed-off-by: Abdurrahman Hussain <abdurrahman@xxxxxxxxxx>
> Assisted-by: Claude-Code:claude-opus-4-7
> Assisted-by: sashiko:gemini-3.1-pro-preview

Applied.

Thanks,
Guenter