Patch "clocksource: Fix brown-bag boolean thinko in cs_watchdog_read()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    clocksource: Fix brown-bag boolean thinko in cs_watchdog_read()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     clocksource-fix-brown-bag-boolean-thinko-in-cs_watch.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d9b69c864d59e23ff97079b6d616018c48e27790
Author: Paul E. McKenney <paulmck@xxxxxxxxxx>
Date:   Fri Aug 2 08:46:15 2024 -0700

    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@xxxxxxxxx>
    Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
    Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
    Cc: stable@xxxxxxxxxxxxxxx
    Link: https://lore.kernel.org/all/20240802154618.4149953-2-paulmck@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index c3b59f2250a17..3ccb383741d08 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -229,7 +229,7 @@ static enum wd_read_status cs_watchdog_read(struct clocksource *cs, u64 *csnow,
 		wd_delay = clocksource_cyc2ns(wd_delta, watchdog->mult,
 					      watchdog->shift);
 		if (wd_delay <= WATCHDOG_MAX_SKEW) {
-			if (nretries > 1 || nretries >= max_retries) {
+			if (nretries > 1 && nretries >= max_retries) {
 				pr_warn("timekeeping watchdog on CPU%d: %s retried %d times before success\n",
 					smp_processor_id(), watchdog->name, nretries);
 			}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux