* [PATCH] NVMe: Fix irq freeing when queue_request_irq fails
@ 2015-06-30 17:22 Jon Derrick
2015-07-02 15:03 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Jon Derrick @ 2015-06-30 17:22 UTC (permalink / raw)
Fixes an issue when queue_reuest_irq fails in nvme_setup_io_queues. This
patch initializes all vectors to -1 and resets the vector to -1 in the
case of a failure in queue_request_irq. This avoids the free_irq in
nvme_suspend_queue if the queue did not get an irq.
Signed-off-by: Jon Derrick <jonathan.derrick at intel.com>
---
drivers/block/nvme-core.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 34338d7..d1d6141 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1474,6 +1474,7 @@ static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev, int qid,
nvmeq->q_db = &dev->dbs[qid * 2 * dev->db_stride];
nvmeq->q_depth = depth;
nvmeq->qid = qid;
+ nvmeq->cq_vector = -1;
dev->queues[qid] = nvmeq;
/* make sure queue descriptor is set before queue count, for kthread */
@@ -1726,8 +1727,10 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev)
nvmeq->cq_vector = 0;
result = queue_request_irq(dev, nvmeq, nvmeq->irqname);
- if (result)
+ if (result) {
+ nvmeq->cq_vector = -1;
goto free_nvmeq;
+ }
return result;
@@ -2213,8 +2216,10 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
dev->max_qid = nr_io_queues;
result = queue_request_irq(dev, adminq, adminq->irqname);
- if (result)
+ if (result) {
+ adminq->cq_vector = -1;
goto free_queues;
+ }
/* Free previously allocated queues that are no longer usable */
nvme_free_queues(dev, nr_io_queues + 1);
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] NVMe: Fix irq freeing when queue_request_irq fails
2015-06-30 17:22 [PATCH] NVMe: Fix irq freeing when queue_request_irq fails Jon Derrick
@ 2015-07-02 15:03 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2015-07-02 15:03 UTC (permalink / raw)
On 06/30/2015 11:22 AM, Jon Derrick wrote:
> Fixes an issue when queue_reuest_irq fails in nvme_setup_io_queues. This
> patch initializes all vectors to -1 and resets the vector to -1 in the
> case of a failure in queue_request_irq. This avoids the free_irq in
> nvme_suspend_queue if the queue did not get an irq.
Looks good to me, added for this series.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-02 15:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-30 17:22 [PATCH] NVMe: Fix irq freeing when queue_request_irq fails Jon Derrick
2015-07-02 15:03 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox