All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: omap2+: omap_hwmod: Fix false lockdep warning
@ 2015-02-06 12:48 ` Peter Ujfalusi
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Ujfalusi @ 2015-02-06 12:48 UTC (permalink / raw)
  To: Tony Lindgren, paul
  Cc: linux-omap, peterz, mingo, linux-kernel, balbi, linux-arm-kernel

Hi,

In case when hwmods are used in nested way the lockdep validator will print out
a warning message about possible deadlock situation:

[    4.514882] =============================================
[    4.520530] [ INFO: possible recursive locking detected ]
[    4.526176] 3.14.30-00289-ge44872fdca8f-dirty #198 Not tainted
[    4.532285] ---------------------------------------------
[    4.537936] kworker/u4:1/18 is trying to acquire lock:
[    4.543317]  (&(&oh->_lock)->rlock){......}, at: [<c002d2dc>] omap_hwmod_enable+0x2c/0x58
[    4.552109] 
[    4.552109] but task is already holding lock:
[    4.558216]  (&(&oh->_lock)->rlock){......}, at: [<c002d2dc>] omap_hwmod_enable+0x2c/0x58
[    4.566999] 
[    4.566999] other info that might help us debug this:
[    4.573831]  Possible unsafe locking scenario:
[    4.573831] 
[    4.580025]        CPU0
[    4.582584]        ----
[    4.585142]   lock(&(&oh->_lock)->rlock);
[    4.589544]   lock(&(&oh->_lock)->rlock);
[    4.593945] 
[    4.593945]  *** DEADLOCK ***
[    4.593945] 
[    4.600146]  May be due to missing lock nesting notation

What lockdep did not realizes is that the two oh is not the same hwmod object
and we have taken different locks.

One example of nested hwmod usage is on DRA7xx platforms, where McASP can be
configured to use ATL clock as it's functional clock. In this case the
pm_runtime_get/put_sync call will enable the mcasp hwmod and as part of this
operation it will enable the needed clocks. Since ATL clock is needed, we will
have another pm_runtime operation from the ATL clock enable callback which
will take the atl hwmod's lock. This will be seen by lockdep as possible
deadlock situation.

In order to notify lockdep about this, we need to switch using _nested
version of locking function and assign different subclass to those hwmods which
could be used in nested way.

Regards,
Peter
---
Peter Ujfalusi (2):
  ARM: omap2+: omap_hwmod: Use _nested version of spinlock for oh->_lock
  ARM: DRA7: hwmod_data: Change locked_class for atl hwmod

 arch/arm/mach-omap2/omap_hwmod.c          | 16 ++++++++--------
 arch/arm/mach-omap2/omap_hwmod.h          |  5 +++++
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c |  1 +
 3 files changed, 14 insertions(+), 8 deletions(-)

-- 
2.2.2


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2015-02-09 22:31 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-06 12:48 [PATCH 0/2] ARM: omap2+: omap_hwmod: Fix false lockdep warning Peter Ujfalusi
2015-02-06 12:48 ` Peter Ujfalusi
2015-02-06 12:48 ` Peter Ujfalusi
2015-02-06 12:48 ` [PATCH 1/2] ARM: omap2+: omap_hwmod: Use _nested version of spinlock for oh->_lock Peter Ujfalusi
2015-02-06 12:48   ` Peter Ujfalusi
2015-02-06 12:48   ` Peter Ujfalusi
2015-02-06 12:48 ` [PATCH 2/2] ARM: DRA7: hwmod_data: Change locked_class for atl hwmod Peter Ujfalusi
2015-02-06 12:48   ` Peter Ujfalusi
2015-02-06 12:48   ` Peter Ujfalusi
2015-02-06 14:13 ` [PATCH 0/2] ARM: omap2+: omap_hwmod: Fix false lockdep warning Peter Zijlstra
2015-02-06 14:13   ` Peter Zijlstra
2015-02-06 16:05   ` Peter Ujfalusi
2015-02-06 16:05     ` Peter Ujfalusi
2015-02-06 16:05     ` Peter Ujfalusi
2015-02-06 18:32     ` Peter Zijlstra
2015-02-06 18:32       ` Peter Zijlstra
2015-02-06 19:26       ` Peter Ujfalusi
2015-02-06 19:26         ` Peter Ujfalusi
2015-02-06 19:26         ` Peter Ujfalusi
2015-02-09  8:27         ` Peter Ujfalusi
2015-02-09  8:27           ` Peter Ujfalusi
2015-02-09  8:27           ` Peter Ujfalusi
2015-02-09  9:23           ` Peter Zijlstra
2015-02-09  9:23             ` Peter Zijlstra
2015-02-09 16:00           ` Paul Walmsley
2015-02-09 16:00             ` Paul Walmsley
2015-02-09 17:31             ` Tony Lindgren
2015-02-09 17:31               ` Tony Lindgren
2015-02-09 18:55               ` Paul Walmsley
2015-02-09 18:55                 ` Paul Walmsley
2015-02-09 22:16                 ` Tony Lindgren
2015-02-09 22:16                   ` Tony Lindgren
2015-02-09 22:16                   ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.