* [PATCH] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv
@ 2026-08-31 7:30 Xueqin Luo
2026-08-31 7:56 ` Viresh Kumar
2026-09-01 10:03 ` Sumit Gupta
0 siblings, 2 replies; 3+ messages in thread
From: Xueqin Luo @ 2026-08-31 7:30 UTC (permalink / raw)
To: rafael, viresh.kumar, thierry.reding, jonathanh
Cc: sumitg, linux-pm, linux-tegra, linux-kernel, Xueqin Luo
ndiv is already a u64 pointer, passing &ndiv to smp_call_function_single()
results in a u64** being written to instead of the caller's u64 variable,
so the caller always reads back an uninitialized ndiv. Drop the spurious
'&'.
Fixes: 0839ed1fd7ac ("cpufreq: tegra194: add soc data to support multiple soc")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
---
drivers/cpufreq/tegra194-cpufreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c
index c6375e14d445..1eb96e9f3310 100644
--- a/drivers/cpufreq/tegra194-cpufreq.c
+++ b/drivers/cpufreq/tegra194-cpufreq.c
@@ -367,7 +367,7 @@ static void tegra194_get_cpu_ndiv_sysreg(void *ndiv)
static int tegra194_get_cpu_ndiv(u32 cpu, u32 cpuid, u32 clusterid, u64 *ndiv)
{
- return smp_call_function_single(cpu, tegra194_get_cpu_ndiv_sysreg, &ndiv, true);
+ return smp_call_function_single(cpu, tegra194_get_cpu_ndiv_sysreg, ndiv, true);
}
static void tegra194_set_cpu_ndiv_sysreg(void *data)
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv
2026-08-31 7:30 [PATCH] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv Xueqin Luo
@ 2026-08-31 7:56 ` Viresh Kumar
2026-09-01 10:03 ` Sumit Gupta
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2026-08-31 7:56 UTC (permalink / raw)
To: Xueqin Luo
Cc: rafael, thierry.reding, jonathanh, sumitg, linux-pm, linux-tegra,
linux-kernel
On 31-08-26, 15:30, Xueqin Luo wrote:
> ndiv is already a u64 pointer, passing &ndiv to smp_call_function_single()
> results in a u64** being written to instead of the caller's u64 variable,
> so the caller always reads back an uninitialized ndiv. Drop the spurious
> '&'.
>
> Fixes: 0839ed1fd7ac ("cpufreq: tegra194: add soc data to support multiple soc")
> Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
> ---
> drivers/cpufreq/tegra194-cpufreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied. Thanks.
--
viresh
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv
2026-08-31 7:30 [PATCH] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv Xueqin Luo
2026-08-31 7:56 ` Viresh Kumar
@ 2026-09-01 10:03 ` Sumit Gupta
1 sibling, 0 replies; 3+ messages in thread
From: Sumit Gupta @ 2026-09-01 10:03 UTC (permalink / raw)
To: Xueqin Luo, rafael, viresh.kumar, thierry.reding, jonathanh
Cc: linux-pm, linux-tegra, linux-kernel
On 31/08/26 13:00, Xueqin Luo wrote:
> External email: Use caution opening links or attachments
>
>
> ndiv is already a u64 pointer, passing &ndiv to smp_call_function_single()
> results in a u64** being written to instead of the caller's u64 variable,
> so the caller always reads back an uninitialized ndiv. Drop the spurious
> '&'.
>
> Fixes: 0839ed1fd7ac ("cpufreq: tegra194: add soc data to support multiple soc")
> Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
> ---
> drivers/cpufreq/tegra194-cpufreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c
> index c6375e14d445..1eb96e9f3310 100644
> --- a/drivers/cpufreq/tegra194-cpufreq.c
> +++ b/drivers/cpufreq/tegra194-cpufreq.c
> @@ -367,7 +367,7 @@ static void tegra194_get_cpu_ndiv_sysreg(void *ndiv)
>
> static int tegra194_get_cpu_ndiv(u32 cpu, u32 cpuid, u32 clusterid, u64 *ndiv)
> {
> - return smp_call_function_single(cpu, tegra194_get_cpu_ndiv_sysreg, &ndiv, true);
> + return smp_call_function_single(cpu, tegra194_get_cpu_ndiv_sysreg, ndiv, true);
> }
>
> static void tegra194_set_cpu_ndiv_sysreg(void *data)
> --
> 2.43.0
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Thanks,
Sumit
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-01 10:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 7:30 [PATCH] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv Xueqin Luo
2026-08-31 7:56 ` Viresh Kumar
2026-09-01 10:03 ` Sumit Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox