]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - drivers/nvme/host/pci.c
blk-mq: when polling for IO, look for any completion
[thirdparty/kernel/stable.git] / drivers / nvme / host / pci.c
index 57e790391b82add712aa7f35eb6ef7e06076562c..de50d80ecc847cd442f4429797fe68d499d74de7 100644 (file)
@@ -1012,15 +1012,15 @@ static inline void nvme_update_cq_head(struct nvme_queue *nvmeq)
        }
 }
 
-static inline bool nvme_process_cq(struct nvme_queue *nvmeq, u16 *start,
-               u16 *end, int tag)
+static inline int nvme_process_cq(struct nvme_queue *nvmeq, u16 *start,
+                                 u16 *end, unsigned int tag)
 {
-       bool found = false;
+       int found = 0;
 
        *start = nvmeq->cq_head;
-       while (!found && nvme_cqe_pending(nvmeq)) {
-               if (nvmeq->cqes[nvmeq->cq_head].command_id == tag)
-                       found = true;
+       while (nvme_cqe_pending(nvmeq)) {
+               if (tag == -1U || nvmeq->cqes[nvmeq->cq_head].command_id == tag)
+                       found++;
                nvme_update_cq_head(nvmeq);
        }
        *end = nvmeq->cq_head;
@@ -1062,7 +1062,7 @@ static irqreturn_t nvme_irq_check(int irq, void *data)
 static int __nvme_poll(struct nvme_queue *nvmeq, unsigned int tag)
 {
        u16 start, end;
-       bool found;
+       int found;
 
        if (!nvme_cqe_pending(nvmeq))
                return 0;