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 DAD6123D2A4; Sat, 30 May 2026 18:51:27 +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=1780167088; cv=none; b=Flak8kyvXFQJIaEu9ALPDYFDa236jo03fyeEhRq8JtFiP+tKnuv2uq6e3TD8b34ZmUFI4er2Xie5IwGfajJbb/pRQYU3RJKJ27hnmXyj6y29Mf2QjUkefg8pZtxPmTR8El9ZvjPObpaYD4ogEj5uPPKsOHivdOueAOTBLL03wcw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780167088; c=relaxed/simple; bh=llfMsjCA9AeIL6c6tpUdYKVFOeKis2hgxZ74Bm3nRuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rv02+fr+/Jwq7M634R9S5/U180vTVpt4ms27y2AN+tO+/SBfsdgIhRIbrKq1IFz+14yAHNJT3vAygUjcKDpNYbDpt/ANX7Iydf/3VkTxVjStKQjbMwJQYM/8P+jdk8ug2+w0UBpMhmHKVpHrjEopg2POTC9ivp1FpgKrfZstze0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bJ3a7TLW; 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="bJ3a7TLW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C3741F00893; Sat, 30 May 2026 18:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780167087; bh=OSjIRDK00E0hZbn3QqEfP/Cj2tdynkdSzj9Yk+OnhYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bJ3a7TLWmnOuXOVsyu68qlI3yD6uUoCEpqMkOv7iKxZx8/jG2NuWiMiThYUb/WLKY eQOciRQlVSCCKirRtdYo5AI634yaN1ynedOf6kCgO+28AxKzQmxxEzmU6/CZ/gcQo9 RBVYL4PcAE5WhDkQyNpKwTXulDsnmV79NvPosi34= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abdurrahman Hussain , Guenter Roeck Subject: [PATCH 5.10 560/589] hwmon: (pmbus/adm1266) seed timestamp from the real-time clock Date: Sat, 30 May 2026 18:07:21 +0200 Message-ID: <20260530160239.366476910@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160224.570625122@linuxfoundation.org> References: <20260530160224.570625122@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 5.10-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 @@ -434,7 +434,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));