Skip to contentSkip to conversation

ARM/hw_breakpoint: Fix possible recursive locking for arch_hw_breakpoint_init

PATCH In review Tony Lindgren 4 participants 4 messages Jun 16, 2017 – Jun 20, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM/hw_breakpoint: Fix possible recursive locking for arch_hw_breakpoint_init

Recent change to use cpuhp_setup_state_cpuslocked() with commit fe2a5cd8aa03 ("ARM/hw_breakpoint: Use cpuhp_setup_state_cpuslocked()") missed to change the related paired cpuhp_remove_state_nocalls_cpuslocked().

Now if arch_hw_breakpoint_init() fails, we get "WARNING: possible recursive locking detected" on the exit path.

Fixes fe2a5cd8aa03 ("ARM/hw_breakpoint: Use

cpuhp_setup_state_cpuslocked()")

Cc Sebastian Andrzej Siewior <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Paul E. McKenney <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Will Deacon <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Russell King <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
---
 arch/arm/kernel/hw_breakpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/hw_breakpoint.c +1 -1
@@ -1106,7 +1106,7 @@ static int __init arch_hw_breakpoint_init(void)
 		core_num_brps = 0;
 		core_num_wrps = 0;
 		if (ret > 0)
-			cpuhp_remove_state_nocalls(ret);
+			cpuhp_remove_state_nocalls_cpuslocked(ret);
 		cpus_read_unlock();
 		return 0;
 	}
Signature · 1 line
2.13.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Tony Lindgren

Recent change to use cpuhp_setup_state_cpuslocked() with commit fe2a5cd8aa03 ("ARM/hw_breakpoint: Use cpuhp_setup_state_cpuslocked()") missed to change the related paired cpuhp_remove_state_nocalls_cpuslocked().

Now if arch_hw_breakpoint_init() fails, we get "WARNING: possible recursive locking detected" on the exit path.

Fixes fe2a5cd8aa03 ("ARM/hw_breakpoint: Use

cpuhp_setup_state_cpuslocked()")

Quoted 10 lines
Cc Sebastian Andrzej Siewior <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Paul E. McKenney <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Will Deacon <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Russell King <[email protected]>
Cc linux-arm-kernel at lists.infradead.org

Thank you.

Sebastian

#2 lore raw
In reply to Tony Lindgren
Quoted 19 lines · Tony Lindgren

Recent change to use cpuhp_setup_state_cpuslocked() with commit fe2a5cd8aa03 ("ARM/hw_breakpoint: Use cpuhp_setup_state_cpuslocked()") missed to change the related paired cpuhp_remove_state_nocalls_cpuslocked().

Now if arch_hw_breakpoint_init() fails, we get "WARNING: possible recursive locking detected" on the exit path.

Fixes fe2a5cd8aa03 ("ARM/hw_breakpoint: Use

cpuhp_setup_state_cpuslocked()")

Cc Sebastian Andrzej Siewior <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Paul E. McKenney <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Will Deacon <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Russell King <[email protected]>
Quoted 3 lines
---
 arch/arm/kernel/hw_breakpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This looks correct to me, so I guess it should go via -tip (where the problematic patch is queued already).

Will

Quoted 14 lines
arch/arm/kernel/hw_breakpoint.c +1 -1
@@ -1106,7 +1106,7 @@ static int __init arch_hw_breakpoint_init(void)
 		core_num_brps = 0;
 		core_num_wrps = 0;
 		if (ret > 0)
-			cpuhp_remove_state_nocalls(ret);
+			cpuhp_remove_state_nocalls_cpuslocked(ret);
 		cpus_read_unlock();
 		return 0;
 	}
Signature · 1 line
2.13.0
#3 lore raw
In reply to Tony Lindgren
ARM/hw_breakpoint: Fix possible recursive locking for arch_hw_breakpoint_init
Commit-ID:  1b3b22507e0d45dedc6a54b26d56e0b8c4d36875
Gitweb:     http://git.kernel.org/tip/1b3b22507e0d45dedc6a54b26d56e0b8c4d36875
Author:     Tony Lindgren <[email protected]>
AuthorDate: Fri, 16 Jun 2017 01:22:38 -0700
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 20 Jun 2017 12:25:22 +0200

ARM/hw_breakpoint: Fix possible recursive locking for arch_hw_breakpoint_init

Recent change to use cpuhp_setup_state_cpuslocked() with commit fe2a5cd8aa03 ("ARM/hw_breakpoint: Use cpuhp_setup_state_cpuslocked()") missed to change the related paired cpuhp_remove_state_nocalls_cpuslocked().

Now if arch_hw_breakpoint_init() fails, we get "WARNING: possible recursive locking detected" on the exit path.

Fixes fe2a5cd8aa03 ("ARM/hw_breakpoint: Use cpuhp_setup_state_cpuslocked()")
Cc Mark Rutland <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Will Deacon <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Russell King <[email protected]>
Cc "Paul E . McKenney" <[email protected]>
---
 arch/arm/kernel/hw_breakpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/hw_breakpoint.c +1 -1
index 63cb4c7..af2a7f1 100644
@@ -1106,7 +1106,7 @@ static int __init arch_hw_breakpoint_init(void)
 		core_num_brps = 0;
 		core_num_wrps = 0;
 		if (ret > 0)
-			cpuhp_remove_state_nocalls(ret);
+			cpuhp_remove_state_nocalls_cpuslocked(ret);
 		cpus_read_unlock();
 		return 0;
 	}