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

Skip to content

Commit f4fd559

Browse files
committed
Revert "PCI: brcmstb: Split brcm_pcie_setup() into two funcs"
This reverts commit 830aa6f. 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 420be2f commit f4fd559

File tree

1 file changed

+26
-39
lines changed

1 file changed

+26
-39
lines changed

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -926,9 +926,16 @@ static inline int brcm_pcie_get_rc_bar2_size_and_offset(struct brcm_pcie *pcie,
926926

927927
static int brcm_pcie_setup(struct brcm_pcie *pcie)
928928
{
929+
struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
929930
u64 rc_bar2_offset, rc_bar2_size;
930931
void __iomem *base = pcie->base;
931-
int ret, memc;
932+
struct device *dev = pcie->dev;
933+
struct resource_entry *entry;
934+
bool ssc_good = false;
935+
struct resource *res;
936+
int num_out_wins = 0;
937+
u16 nlw, cls, lnksta;
938+
int i, ret, memc;
932939
u32 tmp, burst, aspm_support;
933940

934941
/* Reset the bridge */
@@ -1018,40 +1025,6 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
10181025
if (pcie->gen)
10191026
brcm_pcie_set_gen(pcie, pcie->gen);
10201027

1021-
/* Don't advertise L0s capability if 'aspm-no-l0s' */
1022-
aspm_support = PCIE_LINK_STATE_L1;
1023-
if (!of_property_read_bool(pcie->np, "aspm-no-l0s"))
1024-
aspm_support |= PCIE_LINK_STATE_L0S;
1025-
tmp = readl(base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY);
1026-
u32p_replace_bits(&tmp, aspm_support,
1027-
PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_MASK);
1028-
writel(tmp, base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY);
1029-
1030-
/*
1031-
* For config space accesses on the RC, show the right class for
1032-
* a PCIe-PCIe bridge (the default setting is to be EP mode).
1033-
*/
1034-
tmp = readl(base + PCIE_RC_CFG_PRIV1_ID_VAL3);
1035-
u32p_replace_bits(&tmp, 0x060400,
1036-
PCIE_RC_CFG_PRIV1_ID_VAL3_CLASS_CODE_MASK);
1037-
writel(tmp, base + PCIE_RC_CFG_PRIV1_ID_VAL3);
1038-
1039-
return 0;
1040-
}
1041-
1042-
static int brcm_pcie_linkup(struct brcm_pcie *pcie)
1043-
{
1044-
struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
1045-
struct device *dev = pcie->dev;
1046-
void __iomem *base = pcie->base;
1047-
struct resource_entry *entry;
1048-
struct resource *res;
1049-
int num_out_wins = 0;
1050-
u16 nlw, cls, lnksta;
1051-
bool ssc_good = false;
1052-
u32 tmp;
1053-
int ret, i;
1054-
10551028
/* Unassert the fundamental reset */
10561029
pcie->perst_set(pcie, 0);
10571030

@@ -1102,6 +1075,24 @@ static int brcm_pcie_linkup(struct brcm_pcie *pcie)
11021075
num_out_wins++;
11031076
}
11041077

1078+
/* Don't advertise L0s capability if 'aspm-no-l0s' */
1079+
aspm_support = PCIE_LINK_STATE_L1;
1080+
if (!of_property_read_bool(pcie->np, "aspm-no-l0s"))
1081+
aspm_support |= PCIE_LINK_STATE_L0S;
1082+
tmp = readl(base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY);
1083+
u32p_replace_bits(&tmp, aspm_support,
1084+
PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_MASK);
1085+
writel(tmp, base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY);
1086+
1087+
/*
1088+
* For config space accesses on the RC, show the right class for
1089+
* a PCIe-PCIe bridge (the default setting is to be EP mode).
1090+
*/
1091+
tmp = readl(base + PCIE_RC_CFG_PRIV1_ID_VAL3);
1092+
u32p_replace_bits(&tmp, 0x060400,
1093+
PCIE_RC_CFG_PRIV1_ID_VAL3_CLASS_CODE_MASK);
1094+
writel(tmp, base + PCIE_RC_CFG_PRIV1_ID_VAL3);
1095+
11051096
if (pcie->ssc) {
11061097
ret = brcm_pcie_set_ssc(pcie);
11071098
if (ret == 0)
@@ -1290,10 +1281,6 @@ static int brcm_pcie_resume(struct device *dev)
12901281
if (ret)
12911282
goto err_reset;
12921283

1293-
ret = brcm_pcie_linkup(pcie);
1294-
if (ret)
1295-
goto err_reset;
1296-
12971284
if (pcie->msi)
12981285
brcm_msi_set_regs(pcie->msi);
12991286

0 commit comments

Comments
 (0)