[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZfL40N6HYzEQaEj1@shell.armlinux.org.uk>
Date: Thu, 14 Mar 2024 13:17:04 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Marek Szyprowski <m.szyprowski@...sung.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Sudeep Holla <sudeep.holla@....com>,
"Christoph Lameter (Ampere)" <cl@...ux.com>,
Mark Rutland <mark.rutland@....com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Viresh Kumar <vireshk@...nel.org>, Will Deacon <will@...nel.org>,
Jonathan.Cameron@...wei.com, Matteo.Carlini@....com,
Valentin.Schneider@....com, akpm@...ux-foundation.org,
anshuman.khandual@....com, Eric Mackay <eric.mackay@...cle.com>,
dave.kleikamp@...cle.com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
robin.murphy@....com, vanshikonda@...amperecomputing.com,
yang@...amperecomputing.com, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>
Subject: Re: [PATCH v3] ARM64: Dynamically allocate cpumasks and increase
supported CPUs to 512
On Thu, Mar 14, 2024 at 01:28:40PM +0100, Marek Szyprowski wrote:
> Dear All,
>
> On 14.03.2024 09:39, Catalin Marinas wrote:
> > On Wed, Mar 13, 2024 at 05:13:33PM +0000, Russell King wrote:
> >> So, I wonder whether what you're seeing is a latent bug which is
> >> being tickled by the presence of the CPU masks being off-stack
> >> changing the kernel timing.
> >>
> >> I would suggest the printk debug approach may help here to see when
> >> the OPPs are begun to be parsed, when they're created etc and their
> >> timing relationship to being used. Given the suspicion, it's possible
> >> that the mere addition of printk() may "fix" the problem, which again
> >> would be another semi-useful data point.
> > It might be an init order problem. Passing "initcall_debug" on the
> > cmdline might help a bit.
> >
> > It would also be useful in dev_pm_opp_set_config(), in the WARN_ON
> > block, to print opp_table->opp_list.next to get an idea whether it looks
> > like a valid pointer or memory corruption.
>
> I've finally found some time to do the step-by-step printk-based
> debugging of this issue and finally found what's broken!
>
> Here is the fix:
>
> diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
> index 8bd6e5e8f121..2d83bbc65dd0 100644
> --- a/drivers/cpufreq/cpufreq-dt.c
> +++ b/drivers/cpufreq/cpufreq-dt.c
> @@ -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);
>
>
> It is really surprising that this didn't blow up for anyone else so
> far... This means that the $subject patch is fine.
Wow. I guess we've been lucky with that allocation hitting memory
containing zeros. Well done at tracking it down!
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists