Thread (18 messages) 18 messages, 3 authors, 2025-02-14

Re: [PATCH v1 3/6] PCI: brcmstb: Fix potential premature regluator disabling

From: Bjorn Helgaas <helgaas@kernel.org>
Date: 2025-02-06 17:33:01
Also in: linux-pci, lkml

In subject,

s/regluator/regulator/

On Wed, Feb 05, 2025 at 02:12:03PM -0500, Jim Quinlan wrote:
Our system for enabling and disabling regulators is designed to work
only on the port driver below the root complex.  The conditions to
discriminate for this case should be the same when we are adding or
removing the bus.  Without this change the regulators may be disabled
prematurely when a bus further down the tree is removed.
What did the user do to cause the bus to be removed?  I'm wondering if
we turn off the power while the link is still up.  If we do, how does
it get turned back on?  Does that require a manual rescan, and the
scan of the child bus gets the power turned back on?
quoted hunk ↗ jump to hunk
Fixes: 9e6be018b263 ("PCI: brcmstb: Enable child bus device regulators from DT")
Signed-off-by: Jim Quinlan <redacted>
---
 drivers/pci/controller/pcie-brcmstb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index bf919467cbcd..4f5d751cbdd7 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1441,7 +1441,7 @@ static void brcm_pcie_remove_bus(struct pci_bus *bus)
 	struct subdev_regulators *sr = pcie->sr;
 	struct device *dev = &bus->dev;
 
-	if (!sr)
+	if (!sr || !bus->parent || !pci_is_root_bus(bus->parent))
 		return;
 
 	if (regulator_bulk_disable(sr->num_supplies, sr->supplies))
-- 
2.43.0
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help