]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clocksource: Fix brown-bag boolean thinko in cs_watchdog_read()
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 2 Aug 2024 15:46:15 +0000 (08:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Aug 2024 03:45:45 +0000 (05:45 +0200)
commitc5ea55fe2b137eb4030020dbe6099574d0fc48c7
treee6cd5f6d4aaacb8195614cebb9c824fc3669f50c
parentfcd4f3a9d92bd3be4852dc821b5d5ea6da219158
clocksource: Fix brown-bag boolean thinko in cs_watchdog_read()

[ Upstream commit f2655ac2c06a15558e51ed6529de280e1553c86e ]

The current "nretries > 1 || nretries >= max_retries" check in
cs_watchdog_read() will always evaluate to true, and thus pr_warn(), if
nretries is greater than 1.  The intent is instead to never warn on the
first try, but otherwise warn if the successful retry was the last retry.

Therefore, change that "||" to "&&".

Fixes: db3a34e17433 ("clocksource: Retry clock read if long delays detected")
Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20240802154618.4149953-2-paulmck@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/time/clocksource.c