Skip to content

Commit 7894025

Browse files
committed
Revert "PCI: brcmstb: Do not turn off WOL regulators on suspend"
This reverts commit 11ed8b8. This is part of a revert of the following commits: 11ed8b8 ("PCI: brcmstb: Do not turn off WOL regulators on suspend") 93e41f3 ("PCI: brcmstb: Add control of subdevice voltage regulators") 67211aa ("PCI: brcmstb: Add mechanism to turn on subdev regulators") 830aa6f ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs") Cyril reported that 830aa6f ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs"), which appeared in v5.17-rc1, broke booting on the Raspberry Pi Compute Module 4. Apparently 830aa6f panics with an Asynchronous SError Interrupt, and after further commits here is a black screen on HDMI and no output on the serial console. This does not seem to affect the Raspberry Pi 4 B. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215925 Link: https://lore.kernel.org/r/20220511201856.808690-2-helgaas@kernel.org Reported-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 3cc3014 commit 7894025

File tree

1 file changed

+9
-44
lines changed

1 file changed

+9
-44
lines changed

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 9 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ struct brcm_pcie {
333333
void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val);
334334
bool refusal_mode;
335335
struct subdev_regulators *sr;
336-
bool ep_wakeup_capable;
337336
};
338337

339338
static inline bool is_bmips(const struct brcm_pcie *pcie)
@@ -1351,21 +1350,9 @@ static void brcm_pcie_turn_off(struct brcm_pcie *pcie)
13511350
pcie->bridge_sw_init_set(pcie, 1);
13521351
}
13531352

1354-
static int pci_dev_may_wakeup(struct pci_dev *dev, void *data)
1355-
{
1356-
bool *ret = data;
1357-
1358-
if (device_may_wakeup(&dev->dev)) {
1359-
*ret = true;
1360-
dev_info(&dev->dev, "disable cancelled for wake-up device\n");
1361-
}
1362-
return (int) *ret;
1363-
}
1364-
13651353
static int brcm_pcie_suspend(struct device *dev)
13661354
{
13671355
struct brcm_pcie *pcie = dev_get_drvdata(dev);
1368-
struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
13691356
int ret;
13701357

13711358
brcm_pcie_turn_off(pcie);
@@ -1384,22 +1371,11 @@ static int brcm_pcie_suspend(struct device *dev)
13841371
}
13851372

13861373
if (pcie->sr) {
1387-
/*
1388-
* Now turn off the regulators, but if at least one
1389-
* downstream device is enabled as a wake-up source, do not
1390-
* turn off regulators.
1391-
*/
1392-
pcie->ep_wakeup_capable = false;
1393-
pci_walk_bus(bridge->bus, pci_dev_may_wakeup,
1394-
&pcie->ep_wakeup_capable);
1395-
if (!pcie->ep_wakeup_capable) {
1396-
ret = regulator_bulk_disable(pcie->sr->num_supplies,
1397-
pcie->sr->supplies);
1398-
if (ret) {
1399-
dev_err(dev, "Could not turn off regulators\n");
1400-
reset_control_reset(pcie->rescal);
1401-
return ret;
1402-
}
1374+
ret = regulator_bulk_disable(pcie->sr->num_supplies, pcie->sr->supplies);
1375+
if (ret) {
1376+
dev_err(dev, "Could not turn off regulators\n");
1377+
reset_control_reset(pcie->rescal);
1378+
return ret;
14031379
}
14041380
}
14051381
clk_disable_unprepare(pcie->clk);
@@ -1420,21 +1396,10 @@ static int brcm_pcie_resume(struct device *dev)
14201396
return ret;
14211397

14221398
if (pcie->sr) {
1423-
if (pcie->ep_wakeup_capable) {
1424-
/*
1425-
* We are resuming from a suspend. In the suspend we
1426-
* did not disable the power supplies, so there is
1427-
* no need to enable them (and falsely increase their
1428-
* usage count).
1429-
*/
1430-
pcie->ep_wakeup_capable = false;
1431-
} else {
1432-
ret = regulator_bulk_enable(pcie->sr->num_supplies,
1433-
pcie->sr->supplies);
1434-
if (ret) {
1435-
dev_err(dev, "Could not turn on regulators\n");
1436-
goto err_disable_clk;
1437-
}
1399+
ret = regulator_bulk_enable(pcie->sr->num_supplies, pcie->sr->supplies);
1400+
if (ret) {
1401+
dev_err(dev, "Could not turn on regulators\n");
1402+
goto err_disable_clk;
14381403
}
14391404
}
14401405

0 commit comments

Comments
 (0)