diff options
author | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-02-06 09:01:00 -0500 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-11-04 15:52:56 -0400 |
commit | ec6ce618d65b5ce1bef83a5509255107a0feac44 (patch) | |
tree | c28e35b52fed671c47eae0017cb9df02f66a7d2b /drivers/block/nvme.c | |
parent | 48e3d39816416b3bf03dee3a796c0c04427c1a31 (diff) |
NVMe: Need to lock queue during interrupt handling
If we're sharing a queue between multiple CPUs and we cancel a sync I/O,
we must have the queue locked to avoid corrupting the stack of the thread
that submitted the I/O. It turns out this is the same locking that's needed
for the threaded irq handler, so share that code.
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block/nvme.c')
-rw-r--r-- | drivers/block/nvme.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index f4085d4fe0f2..139e6fc1e2a8 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c | |||
@@ -477,11 +477,6 @@ static irqreturn_t nvme_process_cq(struct nvme_queue *nvmeq) | |||
477 | 477 | ||
478 | static irqreturn_t nvme_irq(int irq, void *data) | 478 | static irqreturn_t nvme_irq(int irq, void *data) |
479 | { | 479 | { |
480 | return nvme_process_cq(data); | ||
481 | } | ||
482 | |||
483 | static irqreturn_t nvme_irq_thread(int irq, void *data) | ||
484 | { | ||
485 | irqreturn_t result; | 480 | irqreturn_t result; |
486 | struct nvme_queue *nvmeq = data; | 481 | struct nvme_queue *nvmeq = data; |
487 | spin_lock(&nvmeq->q_lock); | 482 | spin_lock(&nvmeq->q_lock); |
@@ -676,7 +671,7 @@ static int queue_request_irq(struct nvme_dev *dev, struct nvme_queue *nvmeq, | |||
676 | { | 671 | { |
677 | if (use_threaded_interrupts) | 672 | if (use_threaded_interrupts) |
678 | return request_threaded_irq(dev->entry[nvmeq->cq_vector].vector, | 673 | return request_threaded_irq(dev->entry[nvmeq->cq_vector].vector, |
679 | nvme_irq_check, nvme_irq_thread, | 674 | nvme_irq_check, nvme_irq, |
680 | IRQF_DISABLED | IRQF_SHARED, | 675 | IRQF_DISABLED | IRQF_SHARED, |
681 | name, nvmeq); | 676 | name, nvmeq); |
682 | return request_irq(dev->entry[nvmeq->cq_vector].vector, nvme_irq, | 677 | return request_irq(dev->entry[nvmeq->cq_vector].vector, nvme_irq, |