video: tegra: gk20a: Fix protected elpg race.
authorPrashant Malani <pmalani@nvidia.com>
Tue, 4 Feb 2014 20:39:45 +0000 (12:39 -0800)
committerWinnie Hsu <whsu@nvidia.com>
Tue, 18 Feb 2014 08:26:16 +0000 (00:26 -0800)
commit6e3a8322adfdfc07e045fc874242e7cbd8ec8553
treedd74754ccbe947af93f12f5cbbb39cdee576ed20
parenta2147d4eae706416a16d45378b07e1651510eb78
video: tegra: gk20a: Fix protected elpg race.

Protected elpg calls can be pre-empted in the middle by the deferred
pg_init. This can lead to refcounting errors, which will result in elpg
always remaining on.

Therefore we protect the relevant sections of elpg setup in the deferred
work with a mutex.

Change-Id: I55746412885a09f7dbccd577f0c30d0d1102fe54
Signed-off-by: Prashant Malani <pmalani@nvidia.com>
Reviewed-on: http://git-master/r/363424
(cherry picked from commit 782db693dfc5c70a1d327e52bec167309344ac19)
Reviewed-on: http://git-master/r/368259
Tested-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
drivers/video/tegra/host/gk20a/gr_gk20a.h
drivers/video/tegra/host/gk20a/pmu_gk20a.c
drivers/video/tegra/host/gk20a/pmu_gk20a.h