Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
NVMe: Merge issue on character device bring-up
Browse files Browse the repository at this point in the history
A recent patch made it possible to bring up the character handle when the
device is responsive but not accepting a set-features command. Another
recent patch moved the initialization that requires we move where the
checks for this condition occur. This patch merges these two ideas so
it works much as before.

Signed-off-by: Keith Busch <[email protected]>
Signed-off-by: Matthew Wilcox <[email protected]>
  • Loading branch information
Keith Busch authored and Matthew Wilcox committed Sep 6, 2013
1 parent 9d713c2 commit d82e8bf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/block/nvme-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2135,10 +2135,10 @@ static int nvme_dev_start(struct nvme_dev *dev)
spin_unlock(&dev_list_lock);

result = nvme_setup_io_queues(dev);
if (result)
if (result && result != -EBUSY)
goto disable;

return 0;
return result;

disable:
spin_lock(&dev_list_lock);
Expand Down Expand Up @@ -2177,13 +2177,17 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto release;

result = nvme_dev_start(dev);
if (result)
if (result) {
if (result == -EBUSY)
goto create_cdev;
goto release_pools;
}

result = nvme_dev_add(dev);
if (result && result != -EBUSY)
if (result)
goto shutdown;

create_cdev:
scnprintf(dev->name, sizeof(dev->name), "nvme%d", dev->instance);
dev->miscdev.minor = MISC_DYNAMIC_MINOR;
dev->miscdev.parent = &pdev->dev;
Expand Down

0 comments on commit d82e8bf

Please sign in to comment.