]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/nvme/host/pci.c
nvme: split nvme_uninit_ctrl into stop and uninit
authorSagi Grimberg <sagi@grimberg.me>
Sun, 2 Jul 2017 07:56:43 +0000 (10:56 +0300)
committerSagi Grimberg <sagi@grimberg.me>
Thu, 6 Jul 2017 06:49:42 +0000 (09:49 +0300)
commitd09f2b45f346f0a9e5e1b5fcea531b1b393671dc
tree877c6cd20daabef24dbf3dd99543f254cb7d4cdd
parent9b3e99058453399b506087b3ac99d67a80343333
nvme: split nvme_uninit_ctrl into stop and uninit

Usually before we teardown the controller we want to:
1. complete/cancel any ctrl inflight works
2. remove ctrl namespaces (only for removal though, resets
   shouldn't remove any namespaces).

but we do not want to destroy the controller device as
we might use it for logging during the teardown stage.

This patch adds nvme_start_ctrl() which queues inflight
controller works (aen, ns scan, queue start and keep-alive
if kato is set) and nvme_stop_ctrl() which cancels the works
namespace removal is left to the callers to handle.

Move nvme_uninit_ctrl after we are done with the
controller device.

Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/core.c
drivers/nvme/host/fc.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c
drivers/nvme/host/rdma.c
drivers/nvme/target/loop.c