Skip to content

Commit a44ff97

Browse files
ptr324martinkpetersen
authored andcommitted
scsi: ufs: host: mediatek: Handle broken RTC based on DTS setting
Introduce a mechanism to handle broken RTC by checking the DTS setting. The configuration is specifically required for legacy platform. Signed-off-by: Peter Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Chun-Hung Wu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 16b30c7 commit a44ff97

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/ufs/host/ufs-mediatek.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,9 @@ static void ufs_mtk_init_host_caps(struct ufs_hba *hba)
679679
if (of_property_read_bool(np, "mediatek,ufs-rtff-mtcmos"))
680680
host->caps |= UFS_MTK_CAP_RTFF_MTCMOS;
681681

682+
if (of_property_read_bool(np, "mediatek,ufs-broken-rtc"))
683+
host->caps |= UFS_MTK_CAP_MCQ_BROKEN_RTC;
684+
682685
dev_info(hba->dev, "caps: 0x%x", host->caps);
683686
}
684687

@@ -1035,8 +1038,11 @@ static int ufs_mtk_init(struct ufs_hba *hba)
10351038
shost->rpm_autosuspend_delay = MTK_RPM_AUTOSUSPEND_DELAY_MS;
10361039

10371040
hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL;
1041+
10381042
hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_INTR;
1039-
hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_RTC;
1043+
if (host->caps & UFS_MTK_CAP_MCQ_BROKEN_RTC)
1044+
hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_RTC;
1045+
10401046
hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80);
10411047

10421048
if (host->caps & UFS_MTK_CAP_DISABLE_AH8)

drivers/ufs/host/ufs-mediatek.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ enum ufs_mtk_host_caps {
133133
UFS_MTK_CAP_DISABLE_MCQ = 1 << 8,
134134
/* Control MTCMOS with RTFF */
135135
UFS_MTK_CAP_RTFF_MTCMOS = 1 << 9,
136+
137+
UFS_MTK_CAP_MCQ_BROKEN_RTC = 1 << 10,
136138
};
137139

138140
struct ufs_mtk_crypt_cfg {

0 commit comments

Comments
 (0)