video: tegra: host: Fix deferred ELPG enable
Deferred ELPG enable has effectively been broken. The variable
elpg_enable_allow has never been cleared and hence ELPG has always
been instantaneous operation.
This patch also accounts few issues related to deferred ELPG enabling:
- The reference count has not been balanced if we enable ELPG in
deferred fashion. This may cause ELPG to be leaved on when it should
be turned off
- Locking has not been proper in deferred ELPG enablement. This patch
modifies the code so that we don't unnecessarily release the lock
when enabling ELPG.
- We give a warning if something suspicious occurs while enabling/
disabling ELPG (i.e. disable call does not lead to actually disabling
ELPG)
Bug
1398567
Change-Id: I67de6708f06e51ce814cdb8a7f156e29929e05cf
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/310103
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Eric Eells <eeells@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>