Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8979319f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents b2d44d14 83235822
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -240,7 +240,6 @@ static int nfp_pcie_sriov_read_nfd_limit(struct nfp_pf *pf)
		return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs);

	pf->limit_vfs = ~0;
	pci_sriov_set_totalvfs(pf->pdev, 0); /* 0 is unset */
	/* Allow any setting for backwards compatibility if symbol not found */
	if (err == -ENOENT)
		return 0;
@@ -668,7 +667,7 @@ static int nfp_pci_probe(struct pci_dev *pdev,

	err = nfp_net_pci_probe(pf);
	if (err)
		goto err_sriov_unlimit;
		goto err_fw_unload;

	err = nfp_hwmon_register(pf);
	if (err) {
@@ -680,8 +679,6 @@ static int nfp_pci_probe(struct pci_dev *pdev,

err_net_remove:
	nfp_net_pci_remove(pf);
err_sriov_unlimit:
	pci_sriov_set_totalvfs(pf->pdev, 0);
err_fw_unload:
	kfree(pf->rtbl);
	nfp_mip_close(pf->mip);
@@ -715,7 +712,6 @@ static void nfp_pci_remove(struct pci_dev *pdev)
	nfp_hwmon_unregister(pf);

	nfp_pcie_sriov_disable(pdev);
	pci_sriov_set_totalvfs(pf->pdev, 0);

	nfp_net_pci_remove(pf);

+0 −1
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ config PCIE_DW_PLAT_HOST
	depends on PCI && PCI_MSI_IRQ_DOMAIN
	select PCIE_DW_HOST
	select PCIE_DW_PLAT
	default y
	help
	  Enables support for the PCIe controller in the Designware IP to
	  work in host mode. There are two instances of PCIe controller in
+2 −0
Original line number Diff line number Diff line
@@ -355,11 +355,13 @@ static int faraday_pci_setup_cascaded_irq(struct faraday_pci *p)
	irq = of_irq_get(intc, 0);
	if (irq <= 0) {
		dev_err(p->dev, "failed to get parent IRQ\n");
		of_node_put(intc);
		return irq ?: -EINVAL;
	}

	p->irqdomain = irq_domain_add_linear(intc, PCI_NUM_INTX,
					     &faraday_pci_irqdomain_ops, p);
	of_node_put(intc);
	if (!p->irqdomain) {
		dev_err(p->dev, "failed to create Gemini PCI IRQ domain\n");
		return -EINVAL;
+13 −3
Original line number Diff line number Diff line
@@ -680,7 +680,11 @@ static int rcar_pcie_phy_init_gen3(struct rcar_pcie *pcie)
	if (err)
		return err;

	return phy_power_on(pcie->phy);
	err = phy_power_on(pcie->phy);
	if (err)
		phy_exit(pcie->phy);

	return err;
}

static int rcar_msi_alloc(struct rcar_msi *chip)
@@ -1165,7 +1169,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
	if (rcar_pcie_hw_init(pcie)) {
		dev_info(dev, "PCIe link down\n");
		err = -ENODEV;
		goto err_clk_disable;
		goto err_phy_shutdown;
	}

	data = rcar_pci_read_reg(pcie, MACSR);
@@ -1177,7 +1181,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
			dev_err(dev,
				"failed to enable MSI support: %d\n",
				err);
			goto err_clk_disable;
			goto err_phy_shutdown;
		}
	}

@@ -1191,6 +1195,12 @@ static int rcar_pcie_probe(struct platform_device *pdev)
	if (IS_ENABLED(CONFIG_PCI_MSI))
		rcar_pcie_teardown_msi(pcie);

err_phy_shutdown:
	if (pcie->phy) {
		phy_power_off(pcie->phy);
		phy_exit(pcie->phy);
	}

err_clk_disable:
	clk_disable_unprepare(pcie->bus_clk);

+1 −1
Original line number Diff line number Diff line
@@ -559,7 +559,7 @@ static int nwl_pcie_init_irq_domain(struct nwl_pcie *pcie)
							PCI_NUM_INTX,
							&legacy_domain_ops,
							pcie);

	of_node_put(legacy_intc_node);
	if (!pcie->legacy_irq_domain) {
		dev_err(dev, "failed to create IRQ domain\n");
		return -ENOMEM;
Loading