From patchwork Tue May 30 22:49:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13261193 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 A36F7C77B73 for ; Tue, 30 May 2023 22:53:23 +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-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Mal7D3KD0+Etl+aU08Wy8dlx3VC/gfiSetxzJBU1i0o=; b=ePf9f7bPPZ6rVjsjXw08jSP1ck 680OAb6cnIlwRt4FnAbVMCAhC5Ob355jcGzY+e0sAFS9R0NPiE1zc8u7kXtdAeEt52Q6T4GRxw9b4 mZRGNPdXYp1F+2dmhGyn7iElPIOvL+c8r5vQl70Hac0VcFVc6RQd84qxgDCREDctkbQFIp31B8uP9 er9KVdLGZaYSuJhpH5G0+iGmdYMC/nZ9JNorJwC4Zwt0N7dX9PR0J0DNxHpwEdwKdxjKOBvaGvoPB ehPHB4/qPtAa+uan81/LKh27cwWRRWjZ3K1rxo0RapQaONfOx019uTajCATcNcSgc2r6TGYoEJaHg EMHwuhpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q48D5-00FO4F-3D; Tue, 30 May 2023 22:53:00 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q48Cp-00FNyj-1O for linux-arm-kernel@lists.infradead.org; Tue, 30 May 2023 22:52:44 +0000 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-51f6461af24so3233279a12.2 for ; Tue, 30 May 2023 15:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1685487161; x=1688079161; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=+mY8f7+lQRr9+WWApLUgb/qq97rDifPoZmG/x+kSgj4=; b=exw11y2kgnwsbp4VEf/g4VsyoJkmnw96PnKWtKmIMVVqzgc3WamGpPHKnQJralxq86 WDye2S75Pba1TKHR1VERtIwfUAuqJ2h1ahqZtFkLy2+MeZNjb5MIx2fIBin4jR4iMxlx +aAoRT8lRDvimIvSJil3xZsHsCtcC8I7GYDuE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685487161; x=1688079161; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+mY8f7+lQRr9+WWApLUgb/qq97rDifPoZmG/x+kSgj4=; b=U+8lT+0RiQoWl62Rieg1i3z2CxMOJQl789k6aVx8fvUf5RQn9f7Gv93KgCbddoMlpg xNOx/A9XWNZOF9nR5KCg0d4izLwqV97ExWsw5zT1AUYdPiF3ZX9ymRmhXjv/hktLVy4D JxNFHGSssWkYV779MExNBrFIzEvarQOqnxTxh6nhU++Gw/+m994RbHosvYLK7+3RbMCJ CMJxayA0n2ztTnHNjWVZRON/xW+av9+N1UE1VoNm8fJExbynG+qFgrIl8bssMVDf38NV puAFUjIP8GQNolKcRPO8obScXpI2uh/0tgUvjGanKpcK/epK98z1SgbLffy67z8O3keU Y0vQ== X-Gm-Message-State: AC+VfDwM6Q0VF6s/8aEBJJD4XwLxj/NMg6OE16j3Sk/clpuSGmJv3MCI 86TdMvG+KFQQNTak1RbNbUngWg== X-Google-Smtp-Source: ACHHUZ514tMNVAPyXUUwKU7m15MSmGf6kR5Vrqsm0Cgrx6cTalyH0/gkws0SpyTliJjKa47mardFWA== X-Received: by 2002:a17:903:120f:b0:1ae:1364:6079 with SMTP id l15-20020a170903120f00b001ae13646079mr4127903plh.44.1685487161594; Tue, 30 May 2023 15:52:41 -0700 (PDT) Received: from stbirv-lnx-3.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id s3-20020a170902b18300b001a1b66af22fsm10805011plr.62.2023.05.30.15.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 15:52:41 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Radu Rendec , Pierre Gondois , Sudeep Holla , Florian Fainelli , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , "Rafael J. Wysocki" , Akihiko Odaki , Palmer Dabbelt , Gavin Shan , Jeremy Linton , linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH stable 6.3 4/4] cacheinfo: Allow early level detection when DT/ACPI info is missing/broken Date: Tue, 30 May 2023 15:49:14 -0700 Message-Id: <20230530224914.1251409-5-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230530224914.1251409-1-florian.fainelli@broadcom.com> References: <20230530224914.1251409-1-florian.fainelli@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230530_155243_468220_1B76407B X-CRM114-Status: GOOD ( 21.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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Radu Rendec commit e103d55465db06c5344201fd5fa11bb19bc479c5 upstream Recent work enables cacheinfo memory for secondary CPUs to be allocated early, while still running on the primary CPU. That allows cacheinfo memory to be allocated safely on RT kernels. To make that work, the number of cache levels/leaves must be defined in the device tree or ACPI tables. Further work adds a path for early detection of the number of cache levels/leaves, which makes it possible to allocate the cacheinfo memory early without requiring extra DT/ACPI information. This patch addresses a specific issue with ACPI systems with no PPTT. In that case, parse_acpi_topology() returns an error code, which in turn makes init_cpu_topology() return early, before fetch_cache_info() is called. In that case, the early cache level detection doesn't run. The solution is to simply remove the "return" statement and let the code flow fall through to calling fetch_cache_info(). Signed-off-by: Radu Rendec Reported-by: Pierre Gondois Link: https://lore.kernel.org/all/dea94484-797f-3034-7b86-6d88801c0d91@arm.com/ Reviewed-by: Pierre Gondois Link: https://lore.kernel.org/r/20230412185759.755408-4-rrendec@redhat.com Signed-off-by: Sudeep Holla Signed-off-by: Florian Fainelli --- drivers/base/arch_topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index c4b6198d7461..b741b5ba82bd 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -835,10 +835,10 @@ void __init init_cpu_topology(void) if (ret) { /* * Discard anything that was parsed if we hit an error so we - * don't use partial information. + * don't use partial information. But do not return yet to give + * arch-specific early cache level detection a chance to run. */ reset_cpu_topology(); - return; } for_each_possible_cpu(cpu) {