From 40d2fd05ecc2b63d1bd8f6686f09941afe85edfe Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 19 May 2021 13:20:57 -0700 Subject: [PATCH] scsi: ufs: Suppress false positive unhandled interrupt messages From ufshcd_transfer_req_compl(): Resetting interrupt aggregation counters first and reading the DOOR_BELL afterward allows us to handle all the completed requests. In order to prevent other interrupts starvation the DB is read once after reset. The down side of this solution is the possibility of false interrupt if device completes another request after resetting aggregation and before reading the DB. Prevent that ufshcd_intr() reports a false positive "Unhandled interrupt" message if the above scenario is triggered. Link: https://lore.kernel.org/r/20210519202058.12634-2-bvanassche@acm.org Cc: Stanley Chu Cc: Can Guo Cc: Bean Huo Cc: Jaegeuk Kim Cc: Asutosh Das Suggested-by: Jaegeuk Kim Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- drivers/scsi/ufs/ufshcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index c382260e0cf7e..af527e77fe66a 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6453,7 +6453,8 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba) } if (enabled_intr_status && retval == IRQ_NONE && - !ufshcd_eh_in_progress(hba)) { + (!(enabled_intr_status & UTP_TRANSFER_REQ_COMPL) || + hba->outstanding_reqs) && !ufshcd_eh_in_progress(hba)) { dev_err(hba->dev, "%s: Unhandled interrupt 0x%08x (0x%08x, 0x%08x)\n", __func__, intr_status,