Skip to contentSkip to conversation

scsi: ufs: Fix interrupt error message for shared interrupts

PATCH Superseded Adrian Hunter 2 participants 3 messages Aug 10, 2020 – Aug 11, 2020 SCSI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 scsi: ufs: Fix interrupt error message for shared interrupts

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.

Fixes 9333d77573485 ("scsi: ufs: Fix irq return code")
---
 drivers/scsi/ufs/ufshcd.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/scsi/ufs/ufshcd.c +0 -6
index cdcf56679b41..d7522dba4dcf 100644
@@ -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;
 }
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 scsi: ufs: Improve interrupt handling for shared interrupts

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

---
 drivers/scsi/ufs/ufshcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +2 -2
index d7522dba4dcf..fd006340f37a 100644
@@ -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;
Signature · 1 line
2.17.1
#2 lore raw
In reply to Adrian Hunter
Quoted 16 lines

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.

Fixes 9333d77573485 ("scsi: ufs: Fix irq return code")
---
 drivers/scsi/ufs/ufshcd.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/scsi/ufs/ufshcd.c +0 -0
index cdcf56679b41..d7522dba4dcf 100644

drivers/scsi/ufs/ufshcd.c static irqreturn_t ufshcd_intr(int irq, void *__hba) · line 5997

Quoted 4 lines
drivers/scsi/ufs/ufshcd.c +0 -1
@@ -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