Page MenuHomeFreeBSD

D20873.id59526.diff
No OneTemporary

D20873.id59526.diff

Index: sys/dev/pci/pci.c
===================================================================
--- sys/dev/pci/pci.c
+++ sys/dev/pci/pci.c
@@ -1666,15 +1666,15 @@
{
struct pci_devinfo *dinfo = device_get_ivars(dev);
struct pcicfg_msix *msix = &dinfo->cfg.msix;
- uint32_t offset, val;
+ uint32_t offset;
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);
- }
+ /*
+ * Some devices (eg Samsung PM961) cannot handle RMW on this register for
+ * all its vectors write the values we need directly.
+ */
+ bus_write_4(msix->msix_table_res, offset, PCIM_MSIX_VCTRL_MASK);
}
void
@@ -1682,15 +1682,15 @@
{
struct pci_devinfo *dinfo = device_get_ivars(dev);
struct pcicfg_msix *msix = &dinfo->cfg.msix;
- uint32_t offset, val;
+ uint32_t offset;
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);
- }
+ /*
+ * Some devices (eg Samsung PM961) cannot handle RMW on this register for
+ * all its vectors write the values we need directly.
+ */
+ bus_write_4(msix->msix_table_res, offset, 0);
}
int

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 19, 11:59 PM (11 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29986391
Default Alt Text
D20873.id59526.diff (1 KB)

Event Timeline