Skip to contentSkip to conversation

ufs: core: Fix interrupt handling

PATCH New Bart Van Assche 1 participant 1 message Jul 29, 2025

Subsystems (2)
lore
Share & tools
lore

Bart Van Assche

author reviewer
#0 lore raw

PATCH v2 1/1 ufs: core: Fix interrupt handling

Commit 3c7ac40d7322 ("scsi: ufs: core: Delegate the interrupt service routine to a threaded IRQ handler") introduced a regression in the interrupt handler. The UFS interrupt status register (IS) is read but not cleared. This leads to later events not being handled because UFS host controllers only trigger an interrupt if a bit in the interrupt status register changes from 0 into 1. Fix this by clearing the bits in the interrupt status register for events that will be processed by the interrupt handler.

This fixes continuous auto hibern8 enter errors and a boot failure for systems with a Qualcomm UFS host controller:

ufshcd_check_errors: Auto Hibern8 Enter failed - status: 0x00000040, upmcrs: 0x00000001

This fixes the following issues that have been observed on a Pixel development board:
* An "irq ...: nobody cared" complaint during boot.
* Not handling a SCSI command in time, resulting in the following complaint:

[   41.700204][   T13] google-ufshcd 3c2d0000.ufs: ufshcd_abort: Device abort task at tag 23
[   41.700945][   T13] sd 0:0:0:0: [sda] tag#23 CDB: opcode=0x2a 2a 00 00 02 61 e5 00 00 01 00
Cc Neil Armstrong <[email protected]>
Cc André Draszik <[email protected]>
Cc Palash Kambar <[email protected]>
Cc Nitin Rawat <[email protected]>
Cc Manivannan Sadhasivam <[email protected]>
Fixes 3c7ac40d7322 ("scsi: ufs: core: Delegate the interrupt service routine to a threaded IRQ handler")

---

Changes compared to v1: elaborated the patch description.

 drivers/ufs/core/ufshcd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/ufs/core/ufshcd.c +1 -2
index 77768bf722fa..7f4651b570be 100644
@@ -7137,8 +7137,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)
 		return IRQ_WAKE_THREAD;
 
 	/* Directly handle interrupts since MCQ ESI handlers does the hard job */
-	return ufshcd_sl_intr(hba, ufshcd_readl(hba, REG_INTERRUPT_STATUS) &
-				   ufshcd_readl(hba, REG_INTERRUPT_ENABLE));
+	return ufshcd_threaded_intr(irq, hba);
 }
 
 static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag)