Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 420be2f

Browse files
committed
Revert "PCI: brcmstb: Add mechanism to turn on subdev regulators"
This reverts commit 67211aa. 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/[email protected] Reported-by: Cyril Brulebois <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 2129426 commit 420be2f

File tree

1 file changed

+0
-76
lines changed

1 file changed

+0
-76
lines changed

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <linux/pci.h>
2525
#include <linux/pci-ecam.h>
2626
#include <linux/printk.h>
27-
#include <linux/regulator/consumer.h>
2827
#include <linux/reset.h>
2928
#include <linux/sizes.h>
3029
#include <linux/slab.h>
@@ -284,14 +283,6 @@ static const struct pcie_cfg_data bcm2711_cfg = {
284283
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
285284
};
286285

287-
struct subdev_regulators {
288-
unsigned int num_supplies;
289-
struct regulator_bulk_data supplies[];
290-
};
291-
292-
static int pci_subdev_regulators_add_bus(struct pci_bus *bus);
293-
static void pci_subdev_regulators_remove_bus(struct pci_bus *bus);
294-
295286
struct brcm_msi {
296287
struct device *dev;
297288
void __iomem *base;
@@ -445,71 +436,6 @@ static int brcm_pcie_set_ssc(struct brcm_pcie *pcie)
445436
return ssc && pll ? 0 : -EIO;
446437
}
447438

448-
static void *alloc_subdev_regulators(struct device *dev)
449-
{
450-
static const char * const supplies[] = {
451-
"vpcie3v3",
452-
"vpcie3v3aux",
453-
"vpcie12v",
454-
};
455-
const size_t size = sizeof(struct subdev_regulators)
456-
+ sizeof(struct regulator_bulk_data) * ARRAY_SIZE(supplies);
457-
struct subdev_regulators *sr;
458-
int i;
459-
460-
sr = devm_kzalloc(dev, size, GFP_KERNEL);
461-
if (sr) {
462-
sr->num_supplies = ARRAY_SIZE(supplies);
463-
for (i = 0; i < ARRAY_SIZE(supplies); i++)
464-
sr->supplies[i].supply = supplies[i];
465-
}
466-
467-
return sr;
468-
}
469-
470-
static int pci_subdev_regulators_add_bus(struct pci_bus *bus)
471-
{
472-
struct device *dev = &bus->dev;
473-
struct subdev_regulators *sr;
474-
int ret;
475-
476-
if (!dev->of_node || !bus->parent || !pci_is_root_bus(bus->parent))
477-
return 0;
478-
479-
if (dev->driver_data)
480-
dev_err(dev, "dev.driver_data unexpectedly non-NULL\n");
481-
482-
sr = alloc_subdev_regulators(dev);
483-
if (!sr)
484-
return -ENOMEM;
485-
486-
dev->driver_data = sr;
487-
ret = regulator_bulk_get(dev, sr->num_supplies, sr->supplies);
488-
if (ret)
489-
return ret;
490-
491-
ret = regulator_bulk_enable(sr->num_supplies, sr->supplies);
492-
if (ret) {
493-
dev_err(dev, "failed to enable regulators for downstream device\n");
494-
return ret;
495-
}
496-
497-
return 0;
498-
}
499-
500-
static void pci_subdev_regulators_remove_bus(struct pci_bus *bus)
501-
{
502-
struct device *dev = &bus->dev;
503-
struct subdev_regulators *sr = dev->driver_data;
504-
505-
if (!sr || !bus->parent || !pci_is_root_bus(bus->parent))
506-
return;
507-
508-
if (regulator_bulk_disable(sr->num_supplies, sr->supplies))
509-
dev_err(dev, "failed to disable regulators for downstream device\n");
510-
dev->driver_data = NULL;
511-
}
512-
513439
/* Limits operation to a specific generation (1, 2, or 3) */
514440
static void brcm_pcie_set_gen(struct brcm_pcie *pcie, int gen)
515441
{
@@ -853,8 +779,6 @@ static struct pci_ops brcm_pcie_ops = {
853779
.map_bus = brcm_pcie_map_conf,
854780
.read = pci_generic_config_read,
855781
.write = pci_generic_config_write,
856-
.add_bus = pci_subdev_regulators_add_bus,
857-
.remove_bus = pci_subdev_regulators_remove_bus,
858782
};
859783

860784
static struct pci_ops brcm_pcie_ops32 = {

0 commit comments

Comments
 (0)