Merge tag 'pci-v6.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci

Pull PCI fixes from Bjorn Helgaas:

- Remove ASPM L0s support for MSM8996 SoC since we now enable L0s when
advertised, and it caused random hangs on this device (Manivannan
Sadhasivam)

- Fix meson-pcie to report that the link is up while in ASPM L0s or L1,
since those are active states from the software point of view, and
treating the link as down caused config access failures (Bjorn
Helgaas)

- Fix up sparc DTS BAR descriptions that are above 4GB but not marked
as prefetchable, which caused resource assignment and driver probe
failures after we converted from the SPARC pcibios_enable_device() to
the generic version (Ilpo Järvinen)

* tag 'pci-v6.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
sparc/PCI: Correct 64-bit non-pref -> pref BAR resources
PCI: meson: Report that link is up while in ASPM L0s and L1 states
PCI: qcom: Remove ASPM L0s support for MSM8996 SoC

Changed files
+29 -35
arch
sparc
kernel
drivers
pci
controller
+23
arch/sparc/kernel/pci.c
··· 181 182 __setup("ofpci_debug=", ofpci_debug); 183 184 static unsigned long pci_parse_of_flags(u32 addr0) 185 { 186 unsigned long flags = 0; ··· 266 res->end = op_res->end; 267 res->flags = flags; 268 res->name = pci_name(dev); 269 270 pci_info(dev, "reg 0x%x: %pR\n", i, res); 271 }
··· 181 182 __setup("ofpci_debug=", ofpci_debug); 183 184 + static void of_fixup_pci_pref(struct pci_dev *dev, int index, 185 + struct resource *res) 186 + { 187 + struct pci_bus_region region; 188 + 189 + if (!(res->flags & IORESOURCE_MEM_64)) 190 + return; 191 + 192 + if (!resource_size(res)) 193 + return; 194 + 195 + pcibios_resource_to_bus(dev->bus, &region, res); 196 + if (region.end <= ~((u32)0)) 197 + return; 198 + 199 + if (!(res->flags & IORESOURCE_PREFETCH)) { 200 + res->flags |= IORESOURCE_PREFETCH; 201 + pci_info(dev, "reg 0x%x: fixup: pref added to 64-bit resource\n", 202 + index); 203 + } 204 + } 205 + 206 static unsigned long pci_parse_of_flags(u32 addr0) 207 { 208 unsigned long flags = 0; ··· 244 res->end = op_res->end; 245 res->flags = flags; 246 res->name = pci_name(dev); 247 + of_fixup_pci_pref(dev, i, res); 248 249 pci_info(dev, "reg 0x%x: %pR\n", i, res); 250 }
+3 -34
drivers/pci/controller/dwc/pci-meson.c
··· 37 #define PCIE_CFG_STATUS17 0x44 38 #define PM_CURRENT_STATE(x) (((x) >> 7) & 0x1) 39 40 - #define WAIT_LINKUP_TIMEOUT 4000 41 #define PORT_CLK_RATE 100000000UL 42 #define MAX_PAYLOAD_SIZE 256 43 #define MAX_READ_REQ_SIZE 256 ··· 349 static bool meson_pcie_link_up(struct dw_pcie *pci) 350 { 351 struct meson_pcie *mp = to_meson_pcie(pci); 352 - struct device *dev = pci->dev; 353 - u32 speed_okay = 0; 354 - u32 cnt = 0; 355 - u32 state12, state17, smlh_up, ltssm_up, rdlh_up; 356 357 - do { 358 - state12 = meson_cfg_readl(mp, PCIE_CFG_STATUS12); 359 - state17 = meson_cfg_readl(mp, PCIE_CFG_STATUS17); 360 - smlh_up = IS_SMLH_LINK_UP(state12); 361 - rdlh_up = IS_RDLH_LINK_UP(state12); 362 - ltssm_up = IS_LTSSM_UP(state12); 363 - 364 - if (PM_CURRENT_STATE(state17) < PCIE_GEN3) 365 - speed_okay = 1; 366 - 367 - if (smlh_up) 368 - dev_dbg(dev, "smlh_link_up is on\n"); 369 - if (rdlh_up) 370 - dev_dbg(dev, "rdlh_link_up is on\n"); 371 - if (ltssm_up) 372 - dev_dbg(dev, "ltssm_up is on\n"); 373 - if (speed_okay) 374 - dev_dbg(dev, "speed_okay\n"); 375 - 376 - if (smlh_up && rdlh_up && ltssm_up && speed_okay) 377 - return true; 378 - 379 - cnt++; 380 - 381 - udelay(10); 382 - } while (cnt < WAIT_LINKUP_TIMEOUT); 383 - 384 - dev_err(dev, "error: wait linkup timeout\n"); 385 - return false; 386 } 387 388 static int meson_pcie_host_init(struct dw_pcie_rp *pp)
··· 37 #define PCIE_CFG_STATUS17 0x44 38 #define PM_CURRENT_STATE(x) (((x) >> 7) & 0x1) 39 40 #define PORT_CLK_RATE 100000000UL 41 #define MAX_PAYLOAD_SIZE 256 42 #define MAX_READ_REQ_SIZE 256 ··· 350 static bool meson_pcie_link_up(struct dw_pcie *pci) 351 { 352 struct meson_pcie *mp = to_meson_pcie(pci); 353 + u32 state12; 354 355 + state12 = meson_cfg_readl(mp, PCIE_CFG_STATUS12); 356 + return IS_SMLH_LINK_UP(state12) && IS_RDLH_LINK_UP(state12); 357 } 358 359 static int meson_pcie_host_init(struct dw_pcie_rp *pp)
+3 -1
drivers/pci/controller/dwc/pcie-qcom.c
··· 1047 writel(WR_NO_SNOOP_OVERRIDE_EN | RD_NO_SNOOP_OVERRIDE_EN, 1048 pcie->parf + PARF_NO_SNOOP_OVERRIDE); 1049 1050 - qcom_pcie_clear_aspm_l0s(pcie->pci); 1051 qcom_pcie_clear_hpc(pcie->pci); 1052 1053 return 0; ··· 1315 goto err_disable_phy; 1316 } 1317 1318 qcom_ep_reset_deassert(pcie); 1319 1320 if (pcie->cfg->ops->config_sid) { ··· 1465 1466 static const struct qcom_pcie_cfg cfg_2_3_2 = { 1467 .ops = &ops_2_3_2, 1468 }; 1469 1470 static const struct qcom_pcie_cfg cfg_2_3_3 = {
··· 1047 writel(WR_NO_SNOOP_OVERRIDE_EN | RD_NO_SNOOP_OVERRIDE_EN, 1048 pcie->parf + PARF_NO_SNOOP_OVERRIDE); 1049 1050 qcom_pcie_clear_hpc(pcie->pci); 1051 1052 return 0; ··· 1316 goto err_disable_phy; 1317 } 1318 1319 + qcom_pcie_clear_aspm_l0s(pcie->pci); 1320 + 1321 qcom_ep_reset_deassert(pcie); 1322 1323 if (pcie->cfg->ops->config_sid) { ··· 1464 1465 static const struct qcom_pcie_cfg cfg_2_3_2 = { 1466 .ops = &ops_2_3_2, 1467 + .no_l0s = true, 1468 }; 1469 1470 static const struct qcom_pcie_cfg cfg_2_3_3 = {