summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorSasha Neftin <sasha.neftin@intel.com>2017-04-03 23:02:50 +0200
committerBjorn Helgaas <bhelgaas@google.com>2017-04-03 23:02:50 +0200
commitf65fd1aa4f9881d5540192d11f7b8ed2fec936db (patch)
treea6a61973770b1c570019cd9b6218983f3b020b65 /drivers/pci/pci.c
parentLinux 4.11-rc1 (diff)
downloadlinux-f65fd1aa4f9881d5540192d11f7b8ed2fec936db.tar.xz
linux-f65fd1aa4f9881d5540192d11f7b8ed2fec936db.zip
PCI: Avoid FLR for Intel 82579 NICs
Per Intel Specification Update 335553-002 (see link below), some 82579 network adapters advertise a Function Level Reset (FLR) capability, but they can hang when an FLR is triggered. To reproduce the problem, attach the device to a VM, then detach and try to attach again. Add a quirk to prevent the use of FLR on these devices. [bhelgaas: changelog, comments] Link: http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/82579lm-82579v-gigabit-network-connection-spec-update.pdf Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7904d02ffdb9..bef14777bb30 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3781,6 +3781,9 @@ static int pcie_flr(struct pci_dev *dev, int probe)
if (!(cap & PCI_EXP_DEVCAP_FLR))
return -ENOTTY;
+ if (dev->dev_flags & PCI_DEV_FLAGS_NO_FLR_RESET)
+ return -ENOTTY;
+
if (probe)
return 0;
@@ -3801,6 +3804,9 @@ static int pci_af_flr(struct pci_dev *dev, int probe)
if (!pos)
return -ENOTTY;
+ if (dev->dev_flags & PCI_DEV_FLAGS_NO_FLR_RESET)
+ return -ENOTTY;
+
pci_read_config_byte(dev, pos + PCI_AF_CAP, &cap);
if (!(cap & PCI_AF_CAP_TP) || !(cap & PCI_AF_CAP_FLR))
return -ENOTTY;