]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
scsi: ufs: Improve interrupt handling for shared interrupts
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 11 Aug 2020 13:39:36 +0000 (16:39 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 18 Aug 2020 02:03:29 +0000 (22:03 -0400)
For shared interrupts, the interrupt status might be zero, so check that
first.

Link: https://lore.kernel.org/r/20200811133936.19171-2-adrian.hunter@intel.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c

index 22f801428a07fab17a18d1f03ec21190f65a61aa..0af3dd37ae6f7ea99478e90f3a0f23547239d1a7 100644 (file)
@@ -5944,7 +5944,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;
@@ -5958,7 +5958,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)
@@ -5967,7 +5967,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",