aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/nvme-core.c
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2013-07-29 18:20:56 -0400
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-09-03 16:32:26 -0400
commit7e03b124065507e72008ef294c30001eca74a031 (patch)
tree48343408c9544e798cc41e3d4c0c777d21ce3e3c /drivers/block/nvme-core.c
parent1b56749e541ad59068582f2a28297843e243b856 (diff)
NVMe: Bring up cdev on set feature failure
This patch creates the character device as long as a device's admin queues are usable so a user has an opprotunity to perform administration tasks. A device may be in a state that does not allow IO and setting the queue count feature in such a state returns an error. Previously the driver would bail and the controller would be unusable. Signed-off-by: Keith Busch <keith.busch@intel.com>
Diffstat (limited to 'drivers/block/nvme-core.c')
-rw-r--r--drivers/block/nvme-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index f9244131b88a..8cfa4576d424 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1664,7 +1664,7 @@ static int set_queue_count(struct nvme_dev *dev, int count)
1664 status = nvme_set_features(dev, NVME_FEAT_NUM_QUEUES, q_count, 0, 1664 status = nvme_set_features(dev, NVME_FEAT_NUM_QUEUES, q_count, 0,
1665 &result); 1665 &result);
1666 if (status) 1666 if (status)
1667 return -EIO; 1667 return status < 0 ? -EIO : -EBUSY;
1668 return min(result & 0xffff, result >> 16) + 1; 1668 return min(result & 0xffff, result >> 16) + 1;
1669} 1669}
1670 1670
@@ -2018,7 +2018,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2018 spin_unlock(&dev_list_lock); 2018 spin_unlock(&dev_list_lock);
2019 2019
2020 result = nvme_dev_add(dev); 2020 result = nvme_dev_add(dev);
2021 if (result) 2021 if (result && result != -EBUSY)
2022 goto delete; 2022 goto delete;
2023 2023
2024 scnprintf(dev->name, sizeof(dev->name), "nvme%d", dev->instance); 2024 scnprintf(dev->name, sizeof(dev->name), "nvme%d", dev->instance);