Page MenuHomeFreeBSD

D20873.id59540.diff
No OneTemporary

D20873.id59540.diff

Index: sys/dev/pci/pci.c
===================================================================
--- sys/dev/pci/pci.c
+++ sys/dev/pci/pci.c
@@ -1671,10 +1671,12 @@
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 (eg Samsung PM961) cannot handle RMW on this register for
+ * all its vectors, so write the values we need directly.
+ */
+ bus_write_4(msix->msix_table_res, offset, PCIM_MSIX_VCTRL_MASK);
}
void
@@ -1687,10 +1689,12 @@
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 (eg Samsung PM961) cannot handle RMW on this register for
+ * all its vectors, so write the values we need directly.
+ */
+ bus_write_4(msix->msix_table_res, offset, 0);
}
int

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 8, 8:53 PM (3 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31089499
Default Alt Text
D20873.id59540.diff (1 KB)

Event Timeline