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 A601BC54E60 for ; Thu, 14 Mar 2024 13:17:49 +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=uVfrJcifwsReCovBtd1MZKfXzUEDtX8pSmRn4OC5gME=; b=M/vgleVqa21UPS ycsIG4t+DqEhnXn+iNBZCRxWGl+fhdv6uUs5Y7B1oSo3t4zBHUbmIB13JK0zNGAPtHApALPqh+5S+ P4H2EOqILm3okPDfnFzxeeDTYJpwmYvNSbTiKEv5tv0tYOPAULZBrHOYZEzetfx6diLwY7Lzy3CAc 5TmpKSwiprYp5XFhqdWUW3TjzmvG5APv++INI9FTkxQ2nGFYmKoyS6Erzgru9LOmA6o9UDR6VPrSo zuDfsKsBgl9xrP+EPNJ8wpaT+tOMjtozXGcZLnbclXtrUOlVYBt/QFRf80nDkq12yc9Fn6SkaoE7c rmSyNcjvoHctU2zxnsbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkkxk-0000000EOMz-0dO1; Thu, 14 Mar 2024 13:17:36 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkkxh-0000000EOM0-2XxE for linux-arm-kernel@lists.infradead.org; Thu, 14 Mar 2024 13:17:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type: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-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=clrW0RwMW19aCCVUBe+aDaa6Xr2fikUQUzGV0E47Ik8=; b=ho7CTE2Zq1/DvHgOQchZ4l3JtQ k5ID2n2/S4kvmPPE9WrMgxAyc9pWgcLyPizYsqSRtd8W80gi8AYct3bRILrT6ln668Tj9Q8FWDx3G uEh81hiCaDn+Kr+6bcuNb1RRA9E0Rs2P51cwzTON2R++WbCGz+BSSutYfuA4BjFKr7/houpCIGZmz Q1km00FJT9ueKsGXmjsYD9euNplW3zJK4EkHBw5g5tQmR0YA21vrtJxeVxuiP0G9UdTakINVDCKR/ iMmP0znPoqK9WArfjueEljzbfOI+lNl4mY7UMH924GL2vKcYY7lNEZ7Ekj2uCbUneYA9wSFamyc+E jgzW8UBQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51784) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rkkxM-0000Vg-2h; Thu, 14 Mar 2024 13:17:12 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rkkxE-0005Tc-6M; Thu, 14 Mar 2024 13:17:04 +0000 Date: Thu, 14 Mar 2024 13:17:04 +0000 From: "Russell King (Oracle)" To: Marek Szyprowski Cc: Catalin Marinas , 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_061733_670155_82416D2E X-CRM114-Status: GOOD ( 27.07 ) 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: > 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) > =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. 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! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel