From mboxrd@z Thu Jan 1 00:00:00 1970 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 025BBC76195 for ; Mon, 27 Mar 2023 14:04:31 +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: In-Reply-To:MIME-Version:References:Message-ID:Subject:CC:To:From:Date: 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=HtKaAgpjh/7zFSTH6PvBBPamNPQITFZgBXJIboSto58=; b=Bo0hzLUt6VCYqdFjoriHkOZs8/ E1oNzN2I3tw/c/hEqMtEHdY0ZxjQphX+44coYK3VZGTRkyQOYr6xIhX+mwEjyF18swz/a89ZgAwGx XJ6lo2FVp8XjRK5+hAL0FaThZ0oA9B0etfD3E0zaEvp1DrKtYLg99yBkEOh81x/blJAyKEzOagwmg M4tmeotq9MyF49++sOYx8dcxX4yt21NH1PAS4fHEz2nRt5oPKNRoJeltCjQu2A9LRorAdov2claAH Z2E+Er0cUrti18DsQaDD4iffl5l/bi+smDDO8sMN7KtxCZsxS+eeQu+vNAt/3PmRbra4lm9xbCEuW 4+bBNmLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgnR0-00BCWF-0y; Mon, 27 Mar 2023 14:02:54 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgnQt-00BCVf-24 for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 14:02:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1679925767; x=1711461767; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TZJNfR83lx4nJswcwFr/ia7Rk0WaWuVxn+mINr7UlXo=; b=LAo3JxX11oyo2buL/KI9XDjHoR+h0XtIWiWBFPUdGDcfmV+Po2clLsD9 PYJRNQUjRQ/VEn9XICo/1f1t53PiaslDg3rcqv0NJYQTg3L200akqOQse DnX3xrYCD3cameS+7UvEXWS6XspZ17wDBnJqZ+jEDIvAJoNSN0AfHHwUk CZSRMBnrhoEcWB4oO03xZasngWrSV9QJdrsXX0COARFf3eavf8+d1aBJG CtubA7TDweIAWh146UTR7Hg1zRYFQq9knH3GI9n//YeIrqVx5zVPo2WrK LUzxl0TN2Y/S+K/NnDPT8vbxoENzy1jNRPboqm8kGYgsDiSMqTZfaX8Ck w==; X-IronPort-AV: E=Sophos;i="5.98,294,1673938800"; d="asc'?scan'208";a="207440248" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Mar 2023 07:02:44 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 27 Mar 2023 07:02:44 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Mon, 27 Mar 2023 07:02:42 -0700 Date: Mon, 27 Mar 2023 15:13:59 +0100 From: Conor Dooley To: Pierre Gondois CC: , Radu Rendec , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , "Rafael J. Wysocki" , Sudeep Holla , Akihiko Odaki , Palmer Dabbelt , Gavin Shan , Jeremy Linton , Subject: Re: [PATCH 2/3] cacheinfo: Check cache properties are present in DT Message-ID: <8296483f-4056-4e64-890f-3f676edb3c3d@spud> References: <20230327115953.788244-1-pierre.gondois@arm.com> <20230327115953.788244-3-pierre.gondois@arm.com> MIME-Version: 1.0 In-Reply-To: <20230327115953.788244-3-pierre.gondois@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_070247_764320_7431C064 X-CRM114-Status: GOOD ( 15.99 ) 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: , Content-Type: multipart/mixed; boundary="===============0382744086356207575==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0382744086356207575== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Hgtnu3DfB5qE0km9" Content-Disposition: inline --Hgtnu3DfB5qE0km9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 27, 2023 at 01:59:50PM +0200, Pierre Gondois wrote: > If a Device Tree (DT) is used, the presence of cache properties is > assumed. Not finding any is not considered. For arm64 platforms, > cache information can be fetched from the clidr_el1 register. > Checking whether cache information is available in the DT > allows to switch to using clidr_el1. >=20 > init_of_cache_level() > \-of_count_cache_leaves() > will assume there a 2 cache leaves (L1 data/instruction caches), which > can be different from clidr_el1 information. >=20 > cache_setup_of_node() tries to read cache properties in the DT. > If there are none, this is considered a success. Knowing no > information was available would allow to switch to using clidr_el1. >=20 > Signed-off-by: Pierre Gondois > +static bool of_check_cache_nodes(struct device_node *np) > +{ > + struct device_node *next; > + > + if (of_property_read_bool(np, "cache-size") || > + of_property_read_bool(np, "i-cache-size") || > + of_property_read_bool(np, "d-cache-size") || > + of_property_read_bool(np, "cache-unified")) > + return true; > + Rob's been purging use of the of_property_read family of functions recently [1], should this use of_property_present() instead? Cheers, Conor. 1 - https://lore.kernel.org/all/?q=3DUse+of_property_present%28%29+for+test= ing+DT+property+presence+f%3Arob --Hgtnu3DfB5qE0km9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZCGkpwAKCRB4tDGHoIJi 0pRoAP0WVrUP5UjiaYB8ZCpfCqjV3qY2LjPQSE3Y6IDjDSpf2gD/bopWKFK6af36 f9d0cWw9AtjwFaxEB/HUyCa5Eio65wE= =4KTq -----END PGP SIGNATURE----- --Hgtnu3DfB5qE0km9-- --===============0382744086356207575== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============0382744086356207575==--