Skip to contentSkip to conversation

scsi: ufs: add wmb after clear interrupt status

PATCH New [email protected] 1 participant 1 message Oct 1, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ufs: add wmb after clear interrupt status

From: Peter Wang <[email protected]>

Write IS(0x20) to clear interrupts should be done before read UTRLDBR(0x58) or UTRLCNR(0x64).
If optimize lead to read TRLDBR(0x58) or UTRLCNR(0x64) before Write IS(0x20), the final complete task may miss.

---
 drivers/scsi/ufs/ufshcd.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/scsi/ufs/ufshcd.c +4 -0
index 3841ab49f556..3318b3b6c916 100644
@@ -6492,6 +6492,10 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
 		enabled_intr_status =
 			intr_status & ufshcd_readl(hba, REG_INTERRUPT_ENABLE);
 		ufshcd_writel(hba, intr_status, REG_INTERRUPT_STATUS);
+
+		/* Make sure interrupt status are clear before service */
+		wmb();
+
 		if (enabled_intr_status)
 			retval |= ufshcd_sl_intr(hba, enabled_intr_status);
 
Signature · 1 line
2.18.0