Skip to content

Commit c4ad4f2

Browse files
powen-kao-mtkmartinkpetersen
authored andcommitted
scsi: ufs: core: Add host quirk UFSHCD_QUIRK_MCQ_BROKEN_INTR
Quirk UFSHCD_QUIRK_MCQ_BROKEN_INTR is introduced for hosts that implement a different interrupt topology from the UFSHCI 4.0 spec. Some hosts raise per hw queue interrupt in addition to CQES (traditional) when ESI is disabled. Enabling this quirk will disable CQES and use only per hw queue interrupt. Signed-off-by: Po-Wen Kao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Stanley Chu <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent ccb23dc commit c4ad4f2

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

drivers/ufs/core/ufshcd.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -8612,11 +8612,15 @@ static int ufshcd_alloc_mcq(struct ufs_hba *hba)
86128612
static void ufshcd_config_mcq(struct ufs_hba *hba)
86138613
{
86148614
int ret;
8615+
u32 intrs;
86158616

86168617
ret = ufshcd_mcq_vops_config_esi(hba);
86178618
dev_info(hba->dev, "ESI %sconfigured\n", ret ? "is not " : "");
86188619

8619-
ufshcd_enable_intr(hba, UFSHCD_ENABLE_MCQ_INTRS);
8620+
intrs = UFSHCD_ENABLE_MCQ_INTRS;
8621+
if (hba->quirks & UFSHCD_QUIRK_MCQ_BROKEN_INTR)
8622+
intrs &= ~MCQ_CQ_EVENT_STATUS;
8623+
ufshcd_enable_intr(hba, intrs);
86208624
ufshcd_mcq_make_queues_operational(hba);
86218625
ufshcd_mcq_config_mac(hba, hba->nutrs);
86228626

include/ufs/ufshcd.h

+7
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,13 @@ enum ufshcd_quirks {
610610
* to reinit the device after switching to maximum gear.
611611
*/
612612
UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH = 1 << 19,
613+
614+
/*
615+
* Some host raises interrupt (per queue) in addition to
616+
* CQES (traditional) when ESI is disabled.
617+
* Enable this quirk will disable CQES and use per queue interrupt.
618+
*/
619+
UFSHCD_QUIRK_MCQ_BROKEN_INTR = 1 << 20,
613620
};
614621

615622
enum ufshcd_caps {

0 commit comments

Comments
 (0)