All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: "James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Can Guo <cang@codeaurora.org>, Bean Huo <beanhuo@micron.com>,
	Asutosh Das <asutoshd@codeaurora.org>
Subject: [PATCH 1/2] ufs: Suppress false positive unhandled interrupt messages
Date: Wed, 19 May 2021 13:20:57 -0700	[thread overview]
Message-ID: <20210519202058.12634-2-bvanassche@acm.org> (raw)
In-Reply-To: <20210519202058.12634-1-bvanassche@acm.org>

From ufshcd_transfer_req_compl():
<quote>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.</quote>

This patch prevents that ufshcd_intr() reports a false positive
"Unhandled interrupt" message if the above scenario is triggered.

Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Can Guo <cang@codeaurora.org>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Asutosh Das <asutoshd@codeaurora.org>
Suggested-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 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 c541b6953863..d330eae02890 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6454,7 +6454,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,

  reply	other threads:[~2021-05-19 20:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 20:20 [PATCH 0/2] Two additional UFS patches Bart Van Assche
2021-05-19 20:20 ` Bart Van Assche [this message]
2021-05-19 20:20 ` [PATCH 2/2] ufs: Use designated initializers in ufs_pm_lvl_states[] Bart Van Assche
2021-05-21 21:10 ` [PATCH 0/2] Two additional UFS patches Martin K. Petersen
2021-05-26  4:07 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210519202058.12634-2-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=asutoshd@codeaurora.org \
    --cc=beanhuo@micron.com \
    --cc=cang@codeaurora.org \
    --cc=jaegeuk@kernel.org \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.