]> git.baikalelectronics.ru Git - kernel.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)
commit160551cc6eb7e45544cabf250272d8b4e21c3bd3
treec4b8ec0cb80d0e850e074a47bd0ff277159fe7cc
parentae89932f376165c776920375c7260c0de2b117c6
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