Skip to content
Commit 40bf66ec authored by Lin Ming's avatar Lin Ming Committed by Rafael J. Wysocki
Browse files

ACPI / PM: Fix resource_lock dead lock in acpi_power_on_device



Commit 0090def6("ACPI: Add interface to register/unregister device
to/from power resources") used resource_lock to protect the devices list
that relies on power resource. It caused a mutex dead lock, as below

    acpi_power_on ---> lock resource_lock
      __acpi_power_on
        acpi_power_on_device
          acpi_power_get_inferred_state
            acpi_power_get_list_state ---> lock resource_lock

This patch adds a new mutex "devices_lock" to protect the devices list
and calls acpi_power_on_device in acpi_power_on, instead of
__acpi_power_on, after the resource_lock is released.

[rjw: Changed data type of a boolean variable to bool.]

Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarAaron Lu <aaron.lu@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 8f7412a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment