]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
scsi: cxlflash: Separate RRQ processing from the RRQ interrupt handler
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Fri, 7 Jul 2017 16:05:20 +0000 (13:05 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 14 Jul 2017 14:32:54 +0000 (11:32 -0300)
BugLink: http://bugs.launchpad.net/bugs/1702521
In order to support processing the HRRQ by other means (e.g. polling), the
processing portion of the current RRQ interrupt handler needs to be broken out
into a separate routine. This will allow RRQ processing from places other than
the RRQ hardware interrupt handler.

Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 76a6ebbeef26b004c36a0c8ee0496bae5428fc31)
Signed-off-by: Victor Aoqui <victora@linux.vnet.ibm.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/scsi/cxlflash/main.c

index 3061d8045382e437b445d025b2c2910fb15c7a96..30c09593c12223fbc588438b9742e334d6f6d04e 100644 (file)
@@ -1155,19 +1155,18 @@ cxlflash_sync_err_irq_exit:
 }
 
 /**
- * cxlflash_rrq_irq() - interrupt handler for read-response queue (normal path)
- * @irq:       Interrupt number.
- * @data:      Private data provided at interrupt registration, the AFU.
+ * process_hrrq() - process the read-response queue
+ * @afu:       AFU associated with the host.
  *
- * Return: Always return IRQ_HANDLED.
+ * Return: The number of entries processed.
  */
-static irqreturn_t cxlflash_rrq_irq(int irq, void *data)
+static int process_hrrq(struct afu *afu)
 {
-       struct afu *afu = (struct afu *)data;
        struct afu_cmd *cmd;
        struct sisl_ioasa *ioasa;
        struct sisl_ioarcb *ioarcb;
        bool toggle = afu->toggle;
+       int num_hrrq = 0;
        u64 entry,
            *hrrq_start = afu->hrrq_start,
            *hrrq_end = afu->hrrq_end,
@@ -1201,11 +1200,27 @@ static irqreturn_t cxlflash_rrq_irq(int irq, void *data)
                }
 
                atomic_inc(&afu->hsq_credits);
+               num_hrrq++;
        }
 
        afu->hrrq_curr = hrrq_curr;
        afu->toggle = toggle;
 
+       return num_hrrq;
+}
+
+/**
+ * cxlflash_rrq_irq() - interrupt handler for read-response queue (normal path)
+ * @irq:       Interrupt number.
+ * @data:      Private data provided at interrupt registration, the AFU.
+ *
+ * Return: Always return IRQ_HANDLED.
+ */
+static irqreturn_t cxlflash_rrq_irq(int irq, void *data)
+{
+       struct afu *afu = (struct afu *)data;
+
+       process_hrrq(afu);
        return IRQ_HANDLED;
 }