diff options
author | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-02-15 16:28:20 -0500 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-11-04 15:52:58 -0400 |
commit | 740216fc59cba54f65187c9ed92f29bce3cf8778 (patch) | |
tree | a0567209d1636b1790885adb6fd651c716be23b1 | |
parent | b348b7d54368c87811907a8e88f0d96713c43009 (diff) |
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.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index f3aa8097e675..df1d8bda8c7c 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c | |||
@@ -1112,6 +1112,8 @@ static int nvme_kthread(void *data) | |||
1112 | int i; | 1112 | int i; |
1113 | for (i = 0; i < dev->queue_count; i++) { | 1113 | for (i = 0; i < dev->queue_count; i++) { |
1114 | struct nvme_queue *nvmeq = dev->queues[i]; | 1114 | struct nvme_queue *nvmeq = dev->queues[i]; |
1115 | if (!nvmeq) | ||
1116 | continue; | ||
1115 | spin_lock_irq(&nvmeq->q_lock); | 1117 | spin_lock_irq(&nvmeq->q_lock); |
1116 | if (nvme_process_cq(nvmeq)) | 1118 | if (nvme_process_cq(nvmeq)) |
1117 | printk("process_cq did something\n"); | 1119 | printk("process_cq did something\n"); |
@@ -1437,17 +1439,21 @@ static int __devinit nvme_probe(struct pci_dev *pdev, | |||
1437 | goto unmap; | 1439 | goto unmap; |
1438 | dev->queue_count++; | 1440 | dev->queue_count++; |
1439 | 1441 | ||
1440 | result = nvme_dev_add(dev); | ||
1441 | if (result) | ||
1442 | goto delete; | ||
1443 | |||
1444 | spin_lock(&dev_list_lock); | 1442 | spin_lock(&dev_list_lock); |
1445 | list_add(&dev->node, &dev_list); | 1443 | list_add(&dev->node, &dev_list); |
1446 | spin_unlock(&dev_list_lock); | 1444 | spin_unlock(&dev_list_lock); |
1447 | 1445 | ||
1446 | result = nvme_dev_add(dev); | ||
1447 | if (result) | ||
1448 | goto delete; | ||
1449 | |||
1448 | return 0; | 1450 | return 0; |
1449 | 1451 | ||
1450 | delete: | 1452 | delete: |
1453 | spin_lock(&dev_list_lock); | ||
1454 | list_del(&dev->node); | ||
1455 | spin_unlock(&dev_list_lock); | ||
1456 | |||
1451 | nvme_free_queues(dev); | 1457 | nvme_free_queues(dev); |
1452 | unmap: | 1458 | unmap: |
1453 | iounmap(dev->bar); | 1459 | iounmap(dev->bar); |