]> git.karo-electronics.de Git - mv-sheeva.git/commit
PM / Domains: Fix hibernation restore of devices, v2
authorRafael J. Wysocki <rjw@sisk.pl>
Tue, 13 Mar 2012 21:39:37 +0000 (22:39 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Fri, 16 Mar 2012 20:44:48 +0000 (21:44 +0100)
commit65533bbf63b4f37723fdfedc73d0653958973323
treee2a16b9b0966ae6aea1970fe377c70796a281c31
parentcc85b20780562d404e18a47b9b55b4a5102ae53e
PM / Domains: Fix hibernation restore of devices, v2

During resume from hibernation pm_genpd_restore_noirq() should only
power off domains whose suspend_power_off flags are set once and
not every time it is called for a device in the given domain.
Moreover, it shouldn't decrement genpd->suspended_count, because
that field is not touched during device freezing and therefore it is
always equal to 0 when pm_genpd_restore_noirq() runs for the first
device in the given domain.

This means pm_genpd_restore_noirq() may use genpd->suspended_count
to determine whether or not it it has been called for the domain in
question already in this cycle (it only needs to increment that
field every time it runs for this purpose) and whether or not it
should check if the domain needs to be powered off.  For that to
work, though, pm_genpd_prepare() has to clear genpd->suspended_count
when it runs for the first device in the given domain (in which case
that flag need not be cleared during domain initialization).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: stable@vger.kernel.org
drivers/base/power/domain.c