]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.10/cpufreq-dt-always-allocate-zeroed-cpumask.patch
Linux 5.4.274
[thirdparty/kernel/stable-queue.git] / queue-5.10 / cpufreq-dt-always-allocate-zeroed-cpumask.patch
1 From 82988c5aea66c118f5dbd66de066c6d2f81dbeaf Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Thu, 14 Mar 2024 13:54:57 +0100
4 Subject: cpufreq: dt: always allocate zeroed cpumask
5
6 From: Marek Szyprowski <m.szyprowski@samsung.com>
7
8 [ Upstream commit d2399501c2c081eac703ca9597ceb83c7875a537 ]
9
10 Commit 0499a78369ad ("ARM64: Dynamically allocate cpumasks and increase
11 supported CPUs to 512") changed the handling of cpumasks on ARM 64bit,
12 what resulted in the strange issues and warnings during cpufreq-dt
13 initialization on some big.LITTLE platforms.
14
15 This was caused by mixing OPPs between big and LITTLE cores, because
16 OPP-sharing information between big and LITTLE cores is computed on
17 cpumask, which in turn was not zeroed on allocation. Fix this by
18 switching to zalloc_cpumask_var() call.
19
20 Fixes: dc279ac6e5b4 ("cpufreq: dt: Refactor initialization to handle probe deferral properly")
21 CC: stable@vger.kernel.org # v5.10+
22 Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
23 Reviewed-by: Christoph Lameter (Ampere) <cl@linux.com>
24 Reviewed-by: Dhruva Gole <d-gole@ti.com>
25 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
26 Signed-off-by: Sasha Levin <sashal@kernel.org>
27 ---
28 drivers/cpufreq/cpufreq-dt.c | 2 +-
29 1 file changed, 1 insertion(+), 1 deletion(-)
30
31 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
32 index e363ae04aac62..44cc596ca0a5e 100644
33 --- a/drivers/cpufreq/cpufreq-dt.c
34 +++ b/drivers/cpufreq/cpufreq-dt.c
35 @@ -251,7 +251,7 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
36 if (!priv)
37 return -ENOMEM;
38
39 - if (!alloc_cpumask_var(&priv->cpus, GFP_KERNEL))
40 + if (!zalloc_cpumask_var(&priv->cpus, GFP_KERNEL))
41 return -ENOMEM;
42
43 priv->cpu_dev = cpu_dev;
44 --
45 2.43.0
46