EDP: fix deadlock
authorSivaram Nair <sivaramn@nvidia.com>
Fri, 5 Jul 2013 10:40:41 +0000 (13:40 +0300)
committerRiham Haidar <rhaidar@nvidia.com>
Fri, 23 Aug 2013 20:31:52 +0000 (13:31 -0700)
commit2e8b7a61c01c93a1ab49110c14f088301851c29f
tree71b8fc97f6201718e498d1683313f91911980c1b
parent17bf53e1c01f3dbe1fd7a88c956e0393e368089f
EDP: fix deadlock

cancel_work_sync is called with mutex held. This can cause deadlock if
there is a pending work while switching governors or while unregistering
managers (because the worker function tries to take the same lock).

Fix this by:

- getting rid of cancel_work_sync during governor switching (if there is
  no governor, the scheduled work will do nothing)
- call cancel_work_sync after the manager unregistration is complete and
  outside the locked code.

Bug 1313928

Change-Id: I64b270898bffc9b961cb70ca9c181c1c6e6c0118
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/247648
(cherry picked from commit 981bf6768f2ed99127550ba5554e433716586eaa)
Reviewed-on: http://git-master/r/265340
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
drivers/edp/edp.c