gpu: pvr: fix locking on the HW interrupt path
authorImre Deak <imre.deak@nokia.com>
Wed, 31 Mar 2010 13:56:53 +0000 (16:56 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:40 +0000 (21:09 +0300)
commite03bf6d9ec0656aaf60fb60bc5c8d1054a3cb63d
tree5bfc41e2483d65978eb089c0b294efe94a5bf88d
parentcff2809a0b9ef847eebaa275334615a227a01b31
gpu: pvr: fix locking on the HW interrupt path

- take pvr_lock in the interrupt handling work (MISR) thread, as from
  there we can call functions accessing HW and SW state tracking objects.
  An example is the SGX HW recovery function.

- make SGXOSTimerCancel asynchronous. This is safe now as a previous
  patch made sure that the timer will not run after cancelled. We can't
  do synchronous cancellation, because there would be an ABBA lockdep
  problem involving the SGXOSTimer's mutex and pvr_lock:

  MISR / IOCTL thread:
    1. pvr_lock in PVRSRV_BridgeDispatchKM
    2. timer's lock through SGXPrePowerState -> SGXOSTimerCancel

  SGXOSTimer's thread:
    1. timer's lock already taken when SGXOSTimer is called
    2. pvr_lock in SGXOSTimer

Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/pvrsrv.c
pvr/sgxinit.c