Skip to content

Commit a6c05e1

Browse files
Raul E Rangelrafaeljw
authored andcommitted
ACPI: PM: Take wake IRQ into consideration when entering suspend-to-idle
This change adds support for ACPI devices that use ExclusiveAndWake or SharedAndWake in their _CRS GpioInt definition (instead of using _PRW), and also provide power resources. Previously the ACPI subsystem had no idea if the device had a wake capable interrupt armed. This resulted in the ACPI device PM system placing the device into D3Cold, and thus cutting power to the device. With this change we will now query the _S0W method to figure out the appropriate wake capable D-state. Signed-off-by: Raul E Rangel <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b38f2d5 commit a6c05e1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/acpi/device_pm.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,22 @@ static int acpi_dev_pm_get_state(struct device *dev, struct acpi_device *adev,
681681
d_min = ret;
682682
wakeup = device_may_wakeup(dev) && adev->wakeup.flags.valid
683683
&& adev->wakeup.sleep_state >= target_state;
684+
} else if (device_may_wakeup(dev) && dev->power.wakeirq) {
685+
/*
686+
* The ACPI subsystem doesn't manage the wake bit for IRQs
687+
* defined with ExclusiveAndWake and SharedAndWake. Instead we
688+
* expect them to be managed via the PM subsystem. Drivers
689+
* should call dev_pm_set_wake_irq to register an IRQ as a wake
690+
* source.
691+
*
692+
* If a device has a wake IRQ attached we need to check the
693+
* _S0W method to get the correct wake D-state. Otherwise we
694+
* end up putting the device into D3Cold which will more than
695+
* likely disable wake functionality.
696+
*/
697+
wakeup = true;
684698
} else {
699+
/* ACPI GPE is specified in _PRW. */
685700
wakeup = adev->wakeup.flags.valid;
686701
}
687702

0 commit comments

Comments
 (0)