[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250522140326.93869-1-manivannan.sadhasivam@linaro.org>
Date: Thu, 22 May 2025 19:33:26 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: bhelgaas@...gle.com
Cc: linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
bartosz.golaszewski@...aro.org,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Jim Quinlan <james.quinlan@...adcom.com>
Subject: [PATCH] PCI/pwrctrl: Skip creating platform device if CONFIG_PCI_PWRCTL is not enabled
For platforms that do not use pwrctrl framework, the existence of the
pwrctrl platform device will prevent the enumeration of the PCI devices due
to the devlink dependency. This issue is reported on the systems using the
pci-brcmstb.c driver, which doesn't use pwrctrl framework and handles the
endpoint supplies on its own.
So, skip creating the pwrctrl platform device if the framework is not
enabled. It is only a temporary solution to the issue. The actual fix would
be to make pwrctrl framework feature complete (by supporting system PM with
WOL) and convert the drivers that already support system PM like
pci-brcmstb.c to use it.
Fixes: 957f40d039a9 ("PCI/pwrctrl: Move creation of pwrctrl devices to pci_scan_device()")
Reported-by: Jim Quinlan <james.quinlan@...adcom.com>
Closes: https://lore.kernel.org/linux-pci/CA+-6iNwgaByXEYD3j=-+H_PKAxXRU78svPMRHDKKci8AGXAUPg@mail.gmail.com
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Tested-by: Jim Quinlan <james.quinlan@...adcom.com>
---
Bjorn: Since we have merged patches that rename the Kconfig symbol from
CONFIG_PCI_PWRCTL to CONFIG_PCI_PWRCTRL for v6.16, we need to make sure that
those patches also rename the symbol in this patch once it gets merged in
mainline. Maybe merging this patch to pci/pwrctrl branch and rebasing the
renaming patches on top would also help.
drivers/pci/probe.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 364fa2a514f8..7f5e91eafe56 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2514,6 +2514,9 @@ static struct platform_device *pci_pwrctrl_create_device(struct pci_bus *bus, in
struct platform_device *pdev;
struct device_node *np;
+ if (!IS_ENABLED(CONFIG_PCI_PWRCTL))
+ return NULL;
+
np = of_pci_find_child_device(dev_of_node(&bus->dev), devfn);
if (!np || of_find_device_by_node(np))
return NULL;
--
2.43.0
Powered by blists - more mailing lists