]> Pileus Git - ~andy/linux/commitdiff
NVMe: Merge issue on character device bring-up
authorKeith Busch <keith.busch@intel.com>
Thu, 5 Sep 2013 20:45:07 +0000 (14:45 -0600)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>
Fri, 6 Sep 2013 20:26:58 +0000 (16:26 -0400)
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 <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
drivers/block/nvme-core.c

index 9f2b424c445e1909a1f91eca1aaa4823f14f6fc5..da52092980e2312987b6a1040df5c0ba444852c3 100644 (file)
@@ -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);
@@ -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;