From: Mikko Perttunen <mperttunen@nvidia.com>
To: thierry.reding@gmail.com, Chen Yufeng <chenyufeng@iie.ac.cn>
Cc: jonathanh@nvidia.com, linux-tegra@vger.kernel.org,
Chen Yufeng <chenyufeng@iie.ac.cn>
Subject: Re: [PATCH] soc/tegra: regulators: Fix locking up when voltage-spread is out of range in tegra20
Date: Thu, 22 Jan 2026 15:04:53 +0900 [thread overview]
Message-ID: <3602823.usQuhbGJ8B@senjougahara> (raw)
In-Reply-To: <20250906105021.721-1-chenyufeng@iie.ac.cn>
On Saturday, September 6, 2025 7:50 PM Chen Yufeng wrote:
> This patch is similar to ef85bb582c41("soc/tegra: regulators: Fix
> locking up when voltage-spread is out of range").
>
> A potential deadlock issue exists in the voltage coupler code for
> Tegra20 when the voltage spread (voltage-spread) goes out of range.
> The code does not properly account for the maximum voltage spread
> (max-spread) requirement when the CPU regulator has no consumers.
>
> In the tegra20_cpu_voltage_update function, the voltage range is
> not properly handled when there are no consumers:
> ```c
> if (!cpu_min_uV_consumers)
> cpu_min_uV = cpu_uV;
> ```
> When there are no CPU consumers, cpu_min_uV is directly set to cpu_uV,
> without considering the maximum voltage spread constraint.
>
> The issue is resolved by introducing the max function to ensure that
> cpu_min_uV is set to the greater value between cpu_uV and cpu_min_uV,
> thereby preventing the voltage spread from exceeding the limit:
> ```c
> if (!cpu_min_uV_consumers)
> cpu_min_uV = max(cpu_uV, cpu_min_uV);
> ```
I don't think this applies to this driver. If cpu_min_uV == cpu_uV, no voltage change will occur, hence the voltage spread will not change.
Thanks,
Mikko
>
> Signed-off-by: Chen Yufeng <chenyufeng@iie.ac.cn>
> ---
> drivers/soc/tegra/regulators-tegra20.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/tegra/regulators-tegra20.c b/drivers/soc/tegra/regulators-tegra20.c
> index 6a2f90ab9d3e..48c29b89fa59 100644
> --- a/drivers/soc/tegra/regulators-tegra20.c
> +++ b/drivers/soc/tegra/regulators-tegra20.c
> @@ -305,7 +305,7 @@ static int tegra20_cpu_voltage_update(struct tegra_regulator_coupler *tegra,
> * survive the voltage drop if it's running on a higher frequency.
> */
> if (!cpu_min_uV_consumers)
> - cpu_min_uV = cpu_uV;
> + cpu_min_uV = max(cpu_uV, cpu_min_uV);
>
> /* restore boot voltage level */
> if (tegra->sys_reboot_mode)
>
prev parent reply other threads:[~2026-01-22 6:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-06 10:50 [PATCH] soc/tegra: regulators: Fix locking up when voltage-spread is out of range in tegra20 Chen Yufeng
2026-01-22 6:04 ` Mikko Perttunen [this message]
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=3602823.usQuhbGJ8B@senjougahara \
--to=mperttunen@nvidia.com \
--cc=chenyufeng@iie.ac.cn \
--cc=jonathanh@nvidia.com \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox