aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2016-10-11 13:31:58 -0400
committerJens Axboe <axboe@fb.com>2016-10-12 10:40:13 -0400
commit0df1e4f5e0e831670f43bd198623b303ba09cbc0 (patch)
treeb8454ff731779d4650ae0d1ce159ada606631900
parent1fa9ce8d0e903449842943a77e8ba100169964be (diff)
nvme: Stop probing a removed device
There is no reason the nvme controller can ever return all 1's from reading the CSTS register. This patch returns an error if we observe that status. Without this, we may incorrectly proceed with controller initialization and unnecessarilly rely on error handling to clean this. Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/nvme/host/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 329381a28edf..2a57f5ede386 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1086,6 +1086,8 @@ static int nvme_wait_ready(struct nvme_ctrl *ctrl, u64 cap, bool enabled)
1086 int ret; 1086 int ret;
1087 1087
1088 while ((ret = ctrl->ops->reg_read32(ctrl, NVME_REG_CSTS, &csts)) == 0) { 1088 while ((ret = ctrl->ops->reg_read32(ctrl, NVME_REG_CSTS, &csts)) == 0) {
1089 if (csts == ~0)
1090 return -ENODEV;
1089 if ((csts & NVME_CSTS_RDY) == bit) 1091 if ((csts & NVME_CSTS_RDY) == bit)
1090 break; 1092 break;
1091 1093