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

From: Guenter Roeck

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


On Wed, May 20, 2026 at 03:42:40PM -0700, Abdurrahman Hussain wrote:
> The ADM1266 blackbox can be configured in two recording modes via
> BLACKBOX_CONFIG[0]: cyclic, where the device overwrites the oldest
> record once the 32-record buffer fills, and single, where it stops
> recording until the buffer is cleared. Deployments that need to
> preserve the full record history across multiple fault episodes
> typically run in single mode and need a way to clear the buffer
> after the records have been collected.
>
> Expose a write-only debugfs file alongside sequencer_state. Writing
> any data to it issues the documented clear-blackbox sub-command:
> a 2-byte block-write to READ_BLACKBOX (0xDE) with payload
> {0xFE, 0x00} (datasheet Rev. D).
>
> The clear is taken under pmbus_lock because READ_BLACKBOX is also
> used by adm1266_nvmem_read_blackbox() to walk records one at a
> time; both paths run under pmbus_lock so the clear cannot
> interleave mid-iteration and corrupt the read sequence.
>
> 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