[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240802-pci-bridge-d3-v5-4-2426dd9e8e27@linaro.org>
Date: Fri, 02 Aug 2024 11:25:03 +0530
From: Manivannan Sadhasivam via B4 Relay <devnull+manivannan.sadhasivam.linaro.org@...nel.org>
To: Bjorn Helgaas <bhelgaas@...gle.com>,
"Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org, lukas@...ner.de,
mika.westerberg@...ux.intel.com,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Hsin-Yi Wang <hsinyi@...omium.org>
Subject: [PATCH v5 4/4] PCI: Allow PCI bridges to go to D3Hot on all
Devicetree based platforms
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Unlike ACPI based platforms, there are no known issues with D3Hot for the
PCI bridges in the Devicetree based platforms. So let's allow the PCI
bridges to go to D3Hot during runtime. It should be noted that the bridges
need to be defined in Devicetree for this to work.
Currently, D3Cold is not allowed since Vcc supply which is required for
transitioning the device to D3Cold is not exposed on all Devicetree based
platforms.
Tested-by: Hsin-Yi Wang <hsinyi@...omium.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
---
drivers/pci/pci.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index c7a4f961ec28..bc1e1ca673f1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2992,6 +2992,18 @@ static bool pci_bridge_d3_allowed(struct pci_dev *bridge, pci_power_t state)
if (pci_bridge_d3_force)
return true;
+ /*
+ * Allow D3Hot for all Devicetree based platforms having a
+ * separate node for the bridge. We don't allow D3Cold for now
+ * since not all platforms are exposing the Vcc supply in
+ * Devicetree which is required for transitioning the bridge to
+ * D3Cold.
+ *
+ * NOTE: The bridge is expected to be defined in Devicetree.
+ */
+ if (state == PCI_D3hot && dev_of_node(&bridge->dev))
+ return true;
+
/* Even the oldest 2010 Thunderbolt controller supports D3. */
if (bridge->is_thunderbolt)
return true;
@@ -3042,7 +3054,7 @@ bool pci_bridge_d3cold_allowed(struct pci_dev *bridge)
*
* This function checks if the bridge is allowed to move to D3Hot.
* Currently we only allow D3Hot for recent enough PCIe ports on ACPI based
- * platforms and Thunderbolt.
+ * platforms, Thunderbolt and Devicetree based platforms.
*/
bool pci_bridge_d3hot_allowed(struct pci_dev *bridge)
{
--
2.25.1
Powered by blists - more mailing lists