[PATCH v7 14/23] scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property

Nicolas Frattaroli posted 23 patches 1 month ago
There is a newer version of this series
[PATCH v7 14/23] scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property
Posted by Nicolas Frattaroli 1 month ago
This flag property was never described in the binding, and its
capability wrapper seems pointless.

If one of the MediaTek SoCs needs the ufshcd quirk applied, then this
can be done per-compatible, without needing to give the device tree
author the option to forget to set it.

Remove it and the associated capability flag wrapping code.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
---
 drivers/ufs/host/ufs-mediatek.c | 5 -----
 drivers/ufs/host/ufs-mediatek.h | 2 --
 2 files changed, 7 deletions(-)

diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index 230e11533eac..424533538b90 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -655,9 +655,6 @@ static void ufs_mtk_init_host_caps(struct ufs_hba *hba)
 	if (of_property_read_bool(np, "mediatek,ufs-rtff-mtcmos"))
 		host->caps |= UFS_MTK_CAP_RTFF_MTCMOS;
 
-	if (of_property_read_bool(np, "mediatek,ufs-broken-rtc"))
-		host->caps |= UFS_MTK_CAP_MCQ_BROKEN_RTC;
-
 	dev_info(hba->dev, "caps: 0x%x", host->caps);
 }
 
@@ -1185,8 +1182,6 @@ static int ufs_mtk_init(struct ufs_hba *hba)
 	hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL;
 
 	hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_INTR;
-	if (host->caps & UFS_MTK_CAP_MCQ_BROKEN_RTC)
-		hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_RTC;
 
 	hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80);
 
diff --git a/drivers/ufs/host/ufs-mediatek.h b/drivers/ufs/host/ufs-mediatek.h
index 4e6a34f4ac39..9c377745f7a0 100644
--- a/drivers/ufs/host/ufs-mediatek.h
+++ b/drivers/ufs/host/ufs-mediatek.h
@@ -138,8 +138,6 @@ enum ufs_mtk_host_caps {
 	UFS_MTK_CAP_DISABLE_MCQ                = 1 << 8,
 	/* Control MTCMOS with RTFF */
 	UFS_MTK_CAP_RTFF_MTCMOS                = 1 << 9,
-
-	UFS_MTK_CAP_MCQ_BROKEN_RTC             = 1 << 10,
 };
 
 struct ufs_mtk_crypt_cfg {

-- 
2.53.0
Re: [PATCH v7 14/23] scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property
Posted by Peter Wang (王信友) 3 weeks, 1 day ago
On Mon, 2026-02-16 at 14:37 +0100, Nicolas Frattaroli wrote:
> diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-
> mediatek.c
> index 230e11533eac..424533538b90 100644
> --- a/drivers/ufs/host/ufs-mediatek.c
> +++ b/drivers/ufs/host/ufs-mediatek.c
> @@ -655,9 +655,6 @@ static void ufs_mtk_init_host_caps(struct ufs_hba
> *hba)
>  	if (of_property_read_bool(np, "mediatek,ufs-rtff-mtcmos"))
>  		host->caps |= UFS_MTK_CAP_RTFF_MTCMOS;
>  
> -	if (of_property_read_bool(np, "mediatek,ufs-broken-rtc"))
> -		host->caps |= UFS_MTK_CAP_MCQ_BROKEN_RTC;
> -
>  	dev_info(hba->dev, "caps: 0x%x", host->caps);
>  }
>  
> @@ -1185,8 +1182,6 @@ static int ufs_mtk_init(struct ufs_hba *hba)
>  	hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL;
>  
>  	hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_INTR;
> -	if (host->caps & UFS_MTK_CAP_MCQ_BROKEN_RTC)
> -		hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_RTC;
>  

Maybe check the hardware version (host->ip_ver) 
and set UFSHCD_QUIRK_MCQ_BROKEN_RTC instead of removing it?

Thanks
Peter
Re: [PATCH v7 14/23] scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property
Posted by Nicolas Frattaroli 3 weeks ago
On Tuesday, 24 February 2026 13:43:10 Central European Standard Time Peter Wang (王信友) wrote:
> On Mon, 2026-02-16 at 14:37 +0100, Nicolas Frattaroli wrote:
> > diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-
> > mediatek.c
> > index 230e11533eac..424533538b90 100644
> > --- a/drivers/ufs/host/ufs-mediatek.c
> > +++ b/drivers/ufs/host/ufs-mediatek.c
> > @@ -655,9 +655,6 @@ static void ufs_mtk_init_host_caps(struct ufs_hba
> > *hba)
> >  	if (of_property_read_bool(np, "mediatek,ufs-rtff-mtcmos"))
> >  		host->caps |= UFS_MTK_CAP_RTFF_MTCMOS;
> >  
> > -	if (of_property_read_bool(np, "mediatek,ufs-broken-rtc"))
> > -		host->caps |= UFS_MTK_CAP_MCQ_BROKEN_RTC;
> > -
> >  	dev_info(hba->dev, "caps: 0x%x", host->caps);
> >  }
> >  
> > @@ -1185,8 +1182,6 @@ static int ufs_mtk_init(struct ufs_hba *hba)
> >  	hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL;
> >  
> >  	hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_INTR;
> > -	if (host->caps & UFS_MTK_CAP_MCQ_BROKEN_RTC)
> > -		hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_RTC;
> >  
> 
> Maybe check the hardware version (host->ip_ver) 
> and set UFSHCD_QUIRK_MCQ_BROKEN_RTC instead of removing it?

I do not have access to a complete list of hardware IP versions
that need this quirk applied. No upstream DTs seem to use it.

If MediaTek wants the quirk back, you can submit a patch to apply
it based on the ip_ver once this series has landed, as you have all
the necessary information.

> 
> Thanks
> Peter
> 
Re: [PATCH v7 14/23] scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property
Posted by Peter Wang (王信友) 2 weeks, 6 days ago
On Wed, 2026-02-25 at 13:51 +0100, Nicolas Frattaroli wrote:
> I do not have access to a complete list of hardware IP versions
> that need this quirk applied. No upstream DTs seem to use it.
> 
> If MediaTek wants the quirk back, you can submit a patch to apply
> it based on the ip_ver once this series has landed, as you have all
> the necessary information.

Sure, it is a feature work to add this quirk based on the ip_ver.

Thanks
Peter