Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3014546rdg; Tue, 17 Oct 2023 01:41:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNOmwPAWuJ1uRsaglV/ikGRwZfMMS/NakbXEqpPzMhxNUvYLlqEGecODQEQiiRL/D/eQra X-Received: by 2002:a17:903:32ca:b0:1c7:7c2c:f828 with SMTP id i10-20020a17090332ca00b001c77c2cf828mr2289634plr.8.1697532078320; Tue, 17 Oct 2023 01:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697532078; cv=none; d=google.com; s=arc-20160816; b=ZvyrIL+uiBCOas6sWh9HfxCW2dpDUcGJK1hz1gXP2JvYNBBZIykX8RZxvG6dO8srRx 0N2b+oQLj939gtgd6MQC28e6tOQQXsD8e2s1Y29ADO8Dz9Ojvdq4jA8gPiIsJGJPzt1t kvklWk+uN8L9ENvVIzkGpqvc6hV6m9UHdmjy/eMCyPnhgDbxrS7N/peMDLSkLUzJppgq XuUBOQXw0jlQIMWjCO4CAnwTtbiwra+MiatJ0qnEciCqA7ylDlcz6nt0q/w1DUO/tJbo KrktaVH1+W0ew/sG0A0SOw599cEXIlOmZwplXh9eaU3JCYmUqsBu9UKJ62fj09Zppbbx AfYg== 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:dkim-signature; bh=vB/kfuKzCfr9/00WQN4N9vxRELf8bEUkzHFo66uF28g=; fh=Xq66kxivjKwuN8Tn9zClW/Px2sNHrAYNHjj5MSqWLXg=; b=sIaxvr3DI+dKlUpOSQTuWoWjp5zqI///HFS0Tmm/cd3oq2ACDl8stSlSiuhNrDUrLO 5Wlc2+maUff+opM0pOr6ZgkolwZOGe/8hWq3JqrAWpO7/zmgNLSJ8DY6r66alP+vlDlq nkxrNulSnBRurIFqDH6qBu7LPwPv+a+rglBEf7H/TTzIqIPqTYJ9JZZmnoEm2qMOfdRm NH2BZ0H5Z9ryhEYn7nIXC5bKt3WZmHmMVg1CTNAzVEWfFv1G1pFZr8Z86uh3IxR3ySgF 4DqxMlq68P84fdn/OnNTH6vI2AeeLeYT2gvlElbHTpP302FtTmD9+VSsvs9IMeE0WWle 54jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=R3ZF9f1H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id j3-20020a170902758300b001c61bd7cee0si1215551pll.211.2023.10.17.01.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 01:41:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=R3ZF9f1H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 1FC8380AB5BD; Tue, 17 Oct 2023 01:41:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232134AbjJQIlJ (ORCPT + 99 others); Tue, 17 Oct 2023 04:41:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234620AbjJQIlI (ORCPT ); Tue, 17 Oct 2023 04:41:08 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F323E8 for ; Tue, 17 Oct 2023 01:41:06 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2c4fe37f166so61342801fa.1 for ; Tue, 17 Oct 2023 01:41:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1697532064; x=1698136864; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vB/kfuKzCfr9/00WQN4N9vxRELf8bEUkzHFo66uF28g=; b=R3ZF9f1HNyy7HOzN+cTg0IAThBU+IHV8MuZTrM97HH1IrK2VM3FN/mic4pWarQQfO7 dE6WTJ83n1aDTU/nZ5HnCUORtJ2yAFGiYHTbMthWP4xACRdLolETRTLPwwwtVLRP4OEY 5x3f9uomRT+eRZOZZKGuPhwXLKnyZbl0pX1xFRjhpA58x++HJ2bAolWERx6bJILdT6n6 pe/IY+sZyd7TDP+ibYrt3iCEiGHumINC2Bv9nlgrmdifB/Rrf4/JAEjxmh3HoEx316n1 h/ZvQevyCkhc10wsdJWXWGYeJmm3qw+DPXJ/YbTbCxFrH1Kr2dzVUAg3OAA3WS1VASZi aKxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697532064; x=1698136864; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vB/kfuKzCfr9/00WQN4N9vxRELf8bEUkzHFo66uF28g=; b=e5+4VxhbbeiHC9xXqKbHQsmWH+Vw4g7Bp/JfUdhlgdvA99y5mLMPjr529s4wf99mfR PGb3YFb9/fFFIUp3kwpSWQ/6OjUbwK3ToeJQThpIBHjH/M7RKrt+I2BkTj7N5mo9Aeda shODZJ3gfm51+3zHCb9YV/UmfRXcmxea95Duio08CHbUAwkcJru3ZvYOjQrI4D858Ysf ayNsRVM5nwuoZ+A2WYH2PQ1hSNZIxD7BoiXv4vmfwSCFhzZCe3L3w2gGz+3z0QA4xNLw umVhceJou0kqDfDLKSvBhbpWvzO9zEc3dvYaKpztiT4T6nOyy06t0lETpHl/pOAjA66O RWIA== X-Gm-Message-State: AOJu0Yz0EvUdTAfr/+FM0EGqnDdvjSMFv3VowaWLy6xDUOkbGJ5xxcWI Y4/yp4+ltrP1nCkGiC20IhzbnQ== X-Received: by 2002:a2e:9214:0:b0:2c2:8f22:d9c2 with SMTP id k20-20020a2e9214000000b002c28f22d9c2mr1361491ljg.22.1697532064466; Tue, 17 Oct 2023 01:41:04 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id n2-20020a5d51c2000000b0032da4f70756sm1164746wrv.5.2023.10.17.01.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 01:41:03 -0700 (PDT) Date: Tue, 17 Oct 2023 10:41:02 +0200 From: Andrew Jones To: Sunil V L Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Conor Dooley , Anup Patel , Ard Biesheuvel , Atish Kumar Patra Subject: Re: [PATCH v3 -next 3/3] RISC-V: cacheflush: Initialize CBO variables on ACPI systems Message-ID: <20231017-e198b2c70475b6f09754d175@orel> References: <20231016164958.1191529-1-sunilvl@ventanamicro.com> <20231016164958.1191529-4-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231016164958.1191529-4-sunilvl@ventanamicro.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 17 Oct 2023 01:41:16 -0700 (PDT) On Mon, Oct 16, 2023 at 10:19:58PM +0530, Sunil V L wrote: > Initialize the CBO variables on ACPI based systems using information in > RHCT. > > Signed-off-by: Sunil V L > --- > arch/riscv/mm/cacheflush.c | 25 +++++++++++++++++++------ > 1 file changed, 19 insertions(+), 6 deletions(-) > > diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c > index f1387272a551..55a34f2020a8 100644 > --- a/arch/riscv/mm/cacheflush.c > +++ b/arch/riscv/mm/cacheflush.c > @@ -3,7 +3,9 @@ > * Copyright (C) 2017 SiFive > */ > > +#include > #include > +#include > #include > > #ifdef CONFIG_SMP > @@ -124,13 +126,24 @@ void __init riscv_init_cbo_blocksizes(void) > unsigned long cbom_hartid, cboz_hartid; > u32 cbom_block_size = 0, cboz_block_size = 0; > struct device_node *node; > + struct acpi_table_header *rhct; > + acpi_status status; > + > + if (acpi_disabled) { > + for_each_of_cpu_node(node) { > + /* set block-size for cbom and/or cboz extension if available */ > + cbo_get_block_size(node, "riscv,cbom-block-size", > + &cbom_block_size, &cbom_hartid); > + cbo_get_block_size(node, "riscv,cboz-block-size", > + &cboz_block_size, &cboz_hartid); > + } > + } else { > + status = acpi_get_table(ACPI_SIG_RHCT, 0, &rhct); > + if (ACPI_FAILURE(status)) > + return; > > - for_each_of_cpu_node(node) { > - /* set block-size for cbom and/or cboz extension if available */ > - cbo_get_block_size(node, "riscv,cbom-block-size", > - &cbom_block_size, &cbom_hartid); > - cbo_get_block_size(node, "riscv,cboz-block-size", > - &cboz_block_size, &cboz_hartid); > + acpi_get_cbo_block_size(rhct, &cbom_block_size, &cboz_block_size, NULL); > + acpi_put_table((struct acpi_table_header *)rhct); > } > > if (cbom_block_size) > -- > 2.39.2 > Reviewed-by: Andrew Jones