[PATCH 1/7] hwmon: (pmbus/adm1266) use wall-clock seconds for SET_RTC
From: Abdurrahman Hussain via B4 Relay
Date: Fri May 08 2026 - 19:33:35 EST
From: Abdurrahman Hussain <abdurrahman@xxxxxxxxxx>
The ADM1266 RTC seeds the timestamp embedded in every blackbox record.
The driver currently sets it from ktime_get_seconds(), which returns
CLOCK_MONOTONIC seconds (i.e. seconds since boot). The intent of the
register, per the data sheet (Rev. D, "Setting UNIX Time Using
SET_RTC"), is the elapsed time since 1970-01-01 UTC.
As a result, blackbox records are stamped with "seconds since this
boot," making cross-reboot correlation against host syslog impossible
and making the timestamps in two records taken on different boots
non-comparable.
Switch to ktime_get_real_seconds() so the device is seeded with
wall-clock time, as the data sheet specifies. The internal RTC will
drift from this seed (the data sheet recommends periodic re-sync from
the host); a follow-up patch exposes the device via rtc_class so
standard userspace time-sync tooling can keep it aligned.
Fixes: 15609d189302 ("hwmon: (pmbus/adm1266) read blackbox")
Signed-off-by: Abdurrahman Hussain <abdurrahman@xxxxxxxxxx>
---
drivers/hwmon/pmbus/adm1266.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/pmbus/adm1266.c b/drivers/hwmon/pmbus/adm1266.c
index d90f8f80be8e..a86666c73a5e 100644
--- a/drivers/hwmon/pmbus/adm1266.c
+++ b/drivers/hwmon/pmbus/adm1266.c
@@ -432,7 +432,7 @@ static int adm1266_set_rtc(struct adm1266_data *data)
char write_buf[6];
int i;
- kt = ktime_get_seconds();
+ kt = ktime_get_real_seconds();
memset(write_buf, 0, sizeof(write_buf));
--
2.53.0