All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Louis-Alexis Eyraud" <louisalexis.eyraud@collabora.com>
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-scsi@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	vkoul@kernel.org, neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v14 10/23] scsi: ufs: mediatek: Rework the crypt-boost stuff
Date: Fri, 16 Oct 2026 12:43:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-174330@kernel.org> (raw)
In-Reply-To: <20261016-mt8196-ufs-v14-10-e8d565e0cd45@collabora.com>

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@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

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Louis-Alexis Eyraud" <louisalexis.eyraud@collabora.com>
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-scsi@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	vkoul@kernel.org, neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v14 10/23] scsi: ufs: mediatek: Rework the crypt-boost stuff
Date: Fri, 16 Oct 2026 12:43:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-174330@kernel.org> (raw)
In-Reply-To: <20261016-mt8196-ufs-v14-10-e8d565e0cd45@collabora.com>

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@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

  reply	other threads:[~2026-10-16 12:44 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 12:32 [PATCH v14 00/23] MediaTek UFS Cleanup and MT8196 Enablement Louis-Alexis Eyraud
2026-10-16 12:32 ` Louis-Alexis Eyraud
2026-10-16 12:32 ` [PATCH v14 01/23] dt-bindings: phy: Add mediatek,mt8196-ufsphy variant Louis-Alexis Eyraud
2026-10-16 12:32   ` Louis-Alexis Eyraud
2026-10-16 12:32 ` [PATCH v14 02/23] dt-bindings: ufs: mediatek,ufs: Complete the binding Louis-Alexis Eyraud
2026-10-16 12:32   ` Louis-Alexis Eyraud
2026-10-16 12:46   ` sashiko-bot
2026-10-16 12:46     ` sashiko-bot
2026-10-16 12:32 ` [PATCH v14 03/23] dt-bindings: ufs: mediatek,ufs: Add mt8196 variant Louis-Alexis Eyraud
2026-10-16 12:32   ` Louis-Alexis Eyraud
2026-10-16 12:32 ` [PATCH v14 04/23] scsi: ufs: mediatek: Move MTK_SIP_UFS_CONTROL to mtk_sip_svc.h Louis-Alexis Eyraud
2026-10-16 12:32   ` Louis-Alexis Eyraud
2026-10-16 12:32 ` [PATCH v14 05/23] phy: mediatek: ufs: Add support for resets Louis-Alexis Eyraud
2026-10-16 12:32   ` Louis-Alexis Eyraud
2026-10-16 12:46   ` sashiko-bot
2026-10-16 12:46     ` sashiko-bot
2026-10-16 12:32 ` [PATCH v14 06/23] scsi: ufs: mediatek: Rework resets Louis-Alexis Eyraud
2026-10-16 12:32   ` Louis-Alexis Eyraud
2026-10-16 12:32 ` [PATCH v14 07/23] scsi: ufs: mediatek: Rework 0.9V regulator Louis-Alexis Eyraud
2026-10-16 12:32   ` Louis-Alexis Eyraud
2026-10-16 12:44   ` sashiko-bot
2026-10-16 12:44     ` sashiko-bot
2026-10-16 12:33 ` [PATCH v14 08/23] scsi: ufs: mediatek: Add dual 0.9V supply support Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:43   ` sashiko-bot
2026-10-16 12:43     ` sashiko-bot
2026-10-16 12:33 ` [PATCH v14 09/23] scsi: ufs: mediatek: Rework init function Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 10/23] scsi: ufs: mediatek: Rework the crypt-boost stuff Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:43   ` sashiko-bot [this message]
2026-10-16 12:43     ` sashiko-bot
2026-10-16 12:33 ` [PATCH v14 11/23] scsi: ufs: mediatek: Handle misc host voltage regulators Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 12/23] scsi: ufs: mediatek: Remove undocumented downstream reset cruft Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 13/23] scsi: ufs: mediatek: Remove vendor kernel quirks cruft Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:43   ` sashiko-bot
2026-10-16 12:43     ` sashiko-bot
2026-10-16 12:33 ` [PATCH v14 14/23] scsi: ufs: mediatek: Use the common PHY framework Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:50   ` sashiko-bot
2026-10-16 12:50     ` sashiko-bot
2026-10-16 12:33 ` [PATCH v14 15/23] scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 16/23] scsi: ufs: mediatek: Rework _ufs_mtk_clk_scale error paths Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 17/23] scsi: ufs: mediatek: Clean up logging prints Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 18/23] scsi: ufs: mediatek: Rework ufs_mtk_wait_idle_state Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 19/23] scsi: ufs: mediatek: Don't acquire dvfsrc-vcore twice Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 20/23] scsi: ufs: mediatek: Rework hardware version reading Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 21/23] scsi: ufs: mediatek: Remove ret local from link_startup_notify Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 22/23] scsi: ufs: mediatek: Remove undocumented "clk-scale-up-vcore-min" Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud
2026-10-16 12:33 ` [PATCH v14 23/23] scsi: ufs: mediatek: Add MT8196 compatible, update copyright Louis-Alexis Eyraud
2026-10-16 12:33   ` Louis-Alexis Eyraud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-174330@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=louisalexis.eyraud@collabora.com \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.