From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70147C54E67 for ; Thu, 14 Mar 2024 13:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n1qjh9GTm9LCIHP5UnVCBsjMQSoqhObmvFdqsxfkbVM=; b=UccFdetSt13XuF nbRp+PUwTOFJ/gxorl4MRJ5HlTy5CKHO/JA71MqknqskRjW2rxRY5zx/xfIa5ikte2AsL2Lt/Pf86 acGriUZYLbm+t3Qb+Vg1zvNoNbnS+II/nWXo5KvPHYUjMUVuboXkOhdU+yMic+2z4F/uvWyOWxdrd 3BnLe6NaqQ2rTPI/4QFYyohN6mLyPSCMYPiWPE/w/h4HL8aXFJvcUugvwHOYVK3cGwLZm11/bTRQV ZbG2bC1VlBVGyRq0l8MswxNBYnsUzM3bCnLhPbdCYHmt4YUVAfxVdzx1bag89pmTEnGy+XBhqACQU ubWWJr+VohPNqyf+6fhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rklax-0000000EVu5-1emC; Thu, 14 Mar 2024 13:58:07 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rklau-0000000EVsQ-10NJ for linux-arm-kernel@lists.infradead.org; Thu, 14 Mar 2024 13:58:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 84CF1CE1B79; Thu, 14 Mar 2024 13:58:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6083BC433F1; Thu, 14 Mar 2024 13:57:57 +0000 (UTC) Date: Thu, 14 Mar 2024 13:57:54 +0000 From: Catalin Marinas To: Marek Szyprowski Cc: "Russell King (Oracle)" , Sudeep Holla , "Christoph Lameter (Ampere)" , Mark Rutland , "linux-pm@vger.kernel.org" , "Rafael J. Wysocki" , Viresh Kumar , Will Deacon , Jonathan.Cameron@huawei.com, Matteo.Carlini@arm.com, Valentin.Schneider@arm.com, akpm@linux-foundation.org, anshuman.khandual@arm.com, Eric Mackay , dave.kleikamp@oracle.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, robin.murphy@arm.com, vanshikonda@os.amperecomputing.com, yang@os.amperecomputing.com, Nishanth Menon , Stephen Boyd Subject: Re: [PATCH v3] ARM64: Dynamically allocate cpumasks and increase supported CPUs to 512 Message-ID: References: <9352f410-9dad-ac89-181a-b3cfc86176b8@linux.com> <432c1980-b00f-4b07-9e24-0bec52ccb5d6@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240314_065804_667718_BFA204F9 X-CRM114-Status: GOOD ( 28.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 14, 2024 at 01:28:40PM +0100, Marek Szyprowski wrote: > 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) > =A0=A0=A0=A0=A0=A0=A0 if (!priv) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -ENOMEM; > = > -=A0=A0=A0=A0=A0=A0 if (!alloc_cpumask_var(&priv->cpus, GFP_KERNEL)) > +=A0=A0=A0=A0=A0=A0 if (!zalloc_cpumask_var(&priv->cpus, GFP_KERNEL)) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -ENOMEM; > = > =A0=A0=A0=A0=A0=A0=A0 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. > = > I will send a proper patch fixing this issue in a few minutes. Nice. Many thanks for tracking this down. I'll revert the revert of the CPUMASK_OFFSTACK in the second part of the merging window (I already sent the pull request). -- = Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel