ufs: core: Fix interrupt handling
Subsystems (2)
Bart Van Assche
reviewerPATCH 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
---
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
@@ -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)