Commit 31871fb7 authored by Adrian Hunter's avatar Adrian Hunter Committed by Greg Kroah-Hartman

scsi: ufs: Improve interrupt handling for shared interrupts

[ Upstream commit 127d5f7c ]

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.comReviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 8f76a208
...@@ -5605,7 +5605,7 @@ static void ufshcd_sl_intr(struct ufs_hba *hba, u32 intr_status) ...@@ -5605,7 +5605,7 @@ static void ufshcd_sl_intr(struct ufs_hba *hba, u32 intr_status)
*/ */
static irqreturn_t ufshcd_intr(int irq, void *__hba) 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; irqreturn_t retval = IRQ_NONE;
struct ufs_hba *hba = __hba; struct ufs_hba *hba = __hba;
int retries = hba->nutrs; int retries = hba->nutrs;
...@@ -5619,7 +5619,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba) ...@@ -5619,7 +5619,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
* read, make sure we handle them by checking the interrupt status * read, make sure we handle them by checking the interrupt status
* again in a loop until we process all of the reqs before returning. * again in a loop until we process all of the reqs before returning.
*/ */
do { while (intr_status && retries--) {
enabled_intr_status = enabled_intr_status =
intr_status & ufshcd_readl(hba, REG_INTERRUPT_ENABLE); intr_status & ufshcd_readl(hba, REG_INTERRUPT_ENABLE);
if (intr_status) if (intr_status)
...@@ -5630,7 +5630,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba) ...@@ -5630,7 +5630,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
} }
intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS); intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
} while (intr_status && --retries); }
spin_unlock(hba->host->host_lock); spin_unlock(hba->host->host_lock);
return retval; return retval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment