mbox series

[v9,0/3] Fix wakeup problems on some AMD platforms

Message ID 20230804010229.3664-1-mario.limonciello@amd.com
Headers show
Series Fix wakeup problems on some AMD platforms | expand

Message

Mario Limonciello Aug. 4, 2023, 1:02 a.m. UTC
Problems have been reported on AMD laptops with suspend/resume
where particular root ports are put into D3 and then the system is unable
to resume properly.

The issue boils down to the currently selected kernel policy for root port
behavior at suspend time:
0) If the machine is from 2015 or later
1) If a PCIe root port is power manageable by the platform then platform
   will be used to determine the power state of the root port at suspend.
2) If the PCIe root is not power manageable by the platform then the kernel
   will check if it was configured to wakeup.
3) If it was, then it will be put into the deepest state that supports
   wakeup from PME.
4) If it wasn't, then it will be put into D3hot.

This patch adjusts it so that device constraints for low power idle are
considered if the device is not power manageable by the platform.

Mario Limonciello (3):
  ACPI: Add comments to clarify some #ifdef statements
  ACPI: x86: s2idle: Adjust constraints logic building
  PCI/ACPI: Use device constraints to decide PCI target state fallback
    policy

 drivers/acpi/x86/s2idle.c | 71 ++++++++++++++++++++++++++-------------
 drivers/pci/pci-acpi.c    | 22 ++++++++++++
 drivers/pci/pci.c         | 14 ++++++++
 drivers/pci/pci.h         |  5 +++
 include/linux/acpi.h      | 14 +++++---
 5 files changed, 99 insertions(+), 27 deletions(-)

Comments

Andy Shevchenko Aug. 4, 2023, 4:31 a.m. UTC | #1
On Thu, Aug 03, 2023 at 08:02:28PM -0500, Mario Limonciello wrote:
> Constraints are currently only stored when enabled.  To enable
> the ability to check if constraints are present they need to be
> stored even if disabled.

...

> @@ -120,8 +121,7 @@ static void lpi_device_get_constraints_amd(void)
>  			if (!lpi_constraints_table)
>  				goto free_acpi_buffer;
>  
> -			acpi_handle_debug(lps0_device_handle,
> -					  "LPI: constraints list begin:\n");
> +			acpi_handle_debug(lps0_device_handle, "LPI: constraints list begin:\n");
>  
>  			for (j = 0; j < package->package.count; ++j) {
>  				union acpi_object *info_obj = &package->package.elements[j];

Unrelated change.