Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286247
b: refs/heads/master
c: 58ffacb
h: refs/heads/master
i:
  286245: 2ec265b
  286243: a53e402
  286239: 7ba2c60
v: v3
  • Loading branch information
Matthew Wilcox committed Nov 4, 2011
1 parent e302af5 commit 19dc7dd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1ad37efcafe396ac3944853589688dd0ec3c64e
refs/heads/master: 58ffacb545f76fc2c65d1fbfa5acf5184a2a09e6
27 changes: 27 additions & 0 deletions trunk/drivers/block/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
static int nvme_major;
module_param(nvme_major, int, 0);

static int use_threaded_interrupts;
module_param(use_threaded_interrupts, int, 0);

/*
* Represents an NVM Express device. Each nvme_dev is a PCI function.
*/
Expand Down Expand Up @@ -455,6 +458,25 @@ 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);
result = nvme_process_cq(nvmeq);
spin_unlock(&nvmeq->q_lock);
return result;
}

static irqreturn_t nvme_irq_check(int irq, void *data)
{
struct nvme_queue *nvmeq = data;
struct nvme_completion cqe = nvmeq->cqes[nvmeq->cq_head];
if ((le16_to_cpu(cqe.status) & 1) != nvmeq->cq_phase)
return IRQ_NONE;
return IRQ_WAKE_THREAD;
}

static void nvme_abort_command(struct nvme_queue *nvmeq, int cmdid)
{
spin_lock_irq(&nvmeq->q_lock);
Expand Down Expand Up @@ -630,6 +652,11 @@ static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev, int qid,
static int queue_request_irq(struct nvme_dev *dev, struct nvme_queue *nvmeq,
const char *name)
{
if (use_threaded_interrupts)
return request_threaded_irq(dev->entry[nvmeq->cq_vector].vector,
nvme_irq_check, nvme_irq_thread,
IRQF_DISABLED | IRQF_SHARED,
name, nvmeq);
return request_irq(dev->entry[nvmeq->cq_vector].vector, nvme_irq,
IRQF_DISABLED | IRQF_SHARED, name, nvmeq);
}
Expand Down

0 comments on commit 19dc7dd

Please sign in to comment.