nvme: move reset workqueue handling to common code
authorChristoph Hellwig <hch@lst.de>
Thu, 15 Jun 2017 13:41:08 +0000 (15:41 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 15 Jun 2017 13:48:34 +0000 (15:48 +0200)
commitd86c4d8ef31b3d99c681c859cb4e936dafc2d7a4
treed30ba8eb8f2f50c4ae9b91e295c84f7c77aa4fe9
parent0350815a9041d251060c464f1ce80aee11f81023
nvme: move reset workqueue handling to common code

This moves the nvme_reset function from the PCIe driver to common code,
renaming it to nvme_reset_ctrl in the process.  Additionally a new
helper nvme_reset_ctrl_sync is added for the case where we want to
wait for the reset.  To facilitate that the reset_work work structure is
move to the common nvme_ctrl structure and the ->reset_ctrl method is
removed.  For now the drivers initialize the reset_work with their own
callback, but longer term we should move to callouts for specific
parts of the reset process and move even more code to the core.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-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