Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1427770rdb; Mon, 2 Oct 2023 09:10:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpUvy/0lgIVPUo2zuarTUudDXlMEGH4OtG5sLnWZYBktLUv2Irw/HoKWRgrJxAk0yn9GIt X-Received: by 2002:a05:6870:d286:b0:1b0:43b6:e13b with SMTP id d6-20020a056870d28600b001b043b6e13bmr13898977oae.54.1696263048600; Mon, 02 Oct 2023 09:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696263048; cv=none; d=google.com; s=arc-20160816; b=IMUD01feRzPsKIfnxiMfvQq83YAFA/06ly7B23/k1yA8xQZ+IruQBXGd4hZdeacdhl rrsa4/sx03G4SLY4zaCpzhSqrOkw+f6vvd0zaAYiKfKdEna5fWOyxe5fiXlIO2TQzM+r KgL7lBvfPqsvy0ImeBPsi93Wp1/k+DEm5GbFA2rOLojDlE1MT2xgXRB41M2z8zg60oVp NhnGAqT7RM0s6IhXPoiYwBwOeTiE8UjdByYd2aw8kbk0AIfLfC43q9Ye9OD9lsuWBRGb qBstueO3skTMddEMIkaL37kbnOD8tui5TsfPvlQAMscKuli3D1CupxxH9s/JkhISnKVx hmDw== 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=T493f7Vyixq7p754xoQ/YuVbyf4zhcc0ZQ9soBsbgeA=; fh=vCgMkdkTwk0RfaTrMyS2m/dIFt3me7zxziafrvFP2xQ=; b=q06pZWosOESY5x/w0POrKtncvfADxN2BCm0/dBEBlqwVW3trCiwUEZyBI5YkYJl62k C262e9gllJv6xoeRsq5BqPEzFHiOiYo1p77eNDX5pX0CbvAbk0lAvV1bxkc8K+nPDsna 0mTyOLWmIgI/SRFO9i8nGs0V8tgJC7DzNynGQjHr41s99n4rhWGIbp/3KrvKjU8PW6OU 9blGjEsq0pMPlH3hmeci4Hmw4rAEmZ858iZPvsLFtmJyX8s85wtoV8yd12t0HA9qf3fk NxtA/dwDzL8DpEfOKKOFJVhYbwNFOfGcXM7U/htnb4RNMMoq+Wgu6ljd4hOKHEChoXwK ccLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tvRWKuVW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id a35-20020a631a63000000b00578ea9a0b93si27783060pgm.890.2023.10.02.09.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 09:10:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tvRWKuVW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BCF9D807D0EB; Mon, 2 Oct 2023 08:50:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238229AbjJBPud (ORCPT + 99 others); Mon, 2 Oct 2023 11:50:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237474AbjJBPuc (ORCPT ); Mon, 2 Oct 2023 11:50:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A892A4 for ; Mon, 2 Oct 2023 08:50:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6944AC433C7; Mon, 2 Oct 2023 15:50:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696261828; bh=O72E3ZVNiuEo0RBUJoTwRkR159xNbbJrFOP9dMKbWJA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tvRWKuVWaj8ZDjW2PP+a9TusRDq1llpPG8Nk7Nsz4ZPHQndBkZSfaUHAPBv3C8zEv iNleVb7s8tlNmWvnQXBgu+ir00/xLNR8+oI+jrJAoFHUnKIxJOWYBdi18PS6GBsunw t428Gpxn+T3QYlr8ELm1Gi1HpIouWSoX0gqX0lzzXm8JWomZrQT5xEVyXuKOdmFjd2 7XDDYGiKRpMdbuj8+/EqChEEk0rdxDTWq55vAcJR5HfSUKn/nH2TUAAfiHUUyw1VPQ BewBCu+ZtGWDYUcV6muQjccMoe5iS5Ak/L6mgpei0hCPILemPrQpwxAxAlVJkaK7JE yMMqQWpMCydiA== Date: Mon, 2 Oct 2023 16:50:23 +0100 From: Conor Dooley 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 , Daniel Lezcano , Thomas Gleixner , Andrew Jones , Conor Dooley , Anup Patel , Ard Biesheuvel , Alexandre Ghiti , Andy Shevchenko , Atish Kumar Patra Subject: Re: [PATCH v2 -next 3/4] RISC-V: cacheflush: Initialize CBO variables on ACPI systems Message-ID: <20231002-anyplace-impending-bcb62ca90f79@spud> References: <20230927170015.295232-1-sunilvl@ventanamicro.com> <20230927170015.295232-4-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o8PPxZtlZhU/WX3V" Content-Disposition: inline In-Reply-To: <20230927170015.295232-4-sunilvl@ventanamicro.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 02 Oct 2023 08:50:39 -0700 (PDT) --o8PPxZtlZhU/WX3V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 27, 2023 at 10:30:14PM +0530, Sunil V L wrote: > Using new interface to get the CBO block size information in RHCT, > initialize the variables on ACPI platforms. >=20 > Signed-off-by: Sunil V L Otherwise, Reviewed-by: Conor Dooley Thanks, Conor. > --- > arch/riscv/mm/cacheflush.c | 37 +++++++++++++++++++++++++++++++------ > 1 file changed, 31 insertions(+), 6 deletions(-) >=20 > diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c > index f1387272a551..8e59644e473c 100644 > --- a/arch/riscv/mm/cacheflush.c > +++ b/arch/riscv/mm/cacheflush.c > @@ -3,7 +3,9 @@ > * Copyright (C) 2017 SiFive > */ > =20 > +#include > #include > +#include > #include > =20 > #ifdef CONFIG_SMP > @@ -124,15 +126,38 @@ void __init riscv_init_cbo_blocksizes(void) > unsigned long cbom_hartid, cboz_hartid; > u32 cbom_block_size =3D 0, cboz_block_size =3D 0; > struct device_node *node; > + struct acpi_table_header *rhct; > + acpi_status status; > + unsigned int cpu; > + > + if (!acpi_disabled) { > + status =3D acpi_get_table(ACPI_SIG_RHCT, 0, &rhct); > + if (ACPI_FAILURE(status)) > + return; > + } > =20 > - 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); > + for_each_possible_cpu(cpu) { > + if (acpi_disabled) { > + node =3D of_cpu_device_node_get(cpu); > + if (!node) { > + pr_warn("Unable to find cpu node\n"); > + continue; > + } > + > + /* 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 { > + acpi_get_cbo_block_size(rhct, cpu, &cbom_block_size, > + &cboz_block_size, NULL); > + } > } > =20 > + if (!acpi_disabled && rhct) > + acpi_put_table((struct acpi_table_header *)rhct); > + > if (cbom_block_size) > riscv_cbom_block_size =3D cbom_block_size; > =20 > --=20 > 2.39.2 >=20 --o8PPxZtlZhU/WX3V Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZRrmvwAKCRB4tDGHoIJi 0nf8AQCTxt4VlxBrgtIhfufLcu2yyKEOu8gbSQy5sLNEU03knAD/crKrOne+Xeiz FzWiJRzcnFcqSj505sbzYo5m/x8tZQs= =z/P5 -----END PGP SIGNATURE----- --o8PPxZtlZhU/WX3V--