aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2018-08-09 16:04:31 -0400
committerBjorn Helgaas <bhelgaas@google.com>2018-08-09 16:20:52 -0400
commit51ba09452d11b17248d80c740c2fd14c9fdc2c99 (patch)
tree640cc2b4f9dd38f607ddc537f5c75f956b0f5791
parentffb0863426eb91a14101376051cfafa5527e665d (diff)
PCI: Delay after FLR of Intel DC P3700 NVMe
Add a device-specific reset for Intel DC P3700 NVMe device which exhibits a timeout failure in drivers waiting for the ready status to update after NVMe enable if the driver interacts with the device too soon after FLR. As this has been observed in device assignment scenarios, resolve this with a device-specific reset quirk to add an additional, heuristically determined, delay after the FLR completes. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1592654 Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/pci/quirks.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index e249676fbf04..deb051583eda 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3746,6 +3746,27 @@ static int nvme_disable_and_flr(struct pci_dev *dev, int probe)
3746 return 0; 3746 return 0;
3747} 3747}
3748 3748
3749/*
3750 * Intel DC P3700 NVMe controller will timeout waiting for ready status
3751 * to change after NVMe enable if the driver starts interacting with the
3752 * device too soon after FLR. A 250ms delay after FLR has heuristically
3753 * proven to produce reliably working results for device assignment cases.
3754 */
3755static int delay_250ms_after_flr(struct pci_dev *dev, int probe)
3756{
3757 if (!pcie_has_flr(dev))
3758 return -ENOTTY;
3759
3760 if (probe)
3761 return 0;
3762
3763 pcie_flr(dev);
3764
3765 msleep(250);
3766
3767 return 0;
3768}
3769
3749static const struct pci_dev_reset_methods pci_dev_reset_methods[] = { 3770static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
3750 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF, 3771 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
3751 reset_intel_82599_sfp_virtfn }, 3772 reset_intel_82599_sfp_virtfn },
@@ -3754,6 +3775,7 @@ static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
3754 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IVB_M2_VGA, 3775 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IVB_M2_VGA,
3755 reset_ivb_igd }, 3776 reset_ivb_igd },
3756 { PCI_VENDOR_ID_SAMSUNG, 0xa804, nvme_disable_and_flr }, 3777 { PCI_VENDOR_ID_SAMSUNG, 0xa804, nvme_disable_and_flr },
3778 { PCI_VENDOR_ID_INTEL, 0x0953, delay_250ms_after_flr },
3757 { PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID, 3779 { PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID,
3758 reset_chelsio_generic_dev }, 3780 reset_chelsio_generic_dev },
3759 { 0 } 3781 { 0 }