gpu: pvr: fix lockdep problem
authorImre Deak <imre.deak@nokia.com>
Thu, 29 Apr 2010 11:28:37 +0000 (14:28 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:41 +0000 (21:09 +0300)
commit147fca6daf85ca62b926829a048dfa2724c0ea94
tree88f5539a5aa0b2ddc12d119baf2f6e257a3ca274
parentbf66695eea3a27c4fa6c34235a75394a710bae4d
gpu: pvr: fix lockdep problem

On the CLK_PRE_RATE_CHANGE:
1. lock A           <- __blocking_notifier_call_chain:nh->rwsem
2. lock B           <- vdd2_pre_post_func:gPVRSRVLock
3. unlock A

On the CLK_POST_RATE_CHANGE/CLK_ABORT_RATE_CHANGE:
4. lock A
5. unlock B
6. unlock A

The above has an ABA lock pattern which triggers the warning. This can't
lead to a dead lock though since at 3. we always release A, before it's
again acquired at 4. To avoid the warning use a wait queue based approach
so that we can unlock B before 3.

Fixes: NB#166168 - PVR: possible circular locking dependency detected

Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/pvr_bridge_k.c
pvr/pvr_bridge_km.h
pvr/sysutils.c