From: Matthew Wilcox Date: Sun, 6 Feb 2011 14:01:00 +0000 (-0500) Subject: NVMe: Need to lock queue during interrupt handling X-Git-Tag: upstream/snapshot3+hdmi~6630^2~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec6ce618d65b5ce1bef83a5509255107a0feac44;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 --- diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index f4085d4..139e6fc 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) static irqreturn_t nvme_irq(int irq, void *data) { - return nvme_process_cq(data); -} - -static irqreturn_t nvme_irq_thread(int irq, void *data) -{ irqreturn_t result; struct nvme_queue *nvmeq = data; spin_lock(&nvmeq->q_lock); @@ -676,7 +671,7 @@ static int queue_request_irq(struct nvme_dev *dev, struct nvme_queue *nvmeq, { if (use_threaded_interrupts) return request_threaded_irq(dev->entry[nvmeq->cq_vector].vector, - nvme_irq_check, nvme_irq_thread, + nvme_irq_check, nvme_irq, IRQF_DISABLED | IRQF_SHARED, name, nvmeq); return request_irq(dev->entry[nvmeq->cq_vector].vector, nvme_irq,