Skip to content

Commit

Permalink
cpufreq: dt: always allocate zeroed cpumask
Browse files Browse the repository at this point in the history
[ Upstream commit d239950 ]

Commit 0499a78 ("ARM64: Dynamically allocate cpumasks and increase
supported CPUs to 512") changed the handling of cpumasks on ARM 64bit,
what resulted in the strange issues and warnings during cpufreq-dt
initialization on some big.LITTLE platforms.

This was caused by mixing OPPs between big and LITTLE cores, because
OPP-sharing information between big and LITTLE cores is computed on
cpumask, which in turn was not zeroed on allocation. Fix this by
switching to zalloc_cpumask_var() call.

Fixes: dc279ac ("cpufreq: dt: Refactor initialization to handle probe deferral properly")
CC: [email protected] # v5.10+
Signed-off-by: Marek Szyprowski <[email protected]>
Reviewed-by: Christoph Lameter (Ampere) <[email protected]>
Reviewed-by: Dhruva Gole <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
mszyprow authored and gregkh committed Apr 3, 2024
1 parent 0374146 commit f8a2a55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cpufreq/cpufreq-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
if (!priv)
return -ENOMEM;

if (!alloc_cpumask_var(&priv->cpus, GFP_KERNEL))
if (!zalloc_cpumask_var(&priv->cpus, GFP_KERNEL))
return -ENOMEM;

cpumask_set_cpu(cpu, priv->cpus);
Expand Down

0 comments on commit f8a2a55

Please sign in to comment.