Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c
- index 9b260a2a51ba..126df7d10ee7 100644
- --- a/drivers/nvme/host/apple.c
- +++ b/drivers/nvme/host/apple.c
- @@ -635,15 +636,20 @@ static bool apple_nvme_poll_cq(struct apple_nvme_queue *q,
- return found;
- }
- +static bool __apple_nvme_handle_cq(struct apple_nvme_queue *q,
- + struct io_comp_batch *iob)
- +{
- + if (READ_ONCE(q->enabled))
- + return apple_nvme_poll_cq(q, iob);
- + return false;
- +}
- +
- static bool apple_nvme_handle_cq(struct apple_nvme_queue *q, bool force)
- {
- bool found;
- DEFINE_IO_COMP_BATCH(iob);
- - if (!READ_ONCE(q->enabled) && !force)
- - return false;
- -
- - found = apple_nvme_poll_cq(q, &iob);
- + found = __apple_nvme_handle_cq(q, &iob);
- if (!rq_list_empty(iob.req_list))
- apple_nvme_complete_batch(&iob);
- @@ -654,16 +660,18 @@ static bool apple_nvme_handle_cq(struct apple_nvme_queue *q, bool force)
- static irqreturn_t apple_nvme_irq(int irq, void *data)
- {
- struct apple_nvme *anv = data;
- - bool handled = false;
- + DEFINE_IO_COMP_BATCH(iob);
- unsigned long flags;
- + bool handled;
- spin_lock_irqsave(&anv->lock, flags);
- - if (apple_nvme_handle_cq(&anv->ioq, false))
- - handled = true;
- - if (apple_nvme_handle_cq(&anv->adminq, false))
- - handled = true;
- + handled = __apple_nvme_handle_cq(&anv->ioq, &iob);
- + handled |= __apple_nvme_handle_cq(&anv->adminq, &iob);
- spin_unlock_irqrestore(&anv->lock, flags);
- + if (!rq_list_empty(iob.req_list))
- + apple_nvme_complete_batch(&iob);
- +
- if (handled)
- return IRQ_HANDLED;
- return IRQ_NONE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement