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
don't print the message unless there was enabled interrupt status.
Signed-off-by: Adrian Hunter <[email protected]>
Fixes: 9333d77573485 ("scsi: ufs: Fix irq return code")
---
drivers/scsi/ufs/ufshcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index cdcf56679b41..bb2543010af9 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5994,7 +5994,7 @@ 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) {
+ if (enabled_intr_status && 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: ");
--
2.17.1
For shared interrupts, the interrupt status might be zero, so check that
first.
Signed-off-by: Adrian Hunter <[email protected]>
---
drivers/scsi/ufs/ufshcd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index bb2543010af9..c315420e69e8 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5969,7 +5969,7 @@ static irqreturn_t ufshcd_sl_intr(struct ufs_hba *hba, u32 intr_status)
*/
static irqreturn_t ufshcd_intr(int irq, void *__hba)
{
- u32 intr_status, enabled_intr_status;
+ u32 intr_status, enabled_intr_status = 0;
irqreturn_t retval = IRQ_NONE;
struct ufs_hba *hba = __hba;
int retries = hba->nutrs;
@@ -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);
+ }
if (enabled_intr_status && retval == IRQ_NONE) {
dev_err(hba->dev, "%s: Unhandled interrupt 0x%08x\n",
--
2.17.1
>
> 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
> don't print the message unless there was enabled interrupt status.
>
> Signed-off-by: Adrian Hunter <[email protected]>
> Fixes: 9333d77573485 ("scsi: ufs: Fix irq return code")
Reviewed-by: Avri Altman <[email protected]>
>
> For shared interrupts, the interrupt status might be zero, so check that
> first.
>
> Signed-off-by: Adrian Hunter <[email protected]>
Reviewed-by: Avri Altman <[email protected]>
On Tue, 11 Aug 2020 16:39:35 +0300, Adrian Hunter wrote:
> 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
> don't print the message unless there was enabled interrupt status.
Applied to 5.9/scsi-fixes, thanks!
[1/2] scsi: ufs: Fix interrupt error message for shared interrupts
https://git.kernel.org/mkp/scsi/c/6337f58cec03
[2/2] scsi: ufs: Improve interrupt handling for shared interrupts
https://git.kernel.org/mkp/scsi/c/127d5f7c4b65
--
Martin K. Petersen Oracle Linux Engineering