Index: sys/dev/ioat/ioat.c =================================================================== --- sys/dev/ioat/ioat.c +++ sys/dev/ioat/ioat.c @@ -947,7 +947,7 @@ { uint64_t status; uint32_t chanerr; - int timeout, error; + int timeout; status = ioat_get_chansts(ioat); if (is_ioat_active(status) || is_ioat_idle(status)) @@ -974,6 +974,13 @@ chanerr = pci_read_config(ioat->device, IOAT_CFG_CHANERR_INT_OFFSET, 4); pci_write_config(ioat->device, IOAT_CFG_CHANERR_INT_OFFSET, chanerr, 4); + /* + * BDXDE models reset MSI-X registers on device reset. Save/restore + * their contents manually. + */ + if (ioat_is_bdxde(ioat)) + pci_save_state(ioat->device); + ioat_reset(ioat); /* Wait at most 20 ms */ @@ -982,19 +989,8 @@ if (timeout == 20) return (ETIMEDOUT); - /* - * BDXDE models reset MSI-X registers on device reset. We must - * teardown and re-setup interrupts. - */ - if (ioat_is_bdxde(ioat)) { - error = ioat_teardown_intr(ioat); - if (error) - return (error); - - error = ioat_setup_intr(ioat); - if (error) - return (error); - } + if (ioat_is_bdxde(ioat)) + pci_restore_state(ioat->device); return (0); }