ACPI / PM: Check device state before refcounting power resources
authorRafael J. Wysocki <rjw@sisk.pl>
Wed, 24 Nov 2010 23:02:36 +0000 (00:02 +0100)
committerLen Brown <len.brown@intel.com>
Wed, 1 Dec 2010 21:53:16 +0000 (16:53 -0500)
commit212967c69afd348342548272aedbe4d46a9325d6
tree1b953dd0f8c9424a82aaeb7e383dd971746c0f7d
parente8a7e48bb248a1196484d3f8afa53bded2b24e71
ACPI / PM: Check device state before refcounting power resources

Commit 3e384ee6c687cb397581ee8f9440fc8220cfac80 (ACPI / PM: Fix
reference counting of power resources) introduced a regression by
causing fan power resources to be turned on and reference counted
unnecessarily during resume, so on some boxes fans are always on
after resume.

Fix the problem by checking if the current device state is different
from the new state before reference counting and turning on power
resources in acpi_power_transition().

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=22932 .

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-and-tested-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/power.c