OSDN Git Service

nvme-pci: move more teardown work to nvme_remove
authorChristoph Hellwig <hch@lst.de>
Tue, 8 Nov 2022 08:11:13 +0000 (09:11 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 15 Nov 2022 09:56:03 +0000 (10:56 +0100)
commitc11b7716d6c96e82d2b404c4520237d968357a0d
tree5a096f71572ccd59f98b2468c0518e955b56bf59
parent96ef1be53663a9343dffcf106e2f1b59da4b8799
nvme-pci: move more teardown work to nvme_remove

nvme_dbbuf_dma_free frees dma coherent memory, so it must not be called
after ->remove has returned.  Fortunately there is no way to use it
after shutdown as no more I/O is possible so it can be moved.  Similarly
the iod_mempool can't be used for a device kept alive after shutdown, so
move it next to freeing the PRP pools.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Tested-by Gerd Bayer <gbayer@linxu.ibm.com>
drivers/nvme/host/pci.c