Loading include/soc/qcom/watchdog.h +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,10 @@ #define WDOG_BITE_ON_PANIC 0 #endif #ifdef CONFIG_MSM_WATCHDOG_V2 void msm_trigger_wdog_bite(void); #else static inline void msm_trigger_wdog_bite(void) { } #endif #endif lib/Kconfig.debug +16 −0 Original line number Diff line number Diff line Loading @@ -582,6 +582,22 @@ config DEBUG_SPINLOCK best used in conjunction with the NMI watchdog so that spinlock deadlocks are also debuggable. 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 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 exclusive with the below DEBUG_SPINLOCK_PANIC_ON_BUG config. config DEBUG_SPINLOCK_PANIC_ON_BUG bool "Cause a Kernel Panic on Spinlock bug" depends on DEBUG_SPINLOCK && !DEBUG_SPINLOCK_BITE_ON_BUG help On a spinlock bug, cause a kernel panic so that we can get the complete information about the system at the time of spin dump in the dmesg. This is mutually exclusive with the above DEBUG_SPINLOCK_BITE_ON_BUG. config DEBUG_MUTEXES bool "Mutex debugging: basic checks" depends on DEBUG_KERNEL Loading lib/spinlock_debug.c +6 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ #include <linux/debug_locks.h> #include <linux/delay.h> #include <linux/export.h> #include <linux/bug.h> #include <soc/qcom/watchdog.h> void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, struct lock_class_key *key) Loading Loading @@ -65,7 +65,11 @@ static void spin_dump(raw_spinlock_t *lock, const char *msg) owner ? owner->comm : "<none>", owner ? task_pid_nr(owner) : -1, lock->owner_cpu); BUG_ON(PANIC_CORRUPTION); #ifdef CONFIG_DEBUG_SPINLOCK_BITE_ON_BUG msm_trigger_wdog_bite(); #elif defined(CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG) BUG(); #endif dump_stack(); } Loading Loading
include/soc/qcom/watchdog.h +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,10 @@ #define WDOG_BITE_ON_PANIC 0 #endif #ifdef CONFIG_MSM_WATCHDOG_V2 void msm_trigger_wdog_bite(void); #else static inline void msm_trigger_wdog_bite(void) { } #endif #endif
lib/Kconfig.debug +16 −0 Original line number Diff line number Diff line Loading @@ -582,6 +582,22 @@ config DEBUG_SPINLOCK best used in conjunction with the NMI watchdog so that spinlock deadlocks are also debuggable. 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 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 exclusive with the below DEBUG_SPINLOCK_PANIC_ON_BUG config. config DEBUG_SPINLOCK_PANIC_ON_BUG bool "Cause a Kernel Panic on Spinlock bug" depends on DEBUG_SPINLOCK && !DEBUG_SPINLOCK_BITE_ON_BUG help On a spinlock bug, cause a kernel panic so that we can get the complete information about the system at the time of spin dump in the dmesg. This is mutually exclusive with the above DEBUG_SPINLOCK_BITE_ON_BUG. config DEBUG_MUTEXES bool "Mutex debugging: basic checks" depends on DEBUG_KERNEL Loading
lib/spinlock_debug.c +6 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ #include <linux/debug_locks.h> #include <linux/delay.h> #include <linux/export.h> #include <linux/bug.h> #include <soc/qcom/watchdog.h> void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, struct lock_class_key *key) Loading Loading @@ -65,7 +65,11 @@ static void spin_dump(raw_spinlock_t *lock, const char *msg) owner ? owner->comm : "<none>", owner ? task_pid_nr(owner) : -1, lock->owner_cpu); BUG_ON(PANIC_CORRUPTION); #ifdef CONFIG_DEBUG_SPINLOCK_BITE_ON_BUG msm_trigger_wdog_bite(); #elif defined(CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG) BUG(); #endif dump_stack(); } Loading