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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pci-v4.18-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:

- Fix a use-after-free in the endpoint code (Dan Carpenter)

- Stop defaulting CONFIG_PCIE_DW_PLAT_HOST to yes (Geert Uytterhoeven)

- Fix an nfp regression caused by a change in how we limit the number
of VFs we can enable (Jakub Kicinski)

- Fix failure path cleanup issues in the new R-Car gen3 PHY support
(Marek Vasut)

- Fix leaks of OF nodes in faraday, xilinx-nwl, xilinx (Nicholas Mc
Guire)

* tag 'pci-v4.18-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
nfp: stop limiting VFs to 0
PCI/IOV: Reset total_VFs limit after detaching PF driver
PCI: faraday: Add missing of_node_put()
PCI: xilinx-nwl: Add missing of_node_put()
PCI: xilinx: Add missing of_node_put()
PCI: endpoint: Use after free in pci_epf_unregister_driver()
PCI: controller: dwc: Do not let PCIE_DW_PLAT_HOST default to yes
PCI: rcar: Clean up PHY init on failure
PCI: rcar: Shut the PHY down in failpath

+41 -12
+1 -5
drivers/net/ethernet/netronome/nfp/nfp_main.c
··· 240 240 return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs); 241 241 242 242 pf->limit_vfs = ~0; 243 - pci_sriov_set_totalvfs(pf->pdev, 0); /* 0 is unset */ 244 243 /* Allow any setting for backwards compatibility if symbol not found */ 245 244 if (err == -ENOENT) 246 245 return 0; ··· 667 668 668 669 err = nfp_net_pci_probe(pf); 669 670 if (err) 670 - goto err_sriov_unlimit; 671 + goto err_fw_unload; 671 672 672 673 err = nfp_hwmon_register(pf); 673 674 if (err) { ··· 679 680 680 681 err_net_remove: 681 682 nfp_net_pci_remove(pf); 682 - err_sriov_unlimit: 683 - pci_sriov_set_totalvfs(pf->pdev, 0); 684 683 err_fw_unload: 685 684 kfree(pf->rtbl); 686 685 nfp_mip_close(pf->mip); ··· 712 715 nfp_hwmon_unregister(pf); 713 716 714 717 nfp_pcie_sriov_disable(pdev); 715 - pci_sriov_set_totalvfs(pf->pdev, 0); 716 718 717 719 nfp_net_pci_remove(pf); 718 720
-1
drivers/pci/controller/dwc/Kconfig
··· 58 58 depends on PCI && PCI_MSI_IRQ_DOMAIN 59 59 select PCIE_DW_HOST 60 60 select PCIE_DW_PLAT 61 - default y 62 61 help 63 62 Enables support for the PCIe controller in the Designware IP to 64 63 work in host mode. There are two instances of PCIe controller in
+2
drivers/pci/controller/pci-ftpci100.c
··· 355 355 irq = of_irq_get(intc, 0); 356 356 if (irq <= 0) { 357 357 dev_err(p->dev, "failed to get parent IRQ\n"); 358 + of_node_put(intc); 358 359 return irq ?: -EINVAL; 359 360 } 360 361 361 362 p->irqdomain = irq_domain_add_linear(intc, PCI_NUM_INTX, 362 363 &faraday_pci_irqdomain_ops, p); 364 + of_node_put(intc); 363 365 if (!p->irqdomain) { 364 366 dev_err(p->dev, "failed to create Gemini PCI IRQ domain\n"); 365 367 return -EINVAL;
+13 -3
drivers/pci/controller/pcie-rcar.c
··· 680 680 if (err) 681 681 return err; 682 682 683 - return phy_power_on(pcie->phy); 683 + err = phy_power_on(pcie->phy); 684 + if (err) 685 + phy_exit(pcie->phy); 686 + 687 + return err; 684 688 } 685 689 686 690 static int rcar_msi_alloc(struct rcar_msi *chip) ··· 1169 1165 if (rcar_pcie_hw_init(pcie)) { 1170 1166 dev_info(dev, "PCIe link down\n"); 1171 1167 err = -ENODEV; 1172 - goto err_clk_disable; 1168 + goto err_phy_shutdown; 1173 1169 } 1174 1170 1175 1171 data = rcar_pci_read_reg(pcie, MACSR); ··· 1181 1177 dev_err(dev, 1182 1178 "failed to enable MSI support: %d\n", 1183 1179 err); 1184 - goto err_clk_disable; 1180 + goto err_phy_shutdown; 1185 1181 } 1186 1182 } 1187 1183 ··· 1194 1190 err_msi_teardown: 1195 1191 if (IS_ENABLED(CONFIG_PCI_MSI)) 1196 1192 rcar_pcie_teardown_msi(pcie); 1193 + 1194 + err_phy_shutdown: 1195 + if (pcie->phy) { 1196 + phy_power_off(pcie->phy); 1197 + phy_exit(pcie->phy); 1198 + } 1197 1199 1198 1200 err_clk_disable: 1199 1201 clk_disable_unprepare(pcie->bus_clk);
+1 -1
drivers/pci/controller/pcie-xilinx-nwl.c
··· 559 559 PCI_NUM_INTX, 560 560 &legacy_domain_ops, 561 561 pcie); 562 - 562 + of_node_put(legacy_intc_node); 563 563 if (!pcie->legacy_irq_domain) { 564 564 dev_err(dev, "failed to create IRQ domain\n"); 565 565 return -ENOMEM;
+1
drivers/pci/controller/pcie-xilinx.c
··· 509 509 port->leg_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX, 510 510 &intx_domain_ops, 511 511 port); 512 + of_node_put(pcie_intc_node); 512 513 if (!port->leg_domain) { 513 514 dev_err(dev, "Failed to get a INTx IRQ domain\n"); 514 515 return -ENODEV;
+2 -2
drivers/pci/endpoint/pci-epf-core.c
··· 145 145 */ 146 146 void pci_epf_unregister_driver(struct pci_epf_driver *driver) 147 147 { 148 - struct config_group *group; 148 + struct config_group *group, *tmp; 149 149 150 150 mutex_lock(&pci_epf_mutex); 151 - list_for_each_entry(group, &driver->epf_group, group_entry) 151 + list_for_each_entry_safe(group, tmp, &driver->epf_group, group_entry) 152 152 pci_ep_cfs_remove_epf_group(group); 153 153 list_del(&driver->epf_group); 154 154 mutex_unlock(&pci_epf_mutex);
+16
drivers/pci/iov.c
··· 575 575 } 576 576 577 577 /** 578 + * pci_iov_remove - clean up SR-IOV state after PF driver is detached 579 + * @dev: the PCI device 580 + */ 581 + void pci_iov_remove(struct pci_dev *dev) 582 + { 583 + struct pci_sriov *iov = dev->sriov; 584 + 585 + if (!dev->is_physfn) 586 + return; 587 + 588 + iov->driver_max_VFs = iov->total_VFs; 589 + if (iov->num_VFs) 590 + pci_warn(dev, "driver left SR-IOV enabled after remove\n"); 591 + } 592 + 593 + /** 578 594 * pci_iov_update_resource - update a VF BAR 579 595 * @dev: the PCI device 580 596 * @resno: the resource number
+1
drivers/pci/pci-driver.c
··· 445 445 } 446 446 pcibios_free_irq(pci_dev); 447 447 pci_dev->driver = NULL; 448 + pci_iov_remove(pci_dev); 448 449 } 449 450 450 451 /* Undo the runtime PM settings in local_pci_probe() */
+4
drivers/pci/pci.h
··· 311 311 #ifdef CONFIG_PCI_IOV 312 312 int pci_iov_init(struct pci_dev *dev); 313 313 void pci_iov_release(struct pci_dev *dev); 314 + void pci_iov_remove(struct pci_dev *dev); 314 315 void pci_iov_update_resource(struct pci_dev *dev, int resno); 315 316 resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno); 316 317 void pci_restore_iov_state(struct pci_dev *dev); ··· 324 323 } 325 324 static inline void pci_iov_release(struct pci_dev *dev) 326 325 326 + { 327 + } 328 + static inline void pci_iov_remove(struct pci_dev *dev) 327 329 { 328 330 } 329 331 static inline void pci_restore_iov_state(struct pci_dev *dev)