summaryrefslogtreecommitdiff
path: root/kernel/smp.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2023-03-20 17:55:16 -0700
committerPeter Zijlstra <peterz@infradead.org>2023-03-24 11:01:26 +0100
commit203e435844734cfa503cd1755f35db2514db5cca (patch)
treefb35c65fa293455227352868a4e562bf96e1ffa0 /kernel/smp.c
parent6366d062e7f97499409979f23f4107a6c45edb04 (diff)
kernel/smp: Make csdlock_debug= resettable
It is currently possible to set the csdlock_debug_enabled static branch, but not to reset it. This is an issue when several different entities supply kernel boot parameters and also for kernels built with CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT=y. Therefore, make the csdlock_debug=0 kernel boot parameter turn off debugging. Last one wins! Reported-by: Jes Sorensen <Jes.Sorensen@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20230321005516.50558-4-paulmck@kernel.org
Diffstat (limited to 'kernel/smp.c')
-rw-r--r--kernel/smp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/smp.c b/kernel/smp.c
index 7a85bcddd9dc..298ba7570621 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -116,11 +116,16 @@ static DEFINE_STATIC_KEY_MAYBE(CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT, csdlock_debug
*/
static int __init csdlock_debug(char *str)
{
+ int ret;
unsigned int val = 0;
- get_option(&str, &val);
- if (val)
- static_branch_enable(&csdlock_debug_enabled);
+ ret = get_option(&str, &val);
+ if (ret) {
+ if (val)
+ static_branch_enable(&csdlock_debug_enabled);
+ else
+ static_branch_disable(&csdlock_debug_enabled);
+ }
return 1;
}