Skip to content

Commit

Permalink
NVMe: Bring up cdev on set feature failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Keith Busch authored and Matthew Wilcox committed Sep 3, 2013
1 parent 1b56749 commit 7e03b12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/nvme-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,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;
}

Expand Down Expand Up @@ -2018,7 +2018,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);
Expand Down

0 comments on commit 7e03b12

Please sign in to comment.