Enable bus mastering on the device before resetting the device. The

card has to do PCIe transactions to complete the reset process, but
can't do them, per the PCIe spec, unless bus mastering is enabled.

Submitted by: Kinjal Patel
PR: 22166
This commit is contained in:
Warner Losh 2017-08-25 03:15:18 +00:00
parent 0c7a1e15ad
commit abb61405a6

View File

@ -245,6 +245,12 @@ nvme_attach(device_t dev)
return (status);
}
/*
* Enable busmastering so the completion status messages can
* be busmastered back to the host.
*/
pci_enable_busmaster(dev);
/*
* Reset controller twice to ensure we do a transition from cc.en==1
* to cc.en==0. This is because we don't really know what status
@ -262,8 +268,6 @@ nvme_attach(device_t dev)
return (status);
}
pci_enable_busmaster(dev);
ctrlr->config_hook.ich_func = nvme_ctrlr_start_config_hook;
ctrlr->config_hook.ich_arg = ctrlr;