summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew.r.wilcox@intel.com>2011-02-15 21:28:20 (GMT)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2011-11-04 19:52:58 (GMT)
commit740216fc59cba54f65187c9ed92f29bce3cf8778 (patch)
treea0567209d1636b1790885adb6fd651c716be23b1
parentb348b7d54368c87811907a8e88f0d96713c43009 (diff)
downloadlinux-fsl-qoriq-740216fc59cba54f65187c9ed92f29bce3cf8778.tar.xz
NVMe: Let the kthread take care of devices earlier
If interrupts are misconfigured, the kthread will be needed to process admin queue completions. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
-rw-r--r--drivers/block/nvme.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index f3aa809..df1d8bd 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -1112,6 +1112,8 @@ static int nvme_kthread(void *data)
int i;
for (i = 0; i < dev->queue_count; i++) {
struct nvme_queue *nvmeq = dev->queues[i];
+ if (!nvmeq)
+ continue;
spin_lock_irq(&nvmeq->q_lock);
if (nvme_process_cq(nvmeq))
printk("process_cq did something\n");
@@ -1437,17 +1439,21 @@ static int __devinit nvme_probe(struct pci_dev *pdev,
goto unmap;
dev->queue_count++;
- result = nvme_dev_add(dev);
- if (result)
- goto delete;
-
spin_lock(&dev_list_lock);
list_add(&dev->node, &dev_list);
spin_unlock(&dev_list_lock);
+ result = nvme_dev_add(dev);
+ if (result)
+ goto delete;
+
return 0;
delete:
+ spin_lock(&dev_list_lock);
+ list_del(&dev->node);
+ spin_unlock(&dev_list_lock);
+
nvme_free_queues(dev);
unmap:
iounmap(dev->bar);