Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp52931lqb; Thu, 14 Mar 2024 05:28:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjqhI7i0UVxEHbLvJ5yfk9GGfq6ChSAH53jcfXitfOafgqU0cv8P8cQe3hYRnzErVF9XqFKCBW7TlSBjF304g+tsg1puiDLai4n1D+qg== X-Google-Smtp-Source: AGHT+IEZ+zBNnqHuSURtjlk4sZNeC8POQK3BSoSGpGH8hCHuYefhnG/1fMU3L3HLnpfzDMRiozBZ X-Received: by 2002:a05:6402:2411:b0:566:b442:16cf with SMTP id t17-20020a056402241100b00566b44216cfmr1175863eda.13.1710419338698; Thu, 14 Mar 2024 05:28:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710419338; cv=pass; d=google.com; s=arc-20160816; b=05NxZjohx/2R6WJxRtodgiXgoPA38loXDB2q1BmTQ0i/IZNEEPckjkh33t8pPVL8op he1srlB475UlQh3mfK8wyi+5+JtbSlZJEifJ+GqEdKBfQjdwaIBijR4noi7eksBsp6UT YEnytgnIBOpmKZhLZKX2/V79BHnvbYO9kbtKe8JAa3nCJMR+q2RerAjBYeUEEwo8EGz1 e8SImqydmN2qgQZte9c2+3H9USIvWym7xwPL/uIJsRaWiExtmjCb6aZi4fjn359yfaeq WwD934DoJsupOSB0JqaG7ftBjqTLp4PjscfVt/JGy29Mu57K5JdiPUax7wwWU2VDwtfI g7FA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:content-transfer-encoding:in-reply-to:from:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-filter; bh=1kh7I+S2C9P5Kz44btTniuxhDXte7vdYgTUP0g8alRo=; fh=hdrxHdmd07jDPs/B12TqZw08259GEoL/xcnAKT7GvBY=; b=Bc6QAFF/zgcKc6z6Tq7aDU2VJiyGq7ZddzWVLjH2v1P1LVdzIOvxqoME5mQajLmtX1 4aR+dQZEvwh6sTgV3zTRzWrohI/2tR02/I9K4XiaI0P/dx4KCprpvdtmlq9dSvBkc7RF rcSwMu+RyE4d6A8BZCKygB5DHmo4uLatKNmRiSmoiIl0LWqk6N6dA3TScbK7loqZS/Xr JRb9D4tgxwMOke80/uvKXs1alLSR5HTVZkfyvJt0D8WPF/0mmfSB2VuJUE0gj3WWnEz8 xQTv32Sf7GjYQM0DE2Blor+grquQ9nqGwD6thAcE0FhagqVHTd3oBqgGKRsTP0Yr7cgE J9LA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=MEkMQYs0; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-103237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s4-20020aa7d784000000b00568950199e8si692509edq.565.2024.03.14.05.28.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 05:28:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=MEkMQYs0; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-103237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EE0F91F229E5 for ; Thu, 14 Mar 2024 12:28:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E77846FBB8; Thu, 14 Mar 2024 12:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="MEkMQYs0" Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 805B03B18C for ; Thu, 14 Mar 2024 12:28:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710419330; cv=none; b=dozH5lK5V1R3Wj0YQXhKfs+KzIM3+ADfhahgBGlLdt9/xJjJUOQI9+Euc1V/dBejJ5lNIpwNQi7CQXH037EmCkASehNvcsHDfgM7ddLJ4kkyRdWErjaCC2HNmHp3KIW2dlCW7ads3pkMlgKOQu9rGkG22YEausWrUBwX6oB1uUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710419330; c=relaxed/simple; bh=QdQfhYEro/NY6bBHiGnSatWRYO56g6kjIIj/lZtSvEw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=NKd4mNIQfdOheRGi09P/0Ximj318wfPy2NoW4etQWeGpVNiRtKf5VRzFJS0e9aX0PHgi0ckd5rI2+vt01uRabrBh5SOf4DEXJFvB/arvNBZPGruXejeixqlX/2TgL3M/WUF4Dvoc8sp/HGXESN1MNKPtbcSSw3Vv42NTF6vsb8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=MEkMQYs0; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240314122844euoutp01f9c3f86407e0a54386777331902e053b~8oVBAlO_I1206112061euoutp01P for ; Thu, 14 Mar 2024 12:28:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240314122844euoutp01f9c3f86407e0a54386777331902e053b~8oVBAlO_I1206112061euoutp01P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1710419324; bh=1kh7I+S2C9P5Kz44btTniuxhDXte7vdYgTUP0g8alRo=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=MEkMQYs0BTGf/LyJr9ZWVWx+0XeRk8vUBmaTXr4XIc27UMyIPlHTGnT3gPWCtBMio UmEgyFEuq4vhQERxUBljnlC9VxdPpaFOzmAB8epoXYkuj8UsPhOaLlFlnBCyU+pomz HYt9cZhA3VdypUYvy/XENaZS5eF7nuBkqKiuwLsM= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240314122844eucas1p1165738a2ef81c5182ae5085ca199fc3a~8oVAidxed0475704757eucas1p1b; Thu, 14 Mar 2024 12:28:44 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 2A.71.09539.B7DE2F56; Thu, 14 Mar 2024 12:28:43 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240314122843eucas1p231a57588b81f9eb3d53129c0f68bc43c~8oVAHGC6o2694326943eucas1p2f; Thu, 14 Mar 2024 12:28:43 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240314122843eusmtrp2b6faf98297797ce5e8847bb9b0e4eb1e~8oVAF7IDi2786227862eusmtrp2p; Thu, 14 Mar 2024 12:28:43 +0000 (GMT) X-AuditID: cbfec7f2-52bff70000002543-0c-65f2ed7bcb7f Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CB.EE.10702.B7DE2F56; Thu, 14 Mar 2024 12:28:43 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240314122841eusmtip1e6cbf991d35b9407fd86a548d6f9b99f~8oU_l5CfA2959929599eusmtip1X; Thu, 14 Mar 2024 12:28:41 +0000 (GMT) Message-ID: Date: Thu, 14 Mar 2024 13:28:40 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] ARM64: Dynamically allocate cpumasks and increase supported CPUs to 512 Content-Language: en-US To: Catalin Marinas , "Russell King (Oracle)" Cc: 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 From: Marek Szyprowski In-Reply-To: Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA01SbUxTVxj29N7elkr1Utl65jaaNTLdFnEsNjvEhcy4H9cxE0kWZjY3aOSK hlJJS93UbUKGwjqryIJAhfIRhK5rYBSk2Aw2OtLyIQypq9BUwFEQquhaEBBIHe3FjX/PeT7O 874nh4sJfiS2co/Ls2iFXCoTEzy8xfa0f+eZGT/9dmsgDpU1GAnU3nUEPa69ANCd+YcA/T45 iKGJQC0HGaqcBDKNO9nIYSkj0IjxGRvNajoBsha1AXTtzi0WWq5dYKGHi30sVD5XhKGOfzxs FHA24qiupxVH5oqnGJp2uXHUNGYjUK5bgjQ13Zz3IWXUGQHlcN7CqNzOGTZlMnxPUCZ/IYfq KlnGKc/tYhbVVHOW8k24cOoHxxCHsg+ZWdSsKepg+Ke891Jp2fGTtGJXfArv2FWNA8s8t/mr e/6fsWzwS7gahHEhuRvezM9jqwGPKyD1AI79ZmUHBQE5B+DckzVhFsDiVhv2PLFcdBlnTHUA TkyJGJMPwGsd11lBgU/Gw6qSsVAAJ6Ph8PkhDsNHwO5STyj8AimCo66SEL+FlEKvuTLkx0gh dHkqQvdEkilw9MplLFiAkX+zYfMDOxEUCDIWqmfUIRxGbocXHvUTTFgEv7t+NRSApJoHqydd ODP2B7BtoJvD4C3Qa29ew6/AZzeCbcFAHoCVy6NrhwIAs++7AOPaA939S6sV3NWKN2CDZRdD 74Xeiw2cIA3JTXBoJoIZYhMsbCnGGJoP888LGPfrUGuv/6+2Y2AQKwBi7bp30a7bX7tuHe3/ vZUANwAhrVJmpNHKWDn9ZYxSmqFUydNijpzIMIHVf9sbsPtbQbnXF2MFLC6wAsjFxJH8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1tYsRwpaXaN46m3kCo9AsJGfMQrJu FpKWWUhaFjCyrGIUSS0tzk3PLTbSK07MLS7NS9dLzs/dxAhML9uO/dyyg3Hlq496hxiZOBgP MUpwMCuJ8NYpfkwV4k1JrKxKLcqPLyrNSS0+xGgKDIuJzFKiyfnABJdXEm9oZmBqaGJmaWBq aWasJM7rWdCRKCSQnliSmp2aWpBaBNPHxMEp1cAkmbHyI4NlWvfl5YdUvh235T3V0XVPzbrw TppT5yKu4I/Ln6WdYO/Nkv75/pKn3i0R3ejafUxbz6d9K8zfvWRDb0EX03o7r4gfb2VEdmf5 Bn9fHml04ha32OQHU2Q8Pmz8pnxon7XC/pCt9XfmOby7+0dZYYv54pt/IsxsXlpcv+c+/e0U 3VOrpwXUygtlssuvWJrScH2zkMPi31pFEz/M8xCpnHAxv3rb9alP+4rkPzzfdW9NyebznAq+ 9/xZ5atcTBYuZPbftDbqzcGmAA+ulXJLX+zPWLE3WNb2UsGnv4ci9nZmMk3q/n/bac8m0Xuv Hh5rONuzveT91OnPtMKu8dxcc9/hZnJMzO6c/R/U85VYijMSDbWYi4oTAab48Y+4AwAA X-CMS-MailID: 20240314122843eucas1p231a57588b81f9eb3d53129c0f68bc43c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20240308140130eucas1p1259c805a0b6491ce2f69c6fca0264b1f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240308140130eucas1p1259c805a0b6491ce2f69c6fca0264b1f References: <37099a57-b655-3b3a-56d0-5f7fbd49d7db@gentwo.org> <9352f410-9dad-ac89-181a-b3cfc86176b8@linux.com> <432c1980-b00f-4b07-9e24-0bec52ccb5d6@samsung.com> 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. I will send a proper patch fixing this issue in a few minutes. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland