diff options
author | Keith Busch <keith.busch@intel.com> | 2018-02-08 10:55:34 -0500 |
---|---|---|
committer | Keith Busch <keith.busch@intel.com> | 2018-02-13 19:09:50 -0500 |
commit | 4244140d7b8f406b7edfd01c050dea783aa1efc5 (patch) | |
tree | 4cd5574d84e91cf301cd4b4ac81faede92708738 /drivers | |
parent | 815c6704bf9f1c59f3a6be380a4032b9c57b12f1 (diff) |
nvme-pci: Fix timeouts in connecting state
We need to halt the controller immediately if we haven't completed
initialization as indicated by the new "connecting" state.
Fixes: ad70062cdb ("nvme-pci: introduce RECONNECTING state to mark initializing procedure")
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/pci.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index b427157af74e..73036d2fbbd5 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -1215,13 +1215,17 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved) | |||
1215 | * cancellation error. All outstanding requests are completed on | 1215 | * cancellation error. All outstanding requests are completed on |
1216 | * shutdown, so we return BLK_EH_HANDLED. | 1216 | * shutdown, so we return BLK_EH_HANDLED. |
1217 | */ | 1217 | */ |
1218 | if (dev->ctrl.state == NVME_CTRL_RESETTING) { | 1218 | switch (dev->ctrl.state) { |
1219 | case NVME_CTRL_CONNECTING: | ||
1220 | case NVME_CTRL_RESETTING: | ||
1219 | dev_warn(dev->ctrl.device, | 1221 | dev_warn(dev->ctrl.device, |
1220 | "I/O %d QID %d timeout, disable controller\n", | 1222 | "I/O %d QID %d timeout, disable controller\n", |
1221 | req->tag, nvmeq->qid); | 1223 | req->tag, nvmeq->qid); |
1222 | nvme_dev_disable(dev, false); | 1224 | nvme_dev_disable(dev, false); |
1223 | nvme_req(req)->flags |= NVME_REQ_CANCELLED; | 1225 | nvme_req(req)->flags |= NVME_REQ_CANCELLED; |
1224 | return BLK_EH_HANDLED; | 1226 | return BLK_EH_HANDLED; |
1227 | default: | ||
1228 | break; | ||
1225 | } | 1229 | } |
1226 | 1230 | ||
1227 | /* | 1231 | /* |