lib: spinlock: Trigger a watchdog bite on spin_dump for rwlock

Currently dump_stack is printed once a spin_bug is detected for rwlock.
So provide an options to trigger a panic or watchdog bite for debugging
rwlock magic corruptions and lockups.

Change-Id: I20807e8eceb8b81635e58701d1f9f9bd36ab5877
[abhimany: replace msm with qcom]
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
This commit is contained in:
Prasad Sodagudi 2015-04-11 06:06:26 +05:30 committed by David Keitel
parent 77d758e283
commit 805c18d71c
3 changed files with 7 additions and 2 deletions

View file

@ -20,7 +20,7 @@
#define WDOG_BITE_ON_PANIC 0
#endif
#ifdef CONFIG_MSM_WATCHDOG_V2
#ifdef CONFIG_QCOM_WATCHDOG_V2
void msm_trigger_wdog_bite(void);
#else
static inline void msm_trigger_wdog_bite(void) { }

View file

@ -174,6 +174,11 @@ static void rwlock_bug(rwlock_t *lock, const char *msg)
printk(KERN_EMERG "BUG: rwlock %s on CPU#%d, %s/%d, %p\n",
msg, raw_smp_processor_id(), current->comm,
task_pid_nr(current), lock);
#ifdef CONFIG_DEBUG_SPINLOCK_BITE_ON_BUG
msm_trigger_wdog_bite();
#elif defined(CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG)
BUG();
#endif
dump_stack();
}

View file

@ -968,7 +968,7 @@ config DEBUG_SPINLOCK
config DEBUG_SPINLOCK_BITE_ON_BUG
bool "Cause a Watchdog Bite on Spinlock bug"
depends on DEBUG_SPINLOCK && !DEBUG_SPINLOCK_PANIC_ON_BUG && MSM_WATCHDOG_V2
depends on DEBUG_SPINLOCK && !DEBUG_SPINLOCK_PANIC_ON_BUG && QCOM_WATCHDOG_V2
help
On a spinlock bug, cause a watchdog bite so that we can get the precise
state of the system captured at the time of spin dump. This is mutually