]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: ufs: core: Add host quirk UFSHCD_QUIRK_MCQ_BROKEN_INTR
authorPo-Wen Kao <powen.kao@mediatek.com>
Mon, 12 Jun 2023 08:58:09 +0000 (16:58 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 16 Jun 2023 16:04:30 +0000 (12:04 -0400)
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 <powen.kao@mediatek.com>
Link: https://lore.kernel.org/r/20230612085817.12275-2-powen.kao@mediatek.com
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c
include/ufs/ufshcd.h

index a1d009ad5f2650f19a4f9debb5999e28837a12cf..358b3240b6c5aba7525f1dda240f152b8371b638 100644 (file)
@@ -8612,11 +8612,15 @@ err:
 static void ufshcd_config_mcq(struct ufs_hba *hba)
 {
        int ret;
+       u32 intrs;
 
        ret = ufshcd_mcq_vops_config_esi(hba);
        dev_info(hba->dev, "ESI %sconfigured\n", ret ? "is not " : "");
 
-       ufshcd_enable_intr(hba, UFSHCD_ENABLE_MCQ_INTRS);
+       intrs = UFSHCD_ENABLE_MCQ_INTRS;
+       if (hba->quirks & UFSHCD_QUIRK_MCQ_BROKEN_INTR)
+               intrs &= ~MCQ_CQ_EVENT_STATUS;
+       ufshcd_enable_intr(hba, intrs);
        ufshcd_mcq_make_queues_operational(hba);
        ufshcd_mcq_config_mac(hba, hba->nutrs);
 
index 92f073bda405a3d619ff70afeefeb739b81d1986..5dc37e47f399add3b434923c3ded119bb3c05d48 100644 (file)
@@ -610,6 +610,13 @@ enum ufshcd_quirks {
         * to reinit the device after switching to maximum gear.
         */
        UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH       = 1 << 19,
+
+       /*
+        * Some host raises interrupt (per queue) in addition to
+        * CQES (traditional) when ESI is disabled.
+        * Enable this quirk will disable CQES and use per queue interrupt.
+        */
+       UFSHCD_QUIRK_MCQ_BROKEN_INTR                    = 1 << 20,
 };
 
 enum ufshcd_caps {