Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'pci-v5.19-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull pci fixes from Bjorn Helgaas:

- Revert brcmstb patches that broke booting on Raspberry Pi Compute
Module 4 (Bjorn Helgaas)

- Fix bridge_d3_blacklist[] error that overwrote the existing Gigabyte
X299 entry instead of adding a new one (Bjorn Helgaas)

- Update Lorenzo Pieralisi's email address in MAINTAINERS (Lorenzo
Pieralisi)

* tag 'pci-v5.19-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
MAINTAINERS: Update Lorenzo Pieralisi's email address
PCI/PM: Fix bridge_d3_blacklist[] Elo i2 overwrite of Gigabyte X299
Revert "PCI: brcmstb: Split brcm_pcie_setup() into two funcs"
Revert "PCI: brcmstb: Add mechanism to turn on subdev regulators"
Revert "PCI: brcmstb: Add control of subdevice voltage regulators"
Revert "PCI: brcmstb: Do not turn off WOL regulators on suspend"

+41 -235
+1
.mailmap
··· 236 236 <linux-hardening@vger.kernel.org> <kernel-hardening@lists.openwall.com> 237 237 Li Yang <leoyang.li@nxp.com> <leoli@freescale.com> 238 238 Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org> 239 + Lorenzo Pieralisi <lpieralisi@kernel.org> <lorenzo.pieralisi@arm.com> 239 240 Lukasz Luba <lukasz.luba@arm.com> <l.luba@partner.samsung.com> 240 241 Maciej W. Rozycki <macro@mips.com> <macro@imgtec.com> 241 242 Maciej W. Rozycki <macro@orcam.me.uk> <macro@linux-mips.org>
+8 -8
MAINTAINERS
··· 382 382 F: tools/power/acpi/ 383 383 384 384 ACPI FOR ARM64 (ACPI/arm64) 385 - M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 385 + M: Lorenzo Pieralisi <lpieralisi@kernel.org> 386 386 M: Hanjun Guo <guohanjun@huawei.com> 387 387 M: Sudeep Holla <sudeep.holla@arm.com> 388 388 L: linux-acpi@vger.kernel.org ··· 2940 2940 ARM/VERSATILE EXPRESS PLATFORM 2941 2941 M: Liviu Dudau <liviu.dudau@arm.com> 2942 2942 M: Sudeep Holla <sudeep.holla@arm.com> 2943 - M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 2943 + M: Lorenzo Pieralisi <lpieralisi@kernel.org> 2944 2944 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2945 2945 S: Maintained 2946 2946 F: */*/*/vexpress* ··· 5156 5156 F: arch/x86/kernel/msr.c 5157 5157 5158 5158 CPUIDLE DRIVER - ARM BIG LITTLE 5159 - M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 5159 + M: Lorenzo Pieralisi <lpieralisi@kernel.org> 5160 5160 M: Daniel Lezcano <daniel.lezcano@linaro.org> 5161 5161 L: linux-pm@vger.kernel.org 5162 5162 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) ··· 5176 5176 F: include/linux/platform_data/cpuidle-exynos.h 5177 5177 5178 5178 CPUIDLE DRIVER - ARM PSCI 5179 - M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 5179 + M: Lorenzo Pieralisi <lpieralisi@kernel.org> 5180 5180 M: Sudeep Holla <sudeep.holla@arm.com> 5181 5181 L: linux-pm@vger.kernel.org 5182 5182 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) ··· 15282 15282 15283 15283 PCI ENDPOINT SUBSYSTEM 15284 15284 M: Kishon Vijay Abraham I <kishon@ti.com> 15285 - M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 15285 + M: Lorenzo Pieralisi <lpieralisi@kernel.org> 15286 15286 R: Krzysztof Wilczyński <kw@linux.com> 15287 15287 L: linux-pci@vger.kernel.org 15288 15288 S: Supported ··· 15345 15345 F: drivers/pci/controller/pci-xgene-msi.c 15346 15346 15347 15347 PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS 15348 - M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 15348 + M: Lorenzo Pieralisi <lpieralisi@kernel.org> 15349 15349 R: Rob Herring <robh@kernel.org> 15350 15350 R: Krzysztof Wilczyński <kw@linux.com> 15351 15351 L: linux-pci@vger.kernel.org ··· 15898 15898 15899 15899 POWER STATE COORDINATION INTERFACE (PSCI) 15900 15900 M: Mark Rutland <mark.rutland@arm.com> 15901 - M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 15901 + M: Lorenzo Pieralisi <lpieralisi@kernel.org> 15902 15902 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 15903 15903 S: Maintained 15904 15904 F: drivers/firmware/psci/ ··· 18285 18285 18286 18286 SECURE MONITOR CALL(SMC) CALLING CONVENTION (SMCCC) 18287 18287 M: Mark Rutland <mark.rutland@arm.com> 18288 - M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 18288 + M: Lorenzo Pieralisi <lpieralisi@kernel.org> 18289 18289 M: Sudeep Holla <sudeep.holla@arm.com> 18290 18290 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 18291 18291 S: Maintained
+30 -227
drivers/pci/controller/pcie-brcmstb.c
··· 24 24 #include <linux/pci.h> 25 25 #include <linux/pci-ecam.h> 26 26 #include <linux/printk.h> 27 - #include <linux/regulator/consumer.h> 28 27 #include <linux/reset.h> 29 28 #include <linux/sizes.h> 30 29 #include <linux/slab.h> ··· 195 196 static inline void brcm_pcie_perst_set_4908(struct brcm_pcie *pcie, u32 val); 196 197 static inline void brcm_pcie_perst_set_7278(struct brcm_pcie *pcie, u32 val); 197 198 static inline void brcm_pcie_perst_set_generic(struct brcm_pcie *pcie, u32 val); 198 - static int brcm_pcie_linkup(struct brcm_pcie *pcie); 199 - static int brcm_pcie_add_bus(struct pci_bus *bus); 200 199 201 200 enum { 202 201 RGR1_SW_INIT_1, ··· 283 286 .bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic, 284 287 }; 285 288 286 - struct subdev_regulators { 287 - unsigned int num_supplies; 288 - struct regulator_bulk_data supplies[]; 289 - }; 290 - 291 - static int pci_subdev_regulators_add_bus(struct pci_bus *bus); 292 - static void pci_subdev_regulators_remove_bus(struct pci_bus *bus); 293 - 294 289 struct brcm_msi { 295 290 struct device *dev; 296 291 void __iomem *base; ··· 320 331 u32 hw_rev; 321 332 void (*perst_set)(struct brcm_pcie *pcie, u32 val); 322 333 void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val); 323 - bool refusal_mode; 324 - struct subdev_regulators *sr; 325 - bool ep_wakeup_capable; 326 334 }; 327 335 328 336 static inline bool is_bmips(const struct brcm_pcie *pcie) ··· 434 448 pll = FIELD_GET(SSC_STATUS_PLL_LOCK_MASK, tmp); 435 449 436 450 return ssc && pll ? 0 : -EIO; 437 - } 438 - 439 - static void *alloc_subdev_regulators(struct device *dev) 440 - { 441 - static const char * const supplies[] = { 442 - "vpcie3v3", 443 - "vpcie3v3aux", 444 - "vpcie12v", 445 - }; 446 - const size_t size = sizeof(struct subdev_regulators) 447 - + sizeof(struct regulator_bulk_data) * ARRAY_SIZE(supplies); 448 - struct subdev_regulators *sr; 449 - int i; 450 - 451 - sr = devm_kzalloc(dev, size, GFP_KERNEL); 452 - if (sr) { 453 - sr->num_supplies = ARRAY_SIZE(supplies); 454 - for (i = 0; i < ARRAY_SIZE(supplies); i++) 455 - sr->supplies[i].supply = supplies[i]; 456 - } 457 - 458 - return sr; 459 - } 460 - 461 - static int pci_subdev_regulators_add_bus(struct pci_bus *bus) 462 - { 463 - struct device *dev = &bus->dev; 464 - struct subdev_regulators *sr; 465 - int ret; 466 - 467 - if (!dev->of_node || !bus->parent || !pci_is_root_bus(bus->parent)) 468 - return 0; 469 - 470 - if (dev->driver_data) 471 - dev_err(dev, "dev.driver_data unexpectedly non-NULL\n"); 472 - 473 - sr = alloc_subdev_regulators(dev); 474 - if (!sr) 475 - return -ENOMEM; 476 - 477 - dev->driver_data = sr; 478 - ret = regulator_bulk_get(dev, sr->num_supplies, sr->supplies); 479 - if (ret) 480 - return ret; 481 - 482 - ret = regulator_bulk_enable(sr->num_supplies, sr->supplies); 483 - if (ret) { 484 - dev_err(dev, "failed to enable regulators for downstream device\n"); 485 - return ret; 486 - } 487 - 488 - return 0; 489 - } 490 - 491 - static int brcm_pcie_add_bus(struct pci_bus *bus) 492 - { 493 - struct device *dev = &bus->dev; 494 - struct brcm_pcie *pcie = (struct brcm_pcie *) bus->sysdata; 495 - int ret; 496 - 497 - if (!dev->of_node || !bus->parent || !pci_is_root_bus(bus->parent)) 498 - return 0; 499 - 500 - ret = pci_subdev_regulators_add_bus(bus); 501 - if (ret) 502 - return ret; 503 - 504 - /* Grab the regulators for suspend/resume */ 505 - pcie->sr = bus->dev.driver_data; 506 - 507 - /* 508 - * If we have failed linkup there is no point to return an error as 509 - * currently it will cause a WARNING() from pci_alloc_child_bus(). 510 - * We return 0 and turn on the "refusal_mode" so that any further 511 - * accesses to the pci_dev just get 0xffffffff 512 - */ 513 - if (brcm_pcie_linkup(pcie) != 0) 514 - pcie->refusal_mode = true; 515 - 516 - return 0; 517 - } 518 - 519 - static void pci_subdev_regulators_remove_bus(struct pci_bus *bus) 520 - { 521 - struct device *dev = &bus->dev; 522 - struct subdev_regulators *sr = dev->driver_data; 523 - 524 - if (!sr || !bus->parent || !pci_is_root_bus(bus->parent)) 525 - return; 526 - 527 - if (regulator_bulk_disable(sr->num_supplies, sr->supplies)) 528 - dev_err(dev, "failed to disable regulators for downstream device\n"); 529 - dev->driver_data = NULL; 530 451 } 531 452 532 453 /* Limits operation to a specific generation (1, 2, or 3) */ ··· 751 858 /* Accesses to the RC go right to the RC registers if slot==0 */ 752 859 if (pci_is_root_bus(bus)) 753 860 return PCI_SLOT(devfn) ? NULL : base + where; 754 - if (pcie->refusal_mode) { 755 - /* 756 - * At this point we do not have link. There will be a CPU 757 - * abort -- a quirk with this controller --if Linux tries 758 - * to read any config-space registers besides those 759 - * targeting the host bridge. To prevent this we hijack 760 - * the address to point to a safe access that will return 761 - * 0xffffffff. 762 - */ 763 - writel(0xffffffff, base + PCIE_MISC_RC_BAR2_CONFIG_HI); 764 - return base + PCIE_MISC_RC_BAR2_CONFIG_HI + (where & 0x3); 765 - } 766 861 767 862 /* For devices, write to the config space index register */ 768 863 idx = PCIE_ECAM_OFFSET(bus->number, devfn, 0); ··· 779 898 .map_bus = brcm_pcie_map_conf, 780 899 .read = pci_generic_config_read, 781 900 .write = pci_generic_config_write, 782 - .add_bus = brcm_pcie_add_bus, 783 - .remove_bus = pci_subdev_regulators_remove_bus, 784 901 }; 785 902 786 903 static struct pci_ops brcm_pcie_ops32 = { ··· 926 1047 927 1048 static int brcm_pcie_setup(struct brcm_pcie *pcie) 928 1049 { 1050 + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); 929 1051 u64 rc_bar2_offset, rc_bar2_size; 930 1052 void __iomem *base = pcie->base; 931 - int ret, memc; 1053 + struct device *dev = pcie->dev; 1054 + struct resource_entry *entry; 1055 + bool ssc_good = false; 1056 + struct resource *res; 1057 + int num_out_wins = 0; 1058 + u16 nlw, cls, lnksta; 1059 + int i, ret, memc; 932 1060 u32 tmp, burst, aspm_support; 933 1061 934 1062 /* Reset the bridge */ ··· 1025 1139 if (pcie->gen) 1026 1140 brcm_pcie_set_gen(pcie, pcie->gen); 1027 1141 1028 - /* Don't advertise L0s capability if 'aspm-no-l0s' */ 1029 - aspm_support = PCIE_LINK_STATE_L1; 1030 - if (!of_property_read_bool(pcie->np, "aspm-no-l0s")) 1031 - aspm_support |= PCIE_LINK_STATE_L0S; 1032 - tmp = readl(base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY); 1033 - u32p_replace_bits(&tmp, aspm_support, 1034 - PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_MASK); 1035 - writel(tmp, base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY); 1036 - 1037 - /* 1038 - * For config space accesses on the RC, show the right class for 1039 - * a PCIe-PCIe bridge (the default setting is to be EP mode). 1040 - */ 1041 - tmp = readl(base + PCIE_RC_CFG_PRIV1_ID_VAL3); 1042 - u32p_replace_bits(&tmp, 0x060400, 1043 - PCIE_RC_CFG_PRIV1_ID_VAL3_CLASS_CODE_MASK); 1044 - writel(tmp, base + PCIE_RC_CFG_PRIV1_ID_VAL3); 1045 - 1046 - return 0; 1047 - } 1048 - 1049 - static int brcm_pcie_linkup(struct brcm_pcie *pcie) 1050 - { 1051 - struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); 1052 - struct device *dev = pcie->dev; 1053 - void __iomem *base = pcie->base; 1054 - struct resource_entry *entry; 1055 - struct resource *res; 1056 - int num_out_wins = 0; 1057 - u16 nlw, cls, lnksta; 1058 - bool ssc_good = false; 1059 - u32 tmp; 1060 - int ret, i; 1061 - 1062 1142 /* Unassert the fundamental reset */ 1063 1143 pcie->perst_set(pcie, 0); 1064 1144 ··· 1074 1222 resource_size(res)); 1075 1223 num_out_wins++; 1076 1224 } 1225 + 1226 + /* Don't advertise L0s capability if 'aspm-no-l0s' */ 1227 + aspm_support = PCIE_LINK_STATE_L1; 1228 + if (!of_property_read_bool(pcie->np, "aspm-no-l0s")) 1229 + aspm_support |= PCIE_LINK_STATE_L0S; 1230 + tmp = readl(base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY); 1231 + u32p_replace_bits(&tmp, aspm_support, 1232 + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_MASK); 1233 + writel(tmp, base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY); 1234 + 1235 + /* 1236 + * For config space accesses on the RC, show the right class for 1237 + * a PCIe-PCIe bridge (the default setting is to be EP mode). 1238 + */ 1239 + tmp = readl(base + PCIE_RC_CFG_PRIV1_ID_VAL3); 1240 + u32p_replace_bits(&tmp, 0x060400, 1241 + PCIE_RC_CFG_PRIV1_ID_VAL3_CLASS_CODE_MASK); 1242 + writel(tmp, base + PCIE_RC_CFG_PRIV1_ID_VAL3); 1077 1243 1078 1244 if (pcie->ssc) { 1079 1245 ret = brcm_pcie_set_ssc(pcie); ··· 1221 1351 pcie->bridge_sw_init_set(pcie, 1); 1222 1352 } 1223 1353 1224 - static int pci_dev_may_wakeup(struct pci_dev *dev, void *data) 1225 - { 1226 - bool *ret = data; 1227 - 1228 - if (device_may_wakeup(&dev->dev)) { 1229 - *ret = true; 1230 - dev_info(&dev->dev, "disable cancelled for wake-up device\n"); 1231 - } 1232 - return (int) *ret; 1233 - } 1234 - 1235 1354 static int brcm_pcie_suspend(struct device *dev) 1236 1355 { 1237 1356 struct brcm_pcie *pcie = dev_get_drvdata(dev); 1238 - struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); 1239 1357 int ret; 1240 1358 1241 1359 brcm_pcie_turn_off(pcie); ··· 1241 1383 return ret; 1242 1384 } 1243 1385 1244 - if (pcie->sr) { 1245 - /* 1246 - * Now turn off the regulators, but if at least one 1247 - * downstream device is enabled as a wake-up source, do not 1248 - * turn off regulators. 1249 - */ 1250 - pcie->ep_wakeup_capable = false; 1251 - pci_walk_bus(bridge->bus, pci_dev_may_wakeup, 1252 - &pcie->ep_wakeup_capable); 1253 - if (!pcie->ep_wakeup_capable) { 1254 - ret = regulator_bulk_disable(pcie->sr->num_supplies, 1255 - pcie->sr->supplies); 1256 - if (ret) { 1257 - dev_err(dev, "Could not turn off regulators\n"); 1258 - reset_control_reset(pcie->rescal); 1259 - return ret; 1260 - } 1261 - } 1262 - } 1263 1386 clk_disable_unprepare(pcie->clk); 1264 1387 1265 1388 return 0; ··· 1258 1419 if (ret) 1259 1420 return ret; 1260 1421 1261 - if (pcie->sr) { 1262 - if (pcie->ep_wakeup_capable) { 1263 - /* 1264 - * We are resuming from a suspend. In the suspend we 1265 - * did not disable the power supplies, so there is 1266 - * no need to enable them (and falsely increase their 1267 - * usage count). 1268 - */ 1269 - pcie->ep_wakeup_capable = false; 1270 - } else { 1271 - ret = regulator_bulk_enable(pcie->sr->num_supplies, 1272 - pcie->sr->supplies); 1273 - if (ret) { 1274 - dev_err(dev, "Could not turn on regulators\n"); 1275 - goto err_disable_clk; 1276 - } 1277 - } 1278 - } 1279 - 1280 1422 ret = reset_control_reset(pcie->rescal); 1281 1423 if (ret) 1282 - goto err_regulator; 1424 + goto err_disable_clk; 1283 1425 1284 1426 ret = brcm_phy_start(pcie); 1285 1427 if (ret) ··· 1281 1461 if (ret) 1282 1462 goto err_reset; 1283 1463 1284 - ret = brcm_pcie_linkup(pcie); 1285 - if (ret) 1286 - goto err_reset; 1287 - 1288 1464 if (pcie->msi) 1289 1465 brcm_msi_set_regs(pcie->msi); 1290 1466 ··· 1288 1472 1289 1473 err_reset: 1290 1474 reset_control_rearm(pcie->rescal); 1291 - err_regulator: 1292 - if (pcie->sr) 1293 - regulator_bulk_disable(pcie->sr->num_supplies, pcie->sr->supplies); 1294 1475 err_disable_clk: 1295 1476 clk_disable_unprepare(pcie->clk); 1296 1477 return ret; ··· 1419 1606 1420 1607 platform_set_drvdata(pdev, pcie); 1421 1608 1422 - ret = pci_host_probe(bridge); 1423 - if (!ret && !brcm_pcie_link_up(pcie)) 1424 - ret = -ENODEV; 1425 - 1426 - if (ret) { 1427 - brcm_pcie_remove(pdev); 1428 - return ret; 1429 - } 1430 - 1431 - return 0; 1432 - 1609 + return pci_host_probe(bridge); 1433 1610 fail: 1434 1611 __brcm_pcie_remove(pcie); 1435 1612 return ret; ··· 1428 1625 MODULE_DEVICE_TABLE(of, brcm_pcie_match); 1429 1626 1430 1627 static const struct dev_pm_ops brcm_pcie_pm_ops = { 1431 - .suspend_noirq = brcm_pcie_suspend, 1432 - .resume_noirq = brcm_pcie_resume, 1628 + .suspend = brcm_pcie_suspend, 1629 + .resume = brcm_pcie_resume, 1433 1630 }; 1434 1631 1435 1632 static struct platform_driver brcm_pcie_driver = {
+2
drivers/pci/pci.c
··· 2967 2967 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."), 2968 2968 DMI_MATCH(DMI_BOARD_NAME, "X299 DESIGNARE EX-CF"), 2969 2969 }, 2970 + }, 2971 + { 2970 2972 /* 2971 2973 * Downstream device is not accessible after putting a root port 2972 2974 * into D3cold and back into D0 on Elo i2.