diff mbox series

[v14.c,2/4] PCI: ACPI: Consider non-hotplug bridges for D3 in acpi_pci_bridge_d3()

Message ID 20230818194027.27559-3-mario.limonciello@amd.com (mailing list archive)
State Superseded
Delegated to: Bjorn Helgaas
Headers show
Series Use LPS0 constraints to opt devices into D3 | expand

Commit Message

Mario Limonciello Aug. 18, 2023, 7:40 p.m. UTC
acpi_pci_bridge_d3() only runs on hotplug bridges. Two checks are made
for _S0W and for whether a device is power manageable contingent upon
an ACPI companion being present.

These checks also make sense for non-hotplug bridges, so move the
check for hotplug bridge after the acpi companion checks.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/pci/pci-acpi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Rafael J. Wysocki Aug. 21, 2023, 6:36 p.m. UTC | #1
On Fri, Aug 18, 2023 at 9:40 PM Mario Limonciello
<mario.limonciello@amd.com> wrote:
>
> acpi_pci_bridge_d3() only runs on hotplug bridges. Two checks are made
> for _S0W and for whether a device is power manageable contingent upon
> an ACPI companion being present.
>
> These checks also make sense for non-hotplug bridges, so move the
> check for hotplug bridge after the acpi companion checks.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Looks reasonable to me.

Acked-by: Rafael J. Wysocki <rafael@kernel.org>

> ---
>  drivers/pci/pci-acpi.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> index b5b65cdfa3b8b..64e6ada024235 100644
> --- a/drivers/pci/pci-acpi.c
> +++ b/drivers/pci/pci-acpi.c
> @@ -1017,7 +1017,7 @@ bool acpi_pci_bridge_d3(struct pci_dev *dev)
>         struct acpi_device *adev, *rpadev;
>         const union acpi_object *obj;
>
> -       if (acpi_pci_disabled || !dev->is_hotplug_bridge)
> +       if (acpi_pci_disabled)
>                 return false;
>
>         adev = ACPI_COMPANION(&dev->dev);
> @@ -1039,6 +1039,9 @@ bool acpi_pci_bridge_d3(struct pci_dev *dev)
>                         return true;
>         }
>
> +       if (!dev->is_hotplug_bridge)
> +               return false;
> +
>         rpdev = pcie_find_root_port(dev);
>         if (!rpdev)
>                 return false;
> --
diff mbox series

Patch

diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index b5b65cdfa3b8b..64e6ada024235 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -1017,7 +1017,7 @@  bool acpi_pci_bridge_d3(struct pci_dev *dev)
 	struct acpi_device *adev, *rpadev;
 	const union acpi_object *obj;
 
-	if (acpi_pci_disabled || !dev->is_hotplug_bridge)
+	if (acpi_pci_disabled)
 		return false;
 
 	adev = ACPI_COMPANION(&dev->dev);
@@ -1039,6 +1039,9 @@  bool acpi_pci_bridge_d3(struct pci_dev *dev)
 			return true;
 	}
 
+	if (!dev->is_hotplug_bridge)
+		return false;
+
 	rpdev = pcie_find_root_port(dev);
 	if (!rpdev)
 		return false;