summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/nvme.h
diff options
context:
space:
mode:
authorSagi Grimberg2017-07-02 09:56:43 +0200
committerSagi Grimberg2017-07-06 08:49:42 +0200
commitd09f2b45f346f0a9e5e1b5fcea531b1b393671dc (patch)
tree877c6cd20daabef24dbf3dd99543f254cb7d4cdd /drivers/nvme/host/nvme.h
parentvirtio_blk: quiesce/unquiesce live IO when entering PM states (diff)
downloadkernel-qcow2-linux-d09f2b45f346f0a9e5e1b5fcea531b1b393671dc.tar.gz
kernel-qcow2-linux-d09f2b45f346f0a9e5e1b5fcea531b1b393671dc.tar.xz
kernel-qcow2-linux-d09f2b45f346f0a9e5e1b5fcea531b1b393671dc.zip
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>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r--drivers/nvme/host/nvme.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index e0b83311d5de..8f2a168ddc01 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -280,6 +280,8 @@ int nvme_shutdown_ctrl(struct nvme_ctrl *ctrl);
int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
const struct nvme_ctrl_ops *ops, unsigned long quirks);
void nvme_uninit_ctrl(struct nvme_ctrl *ctrl);
+void nvme_start_ctrl(struct nvme_ctrl *ctrl);
+void nvme_stop_ctrl(struct nvme_ctrl *ctrl);
void nvme_put_ctrl(struct nvme_ctrl *ctrl);
int nvme_init_identify(struct nvme_ctrl *ctrl);