Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp23829lqp; Fri, 12 Apr 2024 09:28:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJM+aRxmJWonPtdDQll12jiZD23bOLks73KXOF7oAL6KHX7k3cDMSLqZNFBCfMPfEyk6nYN68HQsNsIPBfLICAoCfzqix557vGxvNfDw== X-Google-Smtp-Source: AGHT+IGoscNHv2lkFctkuG5p1Qc2kPlHSEtCL9DXeEiviPv8EwW59FLMa067feP4lOIP5a6naI1r X-Received: by 2002:a05:622a:190f:b0:434:b809:a2e6 with SMTP id w15-20020a05622a190f00b00434b809a2e6mr3769799qtc.27.1712939312874; Fri, 12 Apr 2024 09:28:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712939312; cv=pass; d=google.com; s=arc-20160816; b=nq45MNKehmXdYE5byJ/vmDmqzmLI4+36lvs4GhbE/xwm+JVyP53MAn74YaYp4yYTvW xw+6VcoC0SEBHE6DAeof5gVu2S6tryWVQmd78dxNBwots8zGYf8m5Tv9TG6BdGeuvrlq gO3+VwKZwS8ubu7NYCRqRaGYwI8/qSdHoxFnoQfimW90L1WLzEYo/4PkJbXWN1Qrg5Jd Qz3IUUE/eNQn6udiW0xmP0Ky2v18csAqO6A1G8M8xU+CYYcfOJI+evpDGmNZiYWccJ8q z91thGZX7TqORV3kxX29+o6aMBiGECq+rmdqOywIMXpmf5m210GUZs6WuCgXQh3sHqMc S8nA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=QYntXZdoi7WkxkaIyXPE6BDjkp0/3+LU4cg8c9cMoRg=; fh=xR2HfKTHkBbK1//vHU7DStWYjVTeY8Ky1HqgxSWJuGQ=; b=Wi8oiQaToj5c3ZGrpxTXhYgEsVm5slhMRV2KvWNdjbzpzviUS22L8zBhENGTnUilA6 BBNsieduiXDiUzA2rjBQYwphjXg3A15llePXV3y1y5sYjIlJNuy6AO+PFueGFjs5D5h0 bK1YAncU3A6xq1ztWWcyV4B4HkWA3SuBeA8xkGt9MDxM7iIpaFgJ+OzMZz4gOlkGxL2l y83AmdCEjVk6HNdD6eE6eTowQQO1EhOseaiT4hMHw9eTfd/FtR93EgX8jsw6UMZVpR7M 7RLE+IaI6zWhYRgB6MRLexJhFtI7l0PJaOLwPlvc1ohhFwdhXhJaFaV5OnfHnrSEa4B9 Fjag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-143083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x7-20020a05622a000700b004367b8de604si2787015qtw.295.2024.04.12.09.28.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 09:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-143083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 97FE91C21172 for ; Fri, 12 Apr 2024 16:28:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDE16149E1E; Fri, 12 Apr 2024 16:27:28 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F01953811; Fri, 12 Apr 2024 16:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712939248; cv=none; b=boep+kbp5rcIHAQkTWR5IFivsp5osYBWINSud3ZsrJWIoNgsp2IYv4AXvcarYl99erExxutz361WGux3J/c9PhwdcjWdFDUvm0s5VODD4BpN5RzssB8O60Vu5SULskRnK+5SVhhiE3cFTE2eJpYLuVHcX0s/fnSVqZwSXE2DtPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712939248; c=relaxed/simple; bh=x1mJqb5IdHWSDUYkH+KJm31NSUYWB60CrRprSbXv6A0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ivqgMuS32wqXxCqHd+JV02p308Dtm1rPIHTRJQsujIba3UX1b25mtqoMf+QVghQiaNtxlKZuca2jkPfxKnGWU1cUyLUGB8/mTI9SQDeeC2LfVjXWFbtgnR9PJD6m+4aVrbnTOYVOt8hGGh9/abmdZMY+ewEVmchTWwUcPMQgvhE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 E9A92339; Fri, 12 Apr 2024 09:27:55 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 746CC3F64C; Fri, 12 Apr 2024 09:27:25 -0700 (PDT) Date: Fri, 12 Apr 2024 17:27:23 +0100 From: Sudeep Holla To: yunhui cui Cc: Jeremy Linton , rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org Subject: Re: [External] Re: [PATCH 1/2] ACPI: PPTT: Populate cacheinfo entirely with PPTT Message-ID: References: <20240407123829.36474-1-cuiyunhui@bytedance.com> <2cde00c8-7878-45c0-8621-fca4e70c75e7@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 12, 2024 at 05:08:01PM +0100, Sudeep Holla wrote: > diff --git i/arch/riscv/kernel/cacheinfo.c w/arch/riscv/kernel/cacheinfo.c > index 09e9b88110d1..92ab73ed5234 100644 > --- i/arch/riscv/kernel/cacheinfo.c > +++ w/arch/riscv/kernel/cacheinfo.c > @@ -79,6 +79,27 @@ int populate_cache_leaves(unsigned int cpu) > struct device_node *prev = NULL; > int levels = 1, level = 1; > > + if (!acpi_disabled) { > + int ret, fw_levels, split_levels; > + > + ret = acpi_get_cache_info(cpu, &fw_levels, &split_levels); > + if (ret) > + return ret; > + > + /* must be set, so we can drop num_leaves assignment below */ > + this_cpu_ci->num_leaves = fw_levels + split_levels; > + > + for (idx = 0; level <= this_cpu_ci->num_levels && > + idx < this_cpu_ci->num_leaves; idx++, level++) { > + if (level <= split_levels) { > + ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level); > + ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level); > + } else { > + ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level); > + } > + } Ofcourse we need to add here, return 0; > + } > + > if (of_property_read_bool(np, "cache-size")) > ci_leaf_init(this_leaf++, np, CACHE_TYPE_UNIFIED, level); > if (of_property_read_bool(np, "i-cache-size")) > -- Regards, Sudeep