video: tegra: host: gk20a: fix possible elpg race
authorPrashant Malani <pmalani@nvidia.com>
Mon, 27 Jan 2014 23:33:54 +0000 (15:33 -0800)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Wed, 29 Jan 2014 11:07:18 +0000 (03:07 -0800)
commitf2d3e72534ad89346a9454bfcd08ff2138d16d22
tree373cc548243d1d1d6ab162826b79cffa34ec1dd2
parentdfd11c6523120f7c832f8622869e703aed108b6a
video: tegra: host: gk20a: fix possible elpg race

Currently, the enablement of ELPG is placed in deferred work. But,
graphics code can call elpg enable/disable before this deferred work
runs. The current enable/disable routines don't verify that gPMU has
ELPG correctly initialized (along with the PG buffers set up, which is
done in the deferred work). Therefore the driver could potentially send
ELPG commands to gPMU even when it is not completely set up to process
them. Therefore we add a check to ensure that gPMU is completely
initialized before issuing such commands.

Bug 1446194
Bug 1445308

Change-Id: I8e675ae2ab900643c70310a6b37b6dfb022469d8
Signed-off-by: Prashant Malani <pmalani@nvidia.com>
Reviewed-on: http://git-master/r/360616
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/gk20a/pmu_gk20a.c