]> nv-tegra.nvidia Code Review - linux-3.10.git/commit
ACPI / PM: Always evaluate _PSn after setting power resources
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Jan 2013 11:56:04 +0000 (12:56 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Jan 2013 11:56:04 +0000 (12:56 +0100)
commite78adb7595a9d585c60a7497345cb6eaeaaacefb
treec4b8ec0cb80d0e850e074a47bd0ff277159fe7cc
parent9c0f45e388fb9f9003ea22f98b84ffbab65ba554
ACPI / PM: Always evaluate _PSn after setting power resources

The ACPI specitication (ACPI 5, Sections 7.2.8 - 7.2.11) requires
that the _PSn (n = 0..3) method, if present, be executed after the
power resources for the given device power state have been set
appropriately.  However, acpi_device_set_power() does that only
if the new power state is going to be higher-power (lower-number)
than the power state the device is in already.  Otherwise, the
ordering is reverse to protect against situations in which _PSn
might access device registers unavailable after configuring the
power resources for power state Dn (D3 meaning D3hot).

Such situations are very unlikely to happen, though, and _PSn may
actually be implemented with the assumption that power resources
have been configured for power state Dn in advance, so change the
code to follow the specification literally.

This change was previously porposed in a different form by Lv Zheng.

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