opnsense-src/sys/dev/nvme
Warner Losh 8423f5d4c1 nvme: use config_intrhook_drain to avoid removable card races
nvme drives are configured early in boot. However, a number of the configuration
steps takes which take a while, so we defer those to a config intrhook that runs
before the root filesystem is mounted. At the same time, the PCI hot plug wakes
up and tests the status of the card. It may decide that the card has gone away
and deletes the child. As part of that process nvme_detach is called. If this
call happens after the config_intrhook starts to run, but before it is finished,
there's a race where we can tear down the device's soft state while the
config_intrhook is still using it. Use the new config_intrhook_drain to
disestablish the hook. Either it will be removed w/o running, or the routine
will wait for it to finish. This closes the race and allows safe hotplug at any
time, even very early in boot.

Sponsored by:		Netflix, Inc
Reviewed by:		jhb, mav
Differential Revision:	https://reviews.freebsd.org/D29006
2021-03-11 09:45:10 -07:00
..
nvme.c nvme: use config_intrhook_drain to avoid removable card races 2021-03-11 09:45:10 -07:00
nvme.h fix big-endian platforms after 6733401935 2021-01-08 14:41:45 -08:00
nvme_ahci.c Make nvme(4) driver some more NUMA aware. 2019-09-23 17:53:47 +00:00
nvme_ctrlr.c nvme: use config_intrhook_drain to avoid removable card races 2021-03-11 09:45:10 -07:00
nvme_ctrlr_cmd.c Add Host Memory Buffer support to nvme(4). 2020-01-07 21:17:11 +00:00
nvme_ns.c Fix various Coverity-detected errors in nvme driver 2020-05-02 20:47:58 +00:00
nvme_ns_cmd.c Add a brief comment explaining why we can return ETIMEDOUT from the call to the 2019-09-02 17:10:46 +00:00
nvme_pci.c nvme: clean up empty lines in .c and .h files 2020-09-01 22:03:10 +00:00
nvme_private.h nvme: Make nvme_ctrlr_hw_reset static 2021-02-08 13:29:24 -07:00
nvme_qpair.c nvme: use NVME_GONE rather than hard-coded 0xffffffff 2021-02-08 13:08:48 -07:00
nvme_sim.c Report cpi->hba_* for nda(4) because why not. 2020-08-12 20:05:43 +00:00
nvme_sysctl.c nvme: Remove compat code for older kernels 2020-10-24 01:59:01 +00:00
nvme_test.c nvme: clean up empty lines in .c and .h files 2020-09-01 22:03:10 +00:00
nvme_util.c nvme: clean up empty lines in .c and .h files 2020-09-01 22:03:10 +00:00