Skip to content

Commit 127d5f7

Browse files
ahunter6martinkpetersen
authored andcommitted
scsi: ufs: Improve interrupt handling for shared interrupts
For shared interrupts, the interrupt status might be zero, so check that first. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 6337f58 commit 127d5f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/scsi/ufs/ufshcd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5944,7 +5944,7 @@ static irqreturn_t ufshcd_sl_intr(struct ufs_hba *hba, u32 intr_status)
59445944
*/
59455945
static irqreturn_t ufshcd_intr(int irq, void *__hba)
59465946
{
5947-
u32 intr_status, enabled_intr_status;
5947+
u32 intr_status, enabled_intr_status = 0;
59485948
irqreturn_t retval = IRQ_NONE;
59495949
struct ufs_hba *hba = __hba;
59505950
int retries = hba->nutrs;
@@ -5958,7 +5958,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
59585958
* read, make sure we handle them by checking the interrupt status
59595959
* again in a loop until we process all of the reqs before returning.
59605960
*/
5961-
do {
5961+
while (intr_status && retries--) {
59625962
enabled_intr_status =
59635963
intr_status & ufshcd_readl(hba, REG_INTERRUPT_ENABLE);
59645964
if (intr_status)
@@ -5967,7 +5967,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
59675967
retval |= ufshcd_sl_intr(hba, enabled_intr_status);
59685968

59695969
intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
5970-
} while (intr_status && --retries);
5970+
}
59715971

59725972
if (enabled_intr_status && retval == IRQ_NONE) {
59735973
dev_err(hba->dev, "%s: Unhandled interrupt 0x%08x\n",

0 commit comments

Comments
 (0)