svn commit: r351915 - stable/12/sys/dev/pci
Warner Losh
imp at FreeBSD.org
Thu Sep 5 23:54:45 UTC 2019
Author: imp
Date: Thu Sep 5 23:54:44 2019
New Revision: 351915
URL: https://svnweb.freebsd.org/changeset/base/351915
Log:
MFC r349845:
Work around devices which return all zeros for reads of existing MSI-X table
VCTRL registers.
Note: This is confirmed to fix the nvme lost interrupt issues, seen on both
virtual and real cards.
PR: 211713
Modified:
stable/12/sys/dev/pci/pci.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/dev/pci/pci.c
==============================================================================
--- stable/12/sys/dev/pci/pci.c Thu Sep 5 23:40:38 2019 (r351914)
+++ stable/12/sys/dev/pci/pci.c Thu Sep 5 23:54:44 2019 (r351915)
@@ -1661,10 +1661,13 @@ pci_mask_msix(device_t dev, u_int index)
KASSERT(msix->msix_msgnum > index, ("bogus index"));
offset = msix->msix_table_offset + index * 16 + 12;
val = bus_read_4(msix->msix_table_res, offset);
- if (!(val & PCIM_MSIX_VCTRL_MASK)) {
- val |= PCIM_MSIX_VCTRL_MASK;
- bus_write_4(msix->msix_table_res, offset, val);
- }
+ val |= PCIM_MSIX_VCTRL_MASK;
+
+ /*
+ * Some devices (e.g. Samsung PM961) do not support reads of this
+ * register, so always write the new value.
+ */
+ bus_write_4(msix->msix_table_res, offset, val);
}
void
@@ -1677,10 +1680,13 @@ pci_unmask_msix(device_t dev, u_int index)
KASSERT(msix->msix_table_len > index, ("bogus index"));
offset = msix->msix_table_offset + index * 16 + 12;
val = bus_read_4(msix->msix_table_res, offset);
- if (val & PCIM_MSIX_VCTRL_MASK) {
- val &= ~PCIM_MSIX_VCTRL_MASK;
- bus_write_4(msix->msix_table_res, offset, val);
- }
+ val &= ~PCIM_MSIX_VCTRL_MASK;
+
+ /*
+ * Some devices (e.g. Samsung PM961) do not support reads of this
+ * register, so always write the new value.
+ */
+ bus_write_4(msix->msix_table_res, offset, val);
}
int
More information about the svn-src-all
mailing list