diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-10-31 13:18:49 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-11-07 09:19:31 -0700 |
commit | 8dc01a8f45db990bc2f9ff627b85076a67d1ab73 (patch) | |
tree | 91fb3d5a083d48a9bbb493a941c414368850bde7 | |
parent | a78564bbf78b6a82f81ccaa85dc0cd1ab2563a34 (diff) |
nvme: don't disable local ints for polled queuemq-maps
A polled queued doesn't trigger interrupts, so it's always safe
to grab the queue lock without disabling interrupts.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/nvme/host/pci.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 6aa86dfcb32c..341aeab24ccd 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1061,15 +1061,26 @@ static irqreturn_t nvme_irq_check(int irq, void *data) static int __nvme_poll(struct nvme_queue *nvmeq, unsigned int tag) { + unsigned long __maybe_unused flags; /* gcc 7.x fail */ u16 start, end; - bool found; + bool found, has_irq; if (!nvme_cqe_pending(nvmeq)) return 0; - spin_lock_irq(&nvmeq->cq_lock); + /* + * Polled queue doesn't have an IRQ, no need to disable ints + */ + has_irq = !nvmeq->polled; + if (has_irq) + local_irq_save(flags); + + spin_lock(&nvmeq->cq_lock); found = nvme_process_cq(nvmeq, &start, &end, tag); - spin_unlock_irq(&nvmeq->cq_lock); + spin_unlock(&nvmeq->cq_lock); + + if (has_irq) + local_irq_restore(flags); nvme_complete_cqes(nvmeq, start, end); return found; |