Commit 203e4358 authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Peter Zijlstra
Browse files

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: default avatarJes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarJuergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20230321005516.50558-4-paulmck@kernel.org
parent 6366d062
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -889,12 +889,13 @@
	cs89x0_media=	[HW,NET]
			Format: { rj45 | aui | bnc }

	csdlock_debug=	[KNL] Enable debug add-ons of cross-CPU function call
			handling. When switched on, additional debug data is
			printed to the console in case a hanging CPU is
			detected, and that CPU is pinged again in order to try
			to resolve the hang situation.  The default value of
			this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
	csdlock_debug=	[KNL] Enable or disable debug add-ons of cross-CPU
			function call handling. When switched on,
			additional debug data is printed to the console
			in case a hanging CPU is detected, and that
			CPU is pinged again in order to try to resolve
			the hang situation.  The default value of this
			option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
			Kconfig option.

	dasd=		[HW,NET]
+8 −3
Original line number Diff line number Diff line
@@ -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);
	ret = get_option(&str, &val);
	if (ret) {
		if (val)
			static_branch_enable(&csdlock_debug_enabled);
		else
			static_branch_disable(&csdlock_debug_enabled);
	}

	return 1;
}