[PATCH 0/7] hwmon: (pmbus/adm1266) RTC fix, blackbox, FW rev, rtc_class

Abdurrahman Hussain via B4 Relay posted 7 patches 1 month ago
drivers/hwmon/pmbus/adm1266.c | 177 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 167 insertions(+), 10 deletions(-)
[PATCH 0/7] hwmon: (pmbus/adm1266) RTC fix, blackbox, FW rev, rtc_class
Posted by Abdurrahman Hussain via B4 Relay 1 month ago
This series fixes a few issues in the adm1266 driver and fills in
some gaps, as listed below.

Patch 1 is a wall-clock RTC bug fix: the driver currently seeds the
device's timestamp counter with CLOCK_MONOTONIC seconds, which makes
blackbox record timestamps non-comparable across reboots. It carries
a Fixes: tag.

Patch 2 writes the 16-bit fractional-seconds field of SET_RTC that
the driver was zeroing, restoring sub-second resolution on records.

Patch 3 exposes the firmware revision (IC_DEVICE_REV, 0xAE) via
debugfs alongside the existing sequencer_state entry.

Patch 4 adds a write-only clear_blackbox debugfs file. Devices
configured for single-recording mode (BLACKBOX_CONFIG[0] = 0) need
an explicit clear once the 32-record buffer fills; the documented
sub-command ({0xFE, 0x00} block-write to 0xDE) wasn't reachable
from userspace.

Patch 5 exposes the non-volatile POWERUP_COUNTER (0xE4) via debugfs.
The same value is embedded in every blackbox record, so the live
value lets userspace match a captured record back to the boot it
came from when correlating logs.

Patch 6 registers an rtc_class device backed by SET_RTC. The data
sheet (Rev. D, p. 22) explicitly recommends "frequently send the
time stamp to the ADM1266 to synchronize the UNIX time and reduce
the time from drifting" when running on the internal oscillator
(no external 32.768 kHz crystal). With this patch userspace can
drive the re-sync via standard tooling (hwclock, chrony,
systemd-timesyncd) against /dev/rtcN, with no driver-specific
sysfs ABI.

Patch 7 disambiguates GPIO line labels on platforms that fit two
ADM1266 devices on different I2C buses at the same slave address.

Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
Abdurrahman Hussain (7):
      hwmon: (pmbus/adm1266) use wall-clock seconds for SET_RTC
      hwmon: (pmbus/adm1266) write fractional-seconds field of SET_RTC
      hwmon: (pmbus/adm1266) add firmware_revision debugfs entry
      hwmon: (pmbus/adm1266) add clear_blackbox debugfs entry
      hwmon: (pmbus/adm1266) add powerup_counter debugfs entry
      hwmon: (pmbus/adm1266) register rtc_class device backed by SET_RTC
      hwmon: (pmbus/adm1266) include adapter number in GPIO line label

 drivers/hwmon/pmbus/adm1266.c | 177 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 167 insertions(+), 10 deletions(-)
---
base-commit: 917719c412c48687d4a176965d1fa35320ec457c
change-id: 20260507-adm1266-cf3af42dc3d2

Best regards,
--  
Abdurrahman Hussain <abdurrahman@nexthop.ai>
Re: [PATCH 0/7] hwmon: (pmbus/adm1266) RTC fix, blackbox, FW rev, rtc_class
Posted by Guenter Roeck 1 month ago
On 5/8/26 16:33, Abdurrahman Hussain via B4 Relay wrote:
> This series fixes a few issues in the adm1266 driver and fills in
> some gaps, as listed below.
> 
> Patch 1 is a wall-clock RTC bug fix: the driver currently seeds the
> device's timestamp counter with CLOCK_MONOTONIC seconds, which makes
> blackbox record timestamps non-comparable across reboots. It carries
> a Fixes: tag.
> 
> Patch 2 writes the 16-bit fractional-seconds field of SET_RTC that
> the driver was zeroing, restoring sub-second resolution on records.
> 
> Patch 3 exposes the firmware revision (IC_DEVICE_REV, 0xAE) via
> debugfs alongside the existing sequencer_state entry.
> 
> Patch 4 adds a write-only clear_blackbox debugfs file. Devices
> configured for single-recording mode (BLACKBOX_CONFIG[0] = 0) need
> an explicit clear once the 32-record buffer fills; the documented
> sub-command ({0xFE, 0x00} block-write to 0xDE) wasn't reachable
> from userspace.
> 
> Patch 5 exposes the non-volatile POWERUP_COUNTER (0xE4) via debugfs.
> The same value is embedded in every blackbox record, so the live
> value lets userspace match a captured record back to the boot it
> came from when correlating logs.
> 
> Patch 6 registers an rtc_class device backed by SET_RTC. The data
> sheet (Rev. D, p. 22) explicitly recommends "frequently send the
> time stamp to the ADM1266 to synchronize the UNIX time and reduce
> the time from drifting" when running on the internal oscillator
> (no external 32.768 kHz crystal). With this patch userspace can
> drive the re-sync via standard tooling (hwclock, chrony,
> systemd-timesyncd) against /dev/rtcN, with no driver-specific
> sysfs ABI.
> 
> Patch 7 disambiguates GPIO line labels on platforms that fit two
> ADM1266 devices on different I2C buses at the same slave address.
> 
> Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>

Please address Sashiko's feedback.

Thanks,
Guenter
Re: [PATCH 0/7] hwmon: (pmbus/adm1266) RTC fix, blackbox, FW rev, rtc_class
Posted by Abdurrahman Hussain 1 month ago
Hi Guenter,

I didn't see any feedback. Checked my spam folder and nothing
shows up on the mailing list either.

Regards,
Abdurrahman


On Sat, May 9, 2026 at 7:14 AM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 5/8/26 16:33, Abdurrahman Hussain via B4 Relay wrote:
> > This series fixes a few issues in the adm1266 driver and fills in
> > some gaps, as listed below.
> >
> > Patch 1 is a wall-clock RTC bug fix: the driver currently seeds the
> > device's timestamp counter with CLOCK_MONOTONIC seconds, which makes
> > blackbox record timestamps non-comparable across reboots. It carries
> > a Fixes: tag.
> >
> > Patch 2 writes the 16-bit fractional-seconds field of SET_RTC that
> > the driver was zeroing, restoring sub-second resolution on records.
> >
> > Patch 3 exposes the firmware revision (IC_DEVICE_REV, 0xAE) via
> > debugfs alongside the existing sequencer_state entry.
> >
> > Patch 4 adds a write-only clear_blackbox debugfs file. Devices
> > configured for single-recording mode (BLACKBOX_CONFIG[0] = 0) need
> > an explicit clear once the 32-record buffer fills; the documented
> > sub-command ({0xFE, 0x00} block-write to 0xDE) wasn't reachable
> > from userspace.
> >
> > Patch 5 exposes the non-volatile POWERUP_COUNTER (0xE4) via debugfs.
> > The same value is embedded in every blackbox record, so the live
> > value lets userspace match a captured record back to the boot it
> > came from when correlating logs.
> >
> > Patch 6 registers an rtc_class device backed by SET_RTC. The data
> > sheet (Rev. D, p. 22) explicitly recommends "frequently send the
> > time stamp to the ADM1266 to synchronize the UNIX time and reduce
> > the time from drifting" when running on the internal oscillator
> > (no external 32.768 kHz crystal). With this patch userspace can
> > drive the re-sync via standard tooling (hwclock, chrony,
> > systemd-timesyncd) against /dev/rtcN, with no driver-specific
> > sysfs ABI.
> >
> > Patch 7 disambiguates GPIO line labels on platforms that fit two
> > ADM1266 devices on different I2C buses at the same slave address.
> >
> > Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
>
> Please address Sashiko's feedback.
>
> Thanks,
> Guenter
>
Re: [PATCH 0/7] hwmon: (pmbus/adm1266) RTC fix, blackbox, FW rev, rtc_class
Posted by Guenter Roeck 1 month ago
On 5/9/26 14:58, Abdurrahman Hussain wrote:
> Hi Guenter,
> 
> I didn't see any feedback. Checked my spam folder and nothing
> shows up on the mailing list either.
> 

Your return address is apparently

Abdurrahman Hussain via B4 Relay <devnull+abdurrahman.nexthop.ai@kernel.org>

which I guess ends up in /dev/null. I don't know why the e-mail to the
mailing list gets filtered out.

Here is the feedback:

https://sashiko.dev/#/patchset/20260508-adm1266-v1-0-ec08bf29e0ce%40nexthop.ai

Guenter

> Regards,
> Abdurrahman
> 
> 
> On Sat, May 9, 2026 at 7:14 AM Guenter Roeck <linux@roeck-us.net> wrote:
>>
>> On 5/8/26 16:33, Abdurrahman Hussain via B4 Relay wrote:
>>> This series fixes a few issues in the adm1266 driver and fills in
>>> some gaps, as listed below.
>>>
>>> Patch 1 is a wall-clock RTC bug fix: the driver currently seeds the
>>> device's timestamp counter with CLOCK_MONOTONIC seconds, which makes
>>> blackbox record timestamps non-comparable across reboots. It carries
>>> a Fixes: tag.
>>>
>>> Patch 2 writes the 16-bit fractional-seconds field of SET_RTC that
>>> the driver was zeroing, restoring sub-second resolution on records.
>>>
>>> Patch 3 exposes the firmware revision (IC_DEVICE_REV, 0xAE) via
>>> debugfs alongside the existing sequencer_state entry.
>>>
>>> Patch 4 adds a write-only clear_blackbox debugfs file. Devices
>>> configured for single-recording mode (BLACKBOX_CONFIG[0] = 0) need
>>> an explicit clear once the 32-record buffer fills; the documented
>>> sub-command ({0xFE, 0x00} block-write to 0xDE) wasn't reachable
>>> from userspace.
>>>
>>> Patch 5 exposes the non-volatile POWERUP_COUNTER (0xE4) via debugfs.
>>> The same value is embedded in every blackbox record, so the live
>>> value lets userspace match a captured record back to the boot it
>>> came from when correlating logs.
>>>
>>> Patch 6 registers an rtc_class device backed by SET_RTC. The data
>>> sheet (Rev. D, p. 22) explicitly recommends "frequently send the
>>> time stamp to the ADM1266 to synchronize the UNIX time and reduce
>>> the time from drifting" when running on the internal oscillator
>>> (no external 32.768 kHz crystal). With this patch userspace can
>>> drive the re-sync via standard tooling (hwclock, chrony,
>>> systemd-timesyncd) against /dev/rtcN, with no driver-specific
>>> sysfs ABI.
>>>
>>> Patch 7 disambiguates GPIO line labels on platforms that fit two
>>> ADM1266 devices on different I2C buses at the same slave address.
>>>
>>> Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
>>
>> Please address Sashiko's feedback.
>>
>> Thanks,
>> Guenter
>>

Re: [PATCH 0/7] hwmon: (pmbus/adm1266) RTC fix, blackbox, FW rev, rtc_class
Posted by Abdurrahman Hussain 1 month ago
Hi Guenter,

Thank you for the link.

I am not sure why the replies are being filtered;
it may be related to using the b4 relay web endpoint.

I will address the comments on Sashiko and submit v2 shortly.
I'll send the next version directly to avoid further delivery issues.

Best regards,
Abdurrahman Hussain