crypto: tegra-se: put device into runtime suspend state when suspending
authorEric Miao <emiao@nvidia.com>
Wed, 6 Mar 2013 11:30:26 +0000 (19:30 +0800)
committerRiham Haidar <rhaidar@nvidia.com>
Tue, 19 Mar 2013 00:24:02 +0000 (17:24 -0700)
commit762c897f0ccd4bf3282cd8f97c869b07f3feba45
treedf05b2716c0bb11d81a033879a45b659cd2364d3
parent98cbfb520ceaca002e28d836f4d1c6b0f99430a9
crypto: tegra-se: put device into runtime suspend state when suspending

To prevent the device being accidentally put into runtime suspend state
during the whole system suspend process, pm_runtime_get_noresume() is
called upon _every_ device to increase the usage count (please refer to
drivers/base/power/main.c).

Since we don't explicitly disable the clock, pm_runtime_put_sync() in
each operation in tegra_se_suspend() will not actually call the runtime
suspend function, thus leaving the clock still enabled.

To fix this issue in a simple way, we call pm_runtime_put_sync() in the
end of tegra_se_suspend() to decrease the usage count to "0" and thus
call tegra_se_runtime_suspend() in turn to disable the clock. To pair
the usage count, we do a pm_runtime_get_noresume() in tegra_se_resume()
as we don't actually need to runtime resume the device there.

Bug 1246029

Change-Id: I64520b022b896f2867934255a55b852fafac4b63
Signed-off-by: Eric Miao <emiao@nvidia.com>
Reviewed-on: http://git-master/r/206658
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/crypto/tegra-se.c