From: Matthew R. Ochs Date: Wed, 12 Apr 2017 19:11:44 +0000 (-0500) Subject: scsi: cxlflash: Separate RRQ processing from the RRQ interrupt handler X-Git-Tag: v4.12-rc1~99^2~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76a6ebbeef26b004c36a0c8ee0496bae5428fc31;p=platform%2Fkernel%2Flinux-exynos.git scsi: cxlflash: Separate RRQ processing from the RRQ interrupt handler 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 Signed-off-by: Uma Krishnan Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 3061d80..30c0959 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -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; }