提交 3193f07b 编写于 作者: M Matthew Wilcox

NVMe: Include device and queue numbers in interrupt name

On larger systems with many drives, it may help debugging to know which
queue is tied to which interrupt, just by looking at /proc/interrupts.
Signed-off-by: NMatthew Wilcox <matthew.r.wilcox@intel.com>
上级 09ece142
...@@ -76,6 +76,7 @@ struct async_cmd_info { ...@@ -76,6 +76,7 @@ struct async_cmd_info {
struct nvme_queue { struct nvme_queue {
struct device *q_dmadev; struct device *q_dmadev;
struct nvme_dev *dev; struct nvme_dev *dev;
char irqname[24]; /* nvme4294967295-65535\0 */
spinlock_t q_lock; spinlock_t q_lock;
struct nvme_command *sq_cmds; struct nvme_command *sq_cmds;
volatile struct nvme_completion *cqes; volatile struct nvme_completion *cqes;
...@@ -1235,6 +1236,8 @@ static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev, int qid, ...@@ -1235,6 +1236,8 @@ static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev, int qid,
nvmeq->q_dmadev = dmadev; nvmeq->q_dmadev = dmadev;
nvmeq->dev = dev; nvmeq->dev = dev;
snprintf(nvmeq->irqname, sizeof(nvmeq->irqname), "nvme%dq%d",
dev->instance, qid);
spin_lock_init(&nvmeq->q_lock); spin_lock_init(&nvmeq->q_lock);
nvmeq->cq_head = 0; nvmeq->cq_head = 0;
nvmeq->cq_phase = 1; nvmeq->cq_phase = 1;
...@@ -1297,7 +1300,7 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid) ...@@ -1297,7 +1300,7 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid)
if (result < 0) if (result < 0)
goto release_cq; goto release_cq;
result = queue_request_irq(dev, nvmeq, "nvme"); result = queue_request_irq(dev, nvmeq, nvmeq->irqname);
if (result < 0) if (result < 0)
goto release_sq; goto release_sq;
...@@ -1415,7 +1418,7 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) ...@@ -1415,7 +1418,7 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev)
if (result) if (result)
return result; return result;
result = queue_request_irq(dev, nvmeq, "nvme admin"); result = queue_request_irq(dev, nvmeq, nvmeq->irqname);
if (result) if (result)
return result; return result;
...@@ -1873,6 +1876,7 @@ static size_t db_bar_size(struct nvme_dev *dev, unsigned nr_io_queues) ...@@ -1873,6 +1876,7 @@ static size_t db_bar_size(struct nvme_dev *dev, unsigned nr_io_queues)
static int nvme_setup_io_queues(struct nvme_dev *dev) static int nvme_setup_io_queues(struct nvme_dev *dev)
{ {
struct nvme_queue *adminq = dev->queues[0];
struct pci_dev *pdev = dev->pci_dev; struct pci_dev *pdev = dev->pci_dev;
int result, cpu, i, vecs, nr_io_queues, size, q_depth; int result, cpu, i, vecs, nr_io_queues, size, q_depth;
...@@ -1899,7 +1903,7 @@ static int nvme_setup_io_queues(struct nvme_dev *dev) ...@@ -1899,7 +1903,7 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
} }
/* Deregister the admin queue's interrupt */ /* Deregister the admin queue's interrupt */
free_irq(dev->entry[0].vector, dev->queues[0]); free_irq(dev->entry[0].vector, adminq);
vecs = nr_io_queues; vecs = nr_io_queues;
for (i = 0; i < vecs; i++) for (i = 0; i < vecs; i++)
...@@ -1937,9 +1941,9 @@ static int nvme_setup_io_queues(struct nvme_dev *dev) ...@@ -1937,9 +1941,9 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
*/ */
nr_io_queues = vecs; nr_io_queues = vecs;
result = queue_request_irq(dev, dev->queues[0], "nvme admin"); result = queue_request_irq(dev, adminq, adminq->irqname);
if (result) { if (result) {
dev->queues[0]->q_suspended = 1; adminq->q_suspended = 1;
goto free_queues; goto free_queues;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册