From nobody Fri Dec 19 20:51:21 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 8F1931EA73 for ; Sat, 3 Aug 2024 15:07:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722697674; cv=none; b=cZxn7yQe+CuG5Q7de2azlVI+y6s55AEIjtU/6ayb4Sn/hI7b81l9/75VbK1ojQdwqnVyIlzt8UvFCKgb2TpVcADvXo2ruTsjpqN4CHeUvdzbj+nC/a/CZuJEIOLlVUKSr6j0C6iZ59MbzuBR47erRmrxyYIKoNx9cqciSCiYn8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722697674; c=relaxed/simple; bh=j6eUT3vMa7INHhKN2Rt62eI7QdM0uoo+HWJd5AY2QLM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=hf6lpepP7wm5qVBNIvrrR+G7oAshdKa1m3o+mUsXNn/GYU7b+mGj7mO6WCf0+9r2x5aAQcsUnNiJ5Oj//+M7twZlT0onK4LnYo2ba6tI9ekWK7GQ6eKrrYv09H8xSxPim9TLRHv7p4dhjrEI4EDNq8haPwMff6K5bEvfmS27kMI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gdhT7jzG; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QG8fPnl2; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gdhT7jzG"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QG8fPnl2" From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1722697672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=RXzw64cuXijvTqTTPhYLyITFgDzXlMYaOHmo2Dq7DeU=; b=gdhT7jzGyks9Zbn+F6/G9rnHCj7EbOvKjWe9wr3P31F/HOL5DgUg5DdNjwmgWx7FBhy3KC MNU+rTAvpikcCBNW2R//DP69cLzFmhRpalkzdKZxYZVtPKcvoOD/UXAiNGSj5Z7nE+kbYm 4/P+kfF1cRCSWiR+8fCdcTo18s8BHNEMAUMoR+2sPh1yJddbiSxzEKxXmxlJofiCpTfkIf deWYaYzGQwc2ssTXa/XSP/CUBEyHLUhV7RyLVWTdVOz8TZtT0A85yuaoNduA22fbHmvuz4 R/VplZzCkaGQgk1ldnGsapbdJKRT8lmcGMZvDikU1vHWymGzhNczyBiVr5icJw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1722697672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=RXzw64cuXijvTqTTPhYLyITFgDzXlMYaOHmo2Dq7DeU=; b=QG8fPnl2S7Cw8p4Nx3CrKyWO3czFYKW1sKxd2V3al70HtFfksZ90zboJxMfmqV3tKjz3Vd YZrENvYGwSkscLAg== To: LKML Cc: John Stultz , Stephen Boyd , Anna-Maria Behnsen , Frederic Weisbecker Subject: [PATCH] timekeeping: Fix bogus clock_was_set() invocation in do_adjtimex() Date: Sat, 03 Aug 2024 17:07:51 +0200 Message-ID: <877ccx7igo.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The addition of the bases argument to clock_was_set() fixed up all call sites correctly except for do_adjtimex(). This uses CLOCK_REALTIME instead of CLOCK_SET_WALL as argument. CLOCK_REALTIME is 0. As a result the effect of that clock_was_set() notification is incomplete and might result in timers expiring late because the hrtimer code does not re-evaluate the affected clock bases. Use CLOCK_SET_WALL instead of CLOCK_REALTIME to tell the hrtimers code which clock bases need to be re-evaluated. Fixes: 17a1b8826b45 ("hrtimer: Add bases argument to clock_was_set()") Signed-off-by: Thomas Gleixner Cc: John Stultz Cc: Stephen Boyd Cc: stable@vger.kernel.org Acked-by: John Stultz --- kernel/time/timekeeping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -2606,7 +2606,7 @@ int do_adjtimex(struct __kernel_timex *t clock_set |=3D timekeeping_advance(TK_ADV_FREQ); =20 if (clock_set) - clock_was_set(CLOCK_REALTIME); + clock_was_set(CLOCK_SET_WALL); =20 ntp_notify_cmos_timer();