Skip to content

Commit d82e8bf

Browse files
Keith BuschMatthew Wilcox
authored andcommitted
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>
1 parent 9d713c2 commit d82e8bf

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎drivers/block/nvme-core.c‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,10 +2135,10 @@ static int nvme_dev_start(struct nvme_dev *dev)
21352135
spin_unlock(&dev_list_lock);
21362136

21372137
result = nvme_setup_io_queues(dev);
2138-
if (result)
2138+
if (result && result != -EBUSY)
21392139
goto disable;
21402140

2141-
return 0;
2141+
return result;
21422142

21432143
disable:
21442144
spin_lock(&dev_list_lock);
@@ -2177,13 +2177,17 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
21772177
goto release;
21782178

21792179
result = nvme_dev_start(dev);
2180-
if (result)
2180+
if (result) {
2181+
if (result == -EBUSY)
2182+
goto create_cdev;
21812183
goto release_pools;
2184+
}
21822185

21832186
result = nvme_dev_add(dev);
2184-
if (result && result != -EBUSY)
2187+
if (result)
21852188
goto shutdown;
21862189

2190+
create_cdev:
21872191
scnprintf(dev->name, sizeof(dev->name), "nvme%d", dev->instance);
21882192
dev->miscdev.minor = MISC_DYNAMIC_MINOR;
21892193
dev->miscdev.parent = &pdev->dev;

0 commit comments

Comments
 (0)