summaryrefslogtreecommitdiff
path: root/drivers/pnp
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-10-22 02:35:54 +0200
committerLen Brown <len.brown@intel.com>2010-10-23 01:56:14 -0400
commit3e384ee6c687cb397581ee8f9440fc8220cfac80 (patch)
treeb8559d4952bb6d7350eeb5a0bac418a5eacda117 /drivers/pnp
parentf6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff)
ACPI / PM: Fix reference counting of power resources
The reference counting of ACPI power resources is currently broken for a few reasons. First, instead of using a simple reference counter per power resource it uses a list of objects representing refereces to the given power resource from devices. This leads to the second breakage, because it prevents power resources from being referenced more than once by one device, which is necessary if the device is configured to signal wakeup. Namely, when putting the device into a low power state we first call acpi_enable_wakeup_device_power() that should reference count power resources needed for signaling wakeup and then we call acpi_power_transition() to power off the device. The latter call drops references to the device's power resources, possibly including the ones added by acpi_enable_wakeup_device_power(), so the device can't signal wakeup as a result. Apart from this, the locking in acpi_power_on() and acpi_power_off_device() doesn't prevent all possible races from happening, which may be problematic for runtime PM and asynchronous suspend and resume. Fix the problem by using a counter for power resources reference counting and putting the evaluation of ACPI _ON and _OFF methods under the power resource mutex. Reported-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp')
0 files changed, 0 insertions, 0 deletions