From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C2B13016E1; Thu, 28 May 2026 20:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000793; cv=none; b=mD+h6brmemjTpCf67MsjW/GWXSlTawTyW7n/+kgjQN5Y/zAF7X2Vt69+IFoyocpgr+MA1WR6OTtHtobz/Ppm9Q5epvciKDHvnLB6A0JrmY8Byr79ksCiJWg8/qbWRSUsQaJvPyyHJcX3OLpQTV1FTxye0WKmmWtZBVTxGSiFcyU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000793; c=relaxed/simple; bh=ZQGv5ncwIeRBW8fFb1acx57r7HM/1o1w2Zu+YQdEcM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J7olXVmRZDF+lcH+tRhT4fQ3iDP31Lek5BoVSrR45z590gSlcl/lnuHuRmBUVg7WKB0Tm/IIzsbqC5tuFZs4DcUcrKeYxJq0IgDX1IQHTmvpYZm5f/vAn+sdS7vUje73zyKq3jwm00LWTZ5rr6e41AjKc8dQMytEit/KTF3TJeo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TLhuTfqx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TLhuTfqx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CD8D1F000E9; Thu, 28 May 2026 20:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780000792; bh=MYNKj3UEDV+289DDNWt2KRNj7qh61NvPCC7SnB5Bqi0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TLhuTfqxoktwi7DC4IIkqD7ryYuaPuWpNtcdy86N5xwUcg9Ra4r9r1WS09V8HrM9S 2JJx4zHV2LCIxxPTdjDlsuHz6BGaoGDLVQKnT+omcV+wOqqWqSrGaZoIOeP0EOvISI TV2zpAcy58rOYqYCRVPEw+tbj6E+L9HBOUKgBEss= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abdurrahman Hussain , Guenter Roeck Subject: [PATCH 6.12 133/272] hwmon: (pmbus/adm1266) seed timestamp from the real-time clock Date: Thu, 28 May 2026 21:48:27 +0200 Message-ID: <20260528194633.102598020@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194629.379955525@linuxfoundation.org> References: <20260528194629.379955525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Abdurrahman Hussain commit b86095e3d7dcf2bf80c747349a35912a87a85098 upstream. adm1266_set_rtc() seeds the chip's SET_RTC register from ktime_get_seconds(), which returns CLOCK_MONOTONIC -- i.e. seconds since the host last booted, not seconds since the Unix epoch. The chip stamps that value into every blackbox record it captures. Userspace reading those timestamps back expects wall-clock seconds: that's what the SET_RTC frame layout documents (datasheet Rev. D, Table 84) and what every other consumer of "seconds since epoch" assumes. Seeding from CLOCK_MONOTONIC gives blackbox records a timestamp that is only meaningful within a single boot of the host and silently resets to small values on every reboot. Switch to ktime_get_real_seconds() so the seed matches what the register is documented to hold. Fixes: 15609d189302 ("hwmon: (pmbus/adm1266) read blackbox") Cc: stable@vger.kernel.org Signed-off-by: Abdurrahman Hussain Link: https://lore.kernel.org/r/20260515-adm1266-fixes-v1-1-1c1ea1349cfe@nexthop.ai Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/pmbus/adm1266.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/hwmon/pmbus/adm1266.c +++ b/drivers/hwmon/pmbus/adm1266.c @@ -432,7 +432,7 @@ static int adm1266_set_rtc(struct adm126 char write_buf[6]; int i; - kt = ktime_get_seconds(); + kt = ktime_get_real_seconds(); memset(write_buf, 0, sizeof(write_buf));