PM / Domains: Do not stop devices after restoring their states
authorRafael J. Wysocki <rjw@sisk.pl>
Fri, 15 Jun 2012 22:02:34 +0000 (00:02 +0200)
committerSimone Willett <swillett@nvidia.com>
Fri, 19 Oct 2012 19:19:36 +0000 (12:19 -0700)
commit1bf2fc0ff8760be6e8a9d65a8c9a8417a888b795
tree77c78be266e64c11deb1be1d29d2293e206af7b5
parent7d606dd6bd9b785b57f14fd230f79328a8403d9f
PM / Domains: Do not stop devices after restoring their states

While resuming a device belonging to a PM domain,
pm_genpd_runtime_resume() calls __pm_genpd_restore_device() to
restore its state, if necessary.  The latter starts the device,
using genpd_start_dev(), restores its state, using
genpd_restore_dev(), and then stops it, using genpd_stop_dev().
However, this last operation is not necessary, because the
device is supposed to be operational after pm_genpd_runtime_resume()
has returned and because of it pm_genpd_runtime_resume() has to
call genpd_start_dev() once again for the "restored" device, which
is inefficient.

To make things more efficient, remove the call to genpd_stop_dev()
from __pm_genpd_restore_device() and the direct call to
genpd_start_dev() from pm_genpd_runtime_resume().  [Of course,
genpd_start_dev() still has to be called by it for devices with the
power.irq_safe flag set, because __pm_genpd_restore_device() is not
executed for them.]

This change has been tested on the SH7372 Mackerel board.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
(cherry picked from commit 80de3d7f416f1accd03f2e519ead32d6fde4fcf4)

Change-Id: Id6999532ec29ba7ac3199301d3e54868ae181cce
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/145219
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/base/power/domain.c