[PATCH v14 10/23] scsi: ufs: mediatek: Rework the crypt-boost stuff

sashiko-bot at kernel.org sashiko-bot at kernel.org
Fri Oct 16 05:43:59 PDT 2026


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ufs: mediatek: silently swallowing probe deferral for crypt boost clocks
--

commit c7e82dd177e902585d5b946c4b24b62fd9a85995
Author: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>

scsi: ufs: mediatek: Rework the crypt-boost stuff

This commit reworks the initialization of crypt-boost functionality by
removing clock wrapper functions and directly calling devm_clk_get() in
ufs_mtk_init_boost_crypt(). It also updates property names to include
the mediatek vendor prefix.

> diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
> index 1be533020ed4c..2bcf35bfabb77 100644
> --- a/drivers/ufs/host/ufs-mediatek.c
> +++ b/drivers/ufs/host/ufs-mediatek.c

[ ... ]

> @@ -680,65 +665,53 @@ static void ufs_mtk_boost_crypt(struct ufs_hba *hba, bool boost)

[ ... ]

> +	cfg->clk_crypt_mux = devm_clk_get(dev, "crypt_mux");
> +	if (IS_ERR(cfg->clk_crypt_mux)) {
> +		dev_err(dev, "Failed to get clock crypt_mux: %pe\n", cfg->clk_crypt_mux);
> +		return;
> +	}
        ^^^^^^^

[Severity: Medium]
Does this code silently swallow probe deferrals?

If the UFS host driver probes before the clock providers for crypt_mux,
crypt_lp, or crypt_perf, devm_clk_get() will return -EPROBE_DEFER.

Because ufs_mtk_init_boost_crypt() returns void, this error is caught,
logged, and swallowed instead of being propagated up to the probe sequence.

This means the UFS_MTK_CAP_BOOST_CRYPT_ENGINE functionality is permanently
disabled instead of correctly waiting for the clock providers to probe.

Note that while a follow-up patch fixes this exact issue for the
dvfsrc-vcore regulator by moving it to ufs_mtk_get_supplies(), the clocks
were left behind in ufs_mtk_init_boost_crypt() and remain broken at the
end of the series.

>  
> -	if (ufs_mtk_init_host_clk(hba, "crypt_lp",
> -				  &cfg->clk_crypt_lp))
> -		goto disable_caps;
> +	cfg->clk_crypt_lp = devm_clk_get(dev, "crypt_lp");
> +	if (IS_ERR(cfg->clk_crypt_lp)) {
> +		dev_err(dev, "Failed to get clock crypt_lp: %pe\n", cfg->clk_crypt_lp);
> +		return;
> +	}
>  
> -	if (ufs_mtk_init_host_clk(hba, "crypt_perf",
> -				  &cfg->clk_crypt_perf))
> -		goto disable_caps;
> +	cfg->clk_crypt_perf = devm_clk_get(dev, "crypt_perf");
> +	if (IS_ERR(cfg->clk_crypt_perf)) {
> +		dev_err(dev, "Failed to get clock crypt_perf: %pe\n", cfg->clk_crypt_perf);
> +		return;
> +	}
>  
> -	cfg->reg_vcore = reg;
> -	cfg->vcore_volt = volt;
> +	host->crypt = cfg;
>  	host->caps |= UFS_MTK_CAP_BOOST_CRYPT_ENGINE;
> -
> -disable_caps:
> -	return;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-mt8196-ufs-v14-0-e8d565e0cd45@collabora.com?part=10



More information about the linux-phy mailing list