ACPI / PM: Fix consistency check for power resources during resume
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 25 Jan 2013 20:51:57 +0000 (21:51 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 25 Jan 2013 20:51:57 +0000 (21:51 +0100)
commit660b1113e0f33a476952cb2cbcb5c9831e7ff4cd
treede08984b801858b0be37a34cdc8493a896f39742
parent18a387099b3e3fd901cc706f708b163aa45347b6
ACPI / PM: Fix consistency check for power resources during resume

During system resume we check if there are power resources that have
been turned off by the BIOS, but our reference counters for them
are nonzero (they need to be turned on then).  It turns out, however,
that we also need to check the opposite, i.e. if there are power
resources that have been turned on by the BIOS, but our reference
counters for them are zero (which means that no devices are going
to need them any time soon) and we should turn them off.

Make the power resources resume code do the additional check and
turn off the unused power resources as appropriate.

This change has been tested on HP nx6325.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/power.c