From: Hosung Kim Date: Mon, 22 May 2017 14:19:55 +0000 (+0900) Subject: [COMMON] lib: dss: add spinlock logging X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a55d78d45517648c6c1a7f3231c13ecaa4fd9054;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] lib: dss: add spinlock logging Change-Id: Iba4a6b003f5ab9af4d020d30131bb701d503807e Signed-off-by: Hosung Kim --- diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 42dfab89e740..edcc2330db10 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h @@ -107,6 +107,7 @@ static inline unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock) local_irq_save(flags); preempt_disable(); + dbg_snapshot_spinlock(lock, 1); spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); /* * On lockdep we dont want the hand-coded irq-enable of @@ -118,6 +119,7 @@ static inline unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock) #else do_raw_spin_lock_flags(lock, &flags); #endif + dbg_snapshot_spinlock(lock, 2); return flags; } @@ -125,8 +127,10 @@ static inline void __raw_spin_lock_irq(raw_spinlock_t *lock) { local_irq_disable(); preempt_disable(); + dbg_snapshot_spinlock(lock, 1); spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); + dbg_snapshot_spinlock(lock, 2); } static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) @@ -139,8 +143,10 @@ static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) static inline void __raw_spin_lock(raw_spinlock_t *lock) { preempt_disable(); + dbg_snapshot_spinlock(lock, 1); spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); + dbg_snapshot_spinlock(lock, 2); } #endif /* !CONFIG_GENERIC_LOCKBREAK || CONFIG_DEBUG_LOCK_ALLOC */ @@ -149,6 +155,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) { spin_release(&lock->dep_map, 1, _RET_IP_); do_raw_spin_unlock(lock); + dbg_snapshot_spinlock(lock, 3); preempt_enable(); } @@ -157,6 +164,7 @@ static inline void __raw_spin_unlock_irqrestore(raw_spinlock_t *lock, { spin_release(&lock->dep_map, 1, _RET_IP_); do_raw_spin_unlock(lock); + dbg_snapshot_spinlock(lock, 3); local_irq_restore(flags); preempt_enable(); } @@ -165,6 +173,7 @@ static inline void __raw_spin_unlock_irq(raw_spinlock_t *lock) { spin_release(&lock->dep_map, 1, _RET_IP_); do_raw_spin_unlock(lock); + dbg_snapshot_spinlock(lock, 3); local_irq_enable(); preempt_enable(); }