Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp10762279rwb; Fri, 25 Nov 2022 07:33:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4E653YFa8hSe8aHgq9GoSm0B+VaADUfxSgMkC3YZOEbxG2ALiSBQDnPJLSuXioG66E55IY X-Received: by 2002:a63:1e4b:0:b0:470:514e:1f12 with SMTP id p11-20020a631e4b000000b00470514e1f12mr34982444pgm.353.1669390400636; Fri, 25 Nov 2022 07:33:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669390400; cv=none; d=google.com; s=arc-20160816; b=eb5V7irAnM4WB4jDVDw6rixYRlGNiC0J2WbCARNtqETWcRjnDCHW5rhPFwfldGMr+h rhruhH5F2e20Wf7VeFlMxWdZRoSnhtqbNT3X5RIv5coCEH7FvqkXBKnxW9aDcDWvavVP A7Yj3+fdq/NZryY3a2G7VSlP+uUsOpxd9IITWxSA/sUO3V5KGX32QvSY7Uwh0FoMwJi9 3lYT19/du+yONUjEHYF0iM5PI6PM7JOhqUbdE+sQ+cIRAFe4/JRWBYd4DQXIlHDSbntD JW9mlDZwFVzj1F3b1oIr9aTT6c5O9M+/5fbu/lS1f9U/Ee10t2k6o1u2wKJgQpL6H1EU T90w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=EI2gNuUiFLamwU3NLojvBhB0fU2bFkRNC82CWTk6b4A=; b=Bno/snWKLweEukbPno2dN2DdKNA2j9uCh/Z53NzvLvCYPJu9QwIGcnQgvGfsADKAKn qyeS55CoePWgUapV8Givap1aLe2y281VOmrftle9pTZEfVCimpl157XWVlZ2CeoDd/CO +yPIZ2S65LBqkeP7IAitkaswic/ME9exhcR9o/C+iU5WI7fwCtONxcRpAgIadWjtHUjx 7+9OxgAk4OpH07KhTHMO26gkICRkP0vKTUVw3F64+1xczXiF6K7c2t2jzi4qrSTmmdrW EumCEqfAfaK9LXSbVB/g04YfuN3HcwJA2WIFarhy6LIOjobuKUJeSRCTOy96VgMtUooF 0cbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a170903124900b00188712fdf88si4445868plh.46.2022.11.25.07.33.08; Fri, 25 Nov 2022 07:33:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229627AbiKYPS7 (ORCPT + 85 others); Fri, 25 Nov 2022 10:18:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbiKYPSz (ORCPT ); Fri, 25 Nov 2022 10:18:55 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 361FB20361; Fri, 25 Nov 2022 07:18:53 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6F5142B; Fri, 25 Nov 2022 07:18:59 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 48CE23F587; Fri, 25 Nov 2022 07:18:50 -0800 (PST) Date: Fri, 25 Nov 2022 15:18:47 +0000 From: Sudeep Holla To: Pierre Gondois Cc: linux-kernel@vger.kernel.org, Ionela.Voinescu@arm.com, Rob.Herring@arm.com, Jeremy Linton , Catalin Marinas , Sudeep Holla , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J. Wysocki" , Len Brown , Greg Kroah-Hartman , Conor Dooley , Gavin Shan , Peter Chen , SeongJae Park , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v2 4/5] ACPI: PPTT: Update acpi_find_last_cache_level() to acpi_get_cache_info() Message-ID: <20221125151847.ortklu4ptaftua6u@bogus> References: <20221121171217.3581004-1-pierre.gondois@arm.com> <20221121171217.3581004-5-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221121171217.3581004-5-pierre.gondois@arm.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 21, 2022 at 06:12:12PM +0100, Pierre Gondois wrote: > acpi_find_last_cache_level() allows to find the last level of cache > for a given CPU. The function is only called on arm64 ACPI based > platforms to check for cache information that would be missing in > the CLIDR_EL1 register. > To allow populating (struct cpu_cacheinfo).num_leaves by only parsing > a PPTT, update acpi_find_last_cache_level() to get the 'split_levels', > i.e. the number of cache levels being split in data/instruction > caches. > > It is assumed that there will not be data/instruction caches above a > unified cache. > If a split level consist of one data cache and no instruction cache > (or opposite), then the missing cache will still be populated > by default with minimal cache information, and maximal cpumask > (all non-existing caches have the same fw_token). > > Suggested-by: Jeremy Linton > Signed-off-by: Pierre Gondois > Reviewed-by: Jeremy Linton > --- > arch/arm64/kernel/cacheinfo.c | 9 +++-- > drivers/acpi/pptt.c | 76 +++++++++++++++++++++++------------ > include/linux/cacheinfo.h | 8 ++-- > 3 files changed, 61 insertions(+), 32 deletions(-) > > diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c > index 97c42be71338..164255651d64 100644 > --- a/arch/arm64/kernel/cacheinfo.c > +++ b/arch/arm64/kernel/cacheinfo.c > @@ -46,7 +46,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf, > int init_cache_level(unsigned int cpu) > { > unsigned int ctype, level, leaves; > - int fw_level; > + int fw_level, ret; > struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); > > for (level = 1, leaves = 0; level <= MAX_CACHE_LEVEL; level++) { > @@ -61,8 +61,11 @@ int init_cache_level(unsigned int cpu) > > if (acpi_disabled) > fw_level = of_find_last_cache_level(cpu); > - else > - fw_level = acpi_find_last_cache_level(cpu); > + else { You need to add braces to if as well in such cases. I think checkpatch might tell you that. Just found this by chance. Anyways, this looks good to me. Reviewed-by: Sudeep Holla -- Regards, Sudeep