linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] scsi: ufs: Fix interrupt error message for shared interrupts
@ 2020-08-10 13:55 Adrian Hunter
  2020-08-10 13:55 ` [PATCH 2/2] scsi: ufs: Improve interrupt handling " Adrian Hunter
  2020-08-11 12:20 ` [PATCH 1/2] scsi: ufs: Fix interrupt error message " Avri Altman
  0 siblings, 2 replies; 3+ messages in thread
From: Adrian Hunter @ 2020-08-10 13:55 UTC (permalink / raw)
  To: Martin K . Petersen, James E . J . Bottomley
  Cc: linux-scsi, linux-kernel, Alim Akhtar, Avri Altman,
	Venkat Gopalakrishnan, Can Guo

The interrupt might be shared, in which case it is not an error for the
interrupt handler to be called when the interrupt status is zero, so
remove the message print and register dump.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Fixes: 9333d77573485 ("scsi: ufs: Fix irq return code")
---
 drivers/scsi/ufs/ufshcd.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index cdcf56679b41..d7522dba4dcf 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5994,12 +5994,6 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
 		intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
 	} while (intr_status && --retries);
 
-	if (retval == IRQ_NONE) {
-		dev_err(hba->dev, "%s: Unhandled interrupt 0x%08x\n",
-					__func__, intr_status);
-		ufshcd_dump_regs(hba, 0, UFSHCI_REG_SPACE_SIZE, "host_regs: ");
-	}
-
 	spin_unlock(hba->host->host_lock);
 	return retval;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] scsi: ufs: Improve interrupt handling for shared interrupts
  2020-08-10 13:55 [PATCH 1/2] scsi: ufs: Fix interrupt error message for shared interrupts Adrian Hunter
@ 2020-08-10 13:55 ` Adrian Hunter
  2020-08-11 12:20 ` [PATCH 1/2] scsi: ufs: Fix interrupt error message " Avri Altman
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2020-08-10 13:55 UTC (permalink / raw)
  To: Martin K . Petersen, James E . J . Bottomley
  Cc: linux-scsi, linux-kernel, Alim Akhtar, Avri Altman,
	Venkat Gopalakrishnan, Can Guo

For shared interrupts, the interrupt status might be zero, so check that
first.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/scsi/ufs/ufshcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index d7522dba4dcf..fd006340f37a 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5983,7 +5983,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
 	 * read, make sure we handle them by checking the interrupt status
 	 * again in a loop until we process all of the reqs before returning.
 	 */
-	do {
+	while (intr_status && retries--) {
 		enabled_intr_status =
 			intr_status & ufshcd_readl(hba, REG_INTERRUPT_ENABLE);
 		if (intr_status)
@@ -5992,7 +5992,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
 			retval |= ufshcd_sl_intr(hba, enabled_intr_status);
 
 		intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
-	} while (intr_status && --retries);
+	}
 
 	spin_unlock(hba->host->host_lock);
 	return retval;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH 1/2] scsi: ufs: Fix interrupt error message for shared interrupts
  2020-08-10 13:55 [PATCH 1/2] scsi: ufs: Fix interrupt error message for shared interrupts Adrian Hunter
  2020-08-10 13:55 ` [PATCH 2/2] scsi: ufs: Improve interrupt handling " Adrian Hunter
@ 2020-08-11 12:20 ` Avri Altman
  1 sibling, 0 replies; 3+ messages in thread
From: Avri Altman @ 2020-08-11 12:20 UTC (permalink / raw)
  To: Adrian Hunter, Martin K . Petersen, James E . J . Bottomley
  Cc: linux-scsi, linux-kernel, Alim Akhtar, Venkat Gopalakrishnan, Can Guo

 
> The interrupt might be shared, in which case it is not an error for the
> interrupt handler to be called when the interrupt status is zero, so
> remove the message print and register dump.
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> Fixes: 9333d77573485 ("scsi: ufs: Fix irq return code")
> ---
>  drivers/scsi/ufs/ufshcd.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index cdcf56679b41..d7522dba4dcf 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -5994,12 +5994,6 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
>                 intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
>         } while (intr_status && --retries);
> 
> -       if (retval == IRQ_NONE) {
Maybe    if (enabled_intr_status && retval == IRQ_NONE) { ?

Thanks,
Avri

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-11 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10 13:55 [PATCH 1/2] scsi: ufs: Fix interrupt error message for shared interrupts Adrian Hunter
2020-08-10 13:55 ` [PATCH 2/2] scsi: ufs: Improve interrupt handling " Adrian Hunter
2020-08-11 12:20 ` [PATCH 1/2] scsi: ufs: Fix interrupt error message " Avri Altman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).