aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2013-09-05 16:45:07 -0400
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-09-06 16:26:58 -0400
commitd82e8bfdef9afae83b894be49af4644d9ac3c359 (patch)
treeb9d26d4e24e5464fe845110ad6bbed44650ded9c
parent9d713c2bfb5e1d6abb18a8b12293631f9fcdc708 (diff)
NVMe: Merge issue on character device bring-up
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>
-rw-r--r--drivers/block/nvme-core.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 9f2b424c445e..da52092980e2 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -2135,10 +2135,10 @@ static int nvme_dev_start(struct nvme_dev *dev)
2135 spin_unlock(&dev_list_lock); 2135 spin_unlock(&dev_list_lock);
2136 2136
2137 result = nvme_setup_io_queues(dev); 2137 result = nvme_setup_io_queues(dev);
2138 if (result) 2138 if (result && result != -EBUSY)
2139 goto disable; 2139 goto disable;
2140 2140
2141 return 0; 2141 return result;
2142 2142
2143 disable: 2143 disable:
2144 spin_lock(&dev_list_lock); 2144 spin_lock(&dev_list_lock);
@@ -2177,13 +2177,17 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2177 goto release; 2177 goto release;
2178 2178
2179 result = nvme_dev_start(dev); 2179 result = nvme_dev_start(dev);
2180 if (result) 2180 if (result) {
2181 if (result == -EBUSY)
2182 goto create_cdev;
2181 goto release_pools; 2183 goto release_pools;
2184 }
2182 2185
2183 result = nvme_dev_add(dev); 2186 result = nvme_dev_add(dev);
2184 if (result && result != -EBUSY) 2187 if (result)
2185 goto shutdown; 2188 goto shutdown;
2186 2189
2190 create_cdev:
2187 scnprintf(dev->name, sizeof(dev->name), "nvme%d", dev->instance); 2191 scnprintf(dev->name, sizeof(dev->name), "nvme%d", dev->instance);
2188 dev->miscdev.minor = MISC_DYNAMIC_MINOR; 2192 dev->miscdev.minor = MISC_DYNAMIC_MINOR;
2189 dev->miscdev.parent = &pdev->dev; 2193 dev->miscdev.parent = &pdev->dev;