]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scftorture: Fix distribution of short handler delays
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 1 Mar 2022 01:40:49 +0000 (17:40 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:29:58 +0000 (10:29 +0200)
[ Upstream commit 8106bddbab5f0ba180e6d693c7c1fc6926d57caa ]

The scftorture test module's scf_handler() function is supposed to provide
three different distributions of short delays (including "no delay") and
one distribution of long delays, if specified by the scftorture.longwait
module parameter.  However, the second of the two non-zero-wait short delays
is disabled due to the first such delay's "goto out" not being enclosed in
the "then" clause with the "udelay()".

This commit therefore adjusts the code to provide the intended set of
delays.

Fixes: e9d338a0b179 ("scftorture: Add smp_call_function() torture test")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/scftorture.c

index dcb0410950e45cd6eb0d436c185f1dd281631614..5d113aa59e7732ecb285ac746a5eee4fcb111932 100644 (file)
@@ -267,9 +267,10 @@ static void scf_handler(void *scfc_in)
        }
        this_cpu_inc(scf_invoked_count);
        if (longwait <= 0) {
-               if (!(r & 0xffc0))
+               if (!(r & 0xffc0)) {
                        udelay(r & 0x3f);
-               goto out;
+                       goto out;
+               }
        }
        if (r & 0xfff)
                goto out;