diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index b89c895efb50..24056676f736 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -5946,7 +5946,7 @@ static int iwm_pci_attach(device_t dev) { struct iwm_softc *sc; - int count, error, rid; + int count, error, off, rid; uint16_t reg; sc = device_get_softc(dev); @@ -5974,6 +5974,15 @@ iwm_pci_attach(device_t dev) sc->sc_st = rman_get_bustag(sc->sc_mem); sc->sc_sh = rman_get_bushandle(sc->sc_mem); + if (pci_find_cap(dev, PCIY_MSIX, &off) == 0) { + uint32_t msixctrl = pci_read_config(dev, off + PCIR_MSIX_CTRL, 2); + device_printf(dev, "msixctrl %#08x\n", msixctrl); + if ((msixctrl & PCIM_MSIXCTRL_MSIX_ENABLE) != 0) { + msixctrl &= ~PCIM_MSIXCTRL_MSIX_ENABLE; + pci_write_config(dev, off + PCIR_MSIX_CTRL, msixctrl, 2); + } + } + /* Install interrupt handler. */ count = 1; rid = 0;