Skip to contentSkip to conversation

NVMe: Bring up cdev on set feature failure

PATCH New Keith Busch 1 participant 1 message Jul 29, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 at intel.com>
---
 drivers/block/nvme-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/block/nvme-core.c +2 -2
index 7439499..524f497 100644
@@ -1665,7 +1665,7 @@ static int set_queue_count(struct nvme_dev *dev, int count)
 	status = nvme_set_features(dev, NVME_FEAT_NUM_QUEUES, q_count, 0,
 								&result);
 	if (status)
-		return -EIO;
+		return status < 0 ? -EIO : -EBUSY;
 	return min(result & 0xffff, result >> 16) + 1;
 }
 
@@ -2019,7 +2019,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	spin_unlock(&dev_list_lock);
 
 	result = nvme_dev_add(dev);
-	if (result)
+	if (result && result != -EBUSY)
 		goto delete;
 
 	scnprintf(dev->name, sizeof(dev->name), "nvme%d", dev->instance);
Signature · 1 line
1.7.0.4