Commit 678ede85 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull PCI fixes from Bjorn Helgaas:

 - Don't fallback to bus reset after failed slot reset; a bus reset
   isn't safe if the .reset_slot() callback is implemented (Keith Busch)

 - Update saved_config_space upon resource assignment to fix passthrough
   regressions when x86 pcibios_assign_resources() updates BARs (Lukas
   Wunner)

 - Initialize a temporary pci_dev->dev in sysfs 'new_id' attribute to
   fix a lockdep regression after driver_override was moved from PCI to
   device core (Samiullah Khawaja)

 - Update MAINTAINERS email addresses (Marek Vasut, Hans Zhang)

 - Add MAINTAINERS reviewer for PCIe Cadence IP (Aksh Garg)

* tag 'pci-v7.1-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
  MAINTAINERS: Add Aksh Garg as PCIe CADENCE reviewer
  MAINTAINERS: Update Hans Zhang email for PCIe CIX Sky1
  MAINTAINERS: Update Marek Vasut email for PCIe R-Car
  PCI: Initialize temporary device in new_id_store()
  PCI: Update saved_config_space upon resource assignment
  PCI: Don't fallback to bus reset after failed slot reset
parents cbf457c5 9ef40a09
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -20352,13 +20352,14 @@ F: Documentation/devicetree/bindings/pci/marvell,armada8k-pcie.yaml
F:	drivers/pci/controller/dwc/pcie-armada8k.c
PCI DRIVER FOR CADENCE PCIE IP
R:	Aksh Garg <a-garg7@ti.com>
L:	linux-pci@vger.kernel.org
S:	Orphan
F:	Documentation/devicetree/bindings/pci/cdns,*
F:	drivers/pci/controller/cadence/*cadence*
F:	drivers/pci/controller/cadence/
PCI DRIVER FOR CIX Sky1
M:	Hans Zhang <hans.zhang@cixtech.com>
M:	Hans Zhang <18255117159@163.com>
L:	linux-pci@vger.kernel.org
S:	Maintained
F:	Documentation/devicetree/bindings/pci/cix,sky1-pcie-*.yaml
@@ -20470,7 +20471,7 @@ F: drivers/pci/controller/plda/pcie-plda-host.c
F:	drivers/pci/controller/plda/pcie-plda.h
PCI DRIVER FOR RENESAS R-CAR
M:	Marek Vasut <marek.vasut+renesas@gmail.com>
M:	Marek Vasut <marek.vasut+renesas@mailbox.org>
M:	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
L:	linux-pci@vger.kernel.org
L:	linux-renesas-soc@vger.kernel.org
+8 −1
Original line number Diff line number Diff line
@@ -179,6 +179,11 @@ static const struct pci_device_id *pci_match_device(struct pci_driver *drv,
	return NULL;
}

static void _pci_free_device(struct device *dev)
{
	kfree(to_pci_dev(dev));
}

/**
 * new_id_store - sysfs frontend to pci_add_dynid()
 * @driver: target device driver
@@ -214,11 +219,13 @@ static ssize_t new_id_store(struct device_driver *driver, const char *buf,
		pdev->subsystem_vendor = subvendor;
		pdev->subsystem_device = subdevice;
		pdev->class = class;
		pdev->dev.release = _pci_free_device;

		device_initialize(&pdev->dev);
		if (pci_match_device(pdrv, pdev))
			retval = -EEXIST;

		kfree(pdev);
		put_device(&pdev->dev);

		if (retval)
			return retval;
+4 −5
Original line number Diff line number Diff line
@@ -5607,13 +5607,14 @@ static int pci_try_reset_bus(struct pci_bus *bus)
 *           reset for affected devices
 *
 * This function will first try to reset the slots on this bus if the method is
 * available. If slot reset fails or is not available, this will fall back to a
 * available. If slot reset is not available, this will fall back to a
 * secondary bus reset.
 */
static int pci_reset_bridge(struct pci_dev *bridge, bool restore)
{
	struct pci_bus *bus = bridge->subordinate;
	struct pci_slot *slot;
	int ret = 0;

	if (!bus)
		return -ENOTTY;
@@ -5627,19 +5628,17 @@ static int pci_reset_bridge(struct pci_dev *bridge, bool restore)
			goto bus_reset;

	list_for_each_entry(slot, &bus->slots, list) {
		int ret;

		if (restore)
			ret = pci_try_reset_slot(slot);
		else
			ret = pci_slot_reset(slot, PCI_RESET_DO_RESET);

		if (ret)
			goto bus_reset;
			break;
	}

	mutex_unlock(&pci_slot_mutex);
	return 0;
	return ret;
bus_reset:
	mutex_unlock(&pci_slot_mutex);

+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
	}

	pci_write_config_dword(dev, reg, new);
	dev->saved_config_space[reg / 4] = new;
	pci_read_config_dword(dev, reg, &check);

	if ((new ^ check) & mask) {
@@ -112,6 +113,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
	if (res->flags & IORESOURCE_MEM_64) {
		new = region.start >> 16 >> 16;
		pci_write_config_dword(dev, reg + 4, new);
		dev->saved_config_space[(reg + 4) / 4] = new;
		pci_read_config_dword(dev, reg + 4, &check);
		if (check != new) {
			pci_err(dev, "%s: error updating (high %#010x != %#010x)\n",