The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8c44df321cf39bcba568c513dda54b75937d4556
commit 8c44df321cf39bcba568c513dda54b75937d4556 Author: Warner Losh <i...@freebsd.org> AuthorDate: 2024-08-13 22:45:17 +0000 Commit: Warner Losh <i...@freebsd.org> CommitDate: 2024-08-13 22:46:41 +0000 nvme: Add a clarifying comment While it is easy enough to bounce over to nvme.c from nvme_ctrlr.c to find this out, I've had to do that several times, so a little bit of context is quite helpful. Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index d97575a19584..270be61e2d36 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1588,6 +1588,12 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) return (0); } +/* + * Called on detach, or on error on attach. The nvme_controller won't be used + * again once we return, so we have to tear everything down (so nothing + * references this, no callbacks, etc), but don't need to reset all the state + * since nvme_controller will be freed soon. + */ void nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev) {