xen/spinlock: disable spinlock debugging in console_force_unlock()
PATCH 1/1 xen/spinlock: disable spinlock debugging in console_force_unlock()
console_force_unlock() might result in subsequent ASSERT() triggering when CONFIG_DEBUG_LOCKS was active. Avoid that by calling spin_debug_disable() in console_force_unlock() and make the spinlock debug assertions trigger only if spin_debug was active.
--- xen/common/spinlock.c | 2 +- xen/drivers/char/console.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
xen/common/spinlock.c +1 -1
@@ -85,7 +85,7 @@ static void got_lock(union lock_debug *debug)static void rel_lock (union lock_debug *debug) { -ASSERT (debug->cpu ==smp_processor_id ()); +ASSERT (atomic_read (&spin_debug) <=0 || debug->cpu ==smp_processor_id ()); debug->cpu =SPINLOCK_NO_CPU ; }
xen/drivers/char/console.c +1 -0
@@ -1077,6 +1077,7 @@ void console_unlock_recursive_irqrestore(unsigned long flags)void console_force_unlock (void ) {watchdog_disable (); +spin_debug_disable ();spin_lock_init (&console_lock);serial_force_unlock (sercon_handle); console_locks_busted =1 ;
Signature · 7 lines
2.16.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 16 lines · Juergen Gross
console_force_unlock()might result in subsequentASSERT()triggering whenCONFIG_DEBUG_LOCKSwas active. Avoid that by callingspin_debug_disable()inconsole_force_unlock()and make the spinlock debug assertions trigger only ifspin_debugwas active.Signed-off-by Juergen Gross <[email protected]>--- xen/common/spinlock.c | 2 +- xen/drivers/char/console.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)xen/common/spinlock.c +0
-0
xen/common/spinlock.c static void got_lock(union lock_debug *debug) · line 88
Quoted 5 lines
xen/common/spinlock.c +1
-1@@ -85,7 +85,7 @@ static void got_lock(union lock_debug *debug)static void rel_lock (union lock_debug *debug) { -ASSERT (debug->cpu ==smp_processor_id ()); +ASSERT (atomic_read (&spin_debug) <=0 || debug->cpu ==smp_processor_id ());
Personally, I think the logic would be easier to follow as:
if ( atomic_read(&spin_debug) )
ASSERT(debug->cpu == smp_processor_id());
Otherwise, LGTM. Acked-by: Andrew Cooper <[email protected]>. Can be fixed on commit if you agree.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 25 lines · Andrew Cooper
Quoted 16 lines · Juergen Gross
console_force_unlock()might result in subsequentASSERT()triggering whenCONFIG_DEBUG_LOCKSwas active. Avoid that by callingspin_debug_disable()inconsole_force_unlock()and make the spinlock debug assertions trigger only ifspin_debugwas active.Signed-off-by Juergen Gross <[email protected]>--- xen/common/spinlock.c | 2 +- xen/drivers/char/console.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)xen/common/spinlock.c +0
-0xen/common/spinlock.c static void got_lock(union lock_debug *debug) · line 88
Quoted 5 lines
xen/common/spinlock.c +1
-1@@ -85,7 +85,7 @@ static void got_lock(union lock_debug *debug)static void rel_lock (union lock_debug *debug) { -ASSERT (debug->cpu ==smp_processor_id ()); +ASSERT (atomic_read (&spin_debug) <=0 || debug->cpu ==smp_processor_id ());Personally, I think the logic would be easier to follow as:
Quoted 6 lines
if (
atomic_read(&spin_debug))
ASSERT(debug->cpu == smp_processor_id());Otherwise, LGTM. Acked-by: Andrew Cooper <[email protected]>. Can be fixed on commit if you agree.
No objection from me.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel