Commit 8cf80c5c authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/enumeration'

  - If user prevents VF probing, return error instead of pretending a
    driver has claimed the VF (Alex Williamson)

  - Always allow probing with driver_override (Alex Williamson)

  - Decode PCIe 32 GT/s link speed (Gustavo Pimentel)

  - Ignore lockdep for sysfs remove to avoid lockdep false positive (Marek
    Vasut)

* pci/enumeration:
  PCI: sysfs: Ignore lockdep for remove attribute
  PCI: Decode PCIe 32 GT/s link speed
  PCI: Always allow probing with driver_override
  PCI: Return error if cannot probe VF
parents b6a001c0 dc6b698a
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -399,7 +399,8 @@ void __weak pcibios_free_irq(struct pci_dev *dev)
#ifdef CONFIG_PCI_IOV
static inline bool pci_device_can_probe(struct pci_dev *pdev)
{
	return (!pdev->is_virtfn || pdev->physfn->sriov->drivers_autoprobe);
	return (!pdev->is_virtfn || pdev->physfn->sriov->drivers_autoprobe ||
		pdev->driver_override);
}
#else
static inline bool pci_device_can_probe(struct pci_dev *pdev)
@@ -414,6 +415,9 @@ static int pci_device_probe(struct device *dev)
	struct pci_dev *pci_dev = to_pci_dev(dev);
	struct pci_driver *drv = to_pci_driver(dev->driver);

	if (!pci_device_can_probe(pci_dev))
		return -ENODEV;

	pci_assign_irq(pci_dev);

	error = pcibios_alloc_irq(pci_dev);
@@ -421,13 +425,11 @@ static int pci_device_probe(struct device *dev)
		return error;

	pci_dev_get(pci_dev);
	if (pci_device_can_probe(pci_dev)) {
	error = __pci_device_probe(drv, pci_dev);
	if (error) {
		pcibios_free_irq(pci_dev);
		pci_dev_put(pci_dev);
	}
	}

	return error;
}
+4 −1
Original line number Diff line number Diff line
@@ -182,6 +182,9 @@ static ssize_t current_link_speed_show(struct device *dev,
		return -EINVAL;

	switch (linkstat & PCI_EXP_LNKSTA_CLS) {
	case PCI_EXP_LNKSTA_CLS_32_0GB:
		speed = "32 GT/s";
		break;
	case PCI_EXP_LNKSTA_CLS_16_0GB:
		speed = "16 GT/s";
		break;
@@ -477,7 +480,7 @@ static ssize_t remove_store(struct device *dev, struct device_attribute *attr,
		pci_stop_and_remove_bus_device_locked(to_pci_dev(dev));
	return count;
}
static struct device_attribute dev_remove_attr = __ATTR(remove,
static struct device_attribute dev_remove_attr = __ATTR_IGNORE_LOCKDEP(remove,
							(S_IWUSR|S_IWGRP),
							NULL, remove_store);

+3 −1
Original line number Diff line number Diff line
@@ -5621,7 +5621,9 @@ enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev)
	 */
	pcie_capability_read_dword(dev, PCI_EXP_LNKCAP2, &lnkcap2);
	if (lnkcap2) { /* PCIe r3.0-compliant */
		if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_16_0GB)
		if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_32_0GB)
			return PCIE_SPEED_32_0GT;
		else if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_16_0GB)
			return PCIE_SPEED_16_0GT;
		else if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB)
			return PCIE_SPEED_8_0GT;
+1 −1
Original line number Diff line number Diff line
@@ -668,7 +668,7 @@ const unsigned char pcie_link_speed[] = {
	PCIE_SPEED_5_0GT,		/* 2 */
	PCIE_SPEED_8_0GT,		/* 3 */
	PCIE_SPEED_16_0GT,		/* 4 */
	PCI_SPEED_UNKNOWN,		/* 5 */
	PCIE_SPEED_32_0GT,		/* 5 */
	PCI_SPEED_UNKNOWN,		/* 6 */
	PCI_SPEED_UNKNOWN,		/* 7 */
	PCI_SPEED_UNKNOWN,		/* 8 */
+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ static const char *pci_bus_speed_strings[] = {
	"5.0 GT/s PCIe",	/* 0x15 */
	"8.0 GT/s PCIe",	/* 0x16 */
	"16.0 GT/s PCIe",	/* 0x17 */
	"32.0 GT/s PCIe",	/* 0x18 */
};

static ssize_t bus_speed_read(enum pci_bus_speed speed, char *buf)
Loading