[PATCH v13 19/24] scsi: ufs: mediatek: Don't acquire dvfsrc-vcore twice
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Oct 1 01:30:29 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] ufs: mediatek: missing dev_err_probe() causes probe deferral log spam
--
commit d793732f4bb7b06145e7bd2323a3d21f956e829a
Author: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>
scsi: ufs: mediatek: Don't acquire dvfsrc-vcore twice
The ufs-mediatek driver needs to manage an optional dvfsrc-vcore regulator
but currently acquires two different references to it in different places.
This commit centralizes the reg_vcore acquisition in the host struct and
reworks the regulator users to eliminate the duplicated logic.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
Reviewed-by: Peter Wang <peter.wang at mediatek.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud at collabora.com>
> diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
> index ca31f07d382b4..d14192dc3e31c 100644
> --- a/drivers/ufs/host/ufs-mediatek.c
> +++ b/drivers/ufs/host/ufs-mediatek.c
[ ... ]
> @@ -1106,6 +1091,17 @@ static int ufs_mtk_get_supplies(struct ufs_mtk_host *host)
> const struct ufs_mtk_soc_data *data = of_device_get_match_data(dev);
> int ret;
>
> + host->reg_vcore = devm_regulator_get_optional(dev, "dvfsrc-vcore");
> + if (IS_ERR(host->reg_vcore)) {
> + if (PTR_ERR(host->reg_vcore) != -ENODEV) {
> + dev_err(dev, "Failed to get dvfsrc-vcore supply: %pe\n",
> + host->reg_vcore);
[Severity: Low]
Since devm_regulator_get_optional() can return -EPROBE_DEFER, will using
dev_err() here cause spurious error logs in dmesg every time the probe is
deferred?
Could this be changed to dev_err_probe() to quietly handle the -EPROBE_DEFER
case while properly logging real errors?
> + return PTR_ERR(host->reg_vcore);
> + }
> +
> + host->reg_vcore = NULL;
> + }
> +
> if (!data)
> return 0;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261001-mt8196-ufs-v13-0-60854adab6d9@collabora.com?part=19
More information about the linux-phy
mailing list