Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp594947pxu; Thu, 15 Oct 2020 11:26:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeQQYt3Pj39iVqjWgM1aFmOJfYIQSoKkZi0+xytKFYfX86S6lGjXmzFOQ7Zs63zH9P98Ok X-Received: by 2002:a50:950e:: with SMTP id u14mr5759452eda.260.1602786382875; Thu, 15 Oct 2020 11:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602786382; cv=none; d=google.com; s=arc-20160816; b=aCZb4iNJ6jtLd+IeNCGoxzDSfaoPqlqZ5YmJyF0/w1NqkeiGQz6svMBqw0VeKD3SLR MG9TAJD23NzMXpJM2YpihWSIjCTvleg/+8VY3+wpZz2pjpB6UxrLOhT1uxZ/eswXKH1J g9Q7BteFkQxp4OEFU/5nSF2ebscHWV0KDp0rxdQTGaZ9PSUwyBtwfhv/jm+HoekbWLDW Sg6z3hfNZqcn4Kc1dTpNinvoW/HRc82YRDVTGwLTxgQU251F2bz2NVeUX4MNn92Q9Wzp BoyrHF+TyrtTDXOTPq5BR3hggmGTmfz+t24vghSSdtdQGaRXSxaF1nkiWARex1JbziWf SJuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :date:cc:to:from:subject:message-id; bh=WE2XMrDobD26Nkwxm36fyHdQZp2BA6V89DZCymjIn6A=; b=XCibAwVZQYz17rlVZHwGrjrsigQVON+wsHzt3fdd+gPWcz1AYEVttv3hK7BIriBgON mPcT+dQV0n4sBj4AoNZ9Nlje0zc9GK7Ykz03FGN1sF/ob7H2maE1SpvmPhBKZVPXooC2 PfiLPooa61nGFXQrWyBb87KdNMpSIGFSMKaCpUQPfY82ZykfG8QpOsmSHNGCiQPitI9B JjUq3K7zppc+K1MzxJv9gv0sriiqsY7oXdMWF+I12J4rXWob+nt0dME65zmvlY0VgCtm cuqpJrzaewk7RsDskIlnhxsZydu61GQ0n76u2V/qYKpWL/cTfx69kvtt1XWev4CI0cKa lzqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si2731175ejf.560.2020.10.15.11.25.51; Thu, 15 Oct 2020 11:26:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730437AbgJOIyP (ORCPT + 99 others); Thu, 15 Oct 2020 04:54:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:57748 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730383AbgJOIyP (ORCPT ); Thu, 15 Oct 2020 04:54:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E0BDEAEC2; Thu, 15 Oct 2020 08:54:12 +0000 (UTC) Message-ID: Subject: Re: [PATCH v3 3/8] of/address: Introduce of_dma_get_max_cpu_address() From: Nicolas Saenz Julienne To: Rob Herring Cc: Catalin Marinas , Christoph Hellwig , Ard Biesheuvel , "linux-kernel@vger.kernel.org" , Frank Rowand , Robin Murphy , linux-arm-kernel , "moderated list:BROADCOM BCM2835 ARM ARCHITECTURE" , Jeremy Linton , Linux IOMMU , devicetree@vger.kernel.org Date: Thu, 15 Oct 2020 10:54:11 +0200 In-Reply-To: References: <20201014191211.27029-1-nsaenzjulienne@suse.de> <20201014191211.27029-4-nsaenzjulienne@suse.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-YUQJ5U+i4xNz/NZrjBJR" User-Agent: Evolution 3.36.5 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-YUQJ5U+i4xNz/NZrjBJR Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2020-10-14 at 17:02 -0500, Rob Herring wrote: > On Wed, Oct 14, 2020 at 2:12 PM Nicolas Saenz Julienne > wrote: > > Introduce of_dma_get_max_cpu_address(), which provides the highest CPU > > physical address addressable by all DMA masters in the system. It's > > specially useful for setting memory zones sizes at early boot time. > >=20 > > Signed-off-by: Nicolas Saenz Julienne > >=20 > > --- [...] > > + struct of_range_parser parser; > > + phys_addr_t subtree_max_addr; > > + struct device_node *child; > > + phys_addr_t cpu_end =3D 0; > > + struct of_range range; > > + const __be32 *ranges; > > + int len; > > + > > + if (!np) > > + np =3D of_root; > > + > > + ranges =3D of_get_property(np, "dma-ranges", &len); >=20 > I'm not really following why you changed the algorithm here. You're > skipping disabled nodes which is good. Was there some other reason? Yes, it's a little more complex. But I had to change it in order to be able= to start parsing down from an arbitrary device node, which is needed for the u= nit tests. for_each_of_allnodes() and friends will traverse the whole tree, regardless= of the starting point. I couldn't find a similar function that would just iter= ate over a subsection of the tree, so I went with this recursive approach. Regards, Nicolas --=-YUQJ5U+i4xNz/NZrjBJR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl+IDjMACgkQlfZmHno8 x/7rjAf+KrPaZm2zT8XfzDn5CDIf7492No2jTgiouPN9YLIyCBwWqNc3j9ApACr0 Boxl6eP0BL49yAtVQJz+hq86/9a1TTbqs+xj1mdUG0KruCrKQvSm8sd8DexTFBaV zw7F1cvFs6HgYqAmNfK5ybVBoDy1Br0LVK5E05S2baUkID/HZDVSGEwhS3FSaRQP WcMPbmIvPgxNg1/Tk16wi9rX2FToZCJymwwil45nHAFnc4hSsudcTHFmX4Td8J01 jd51b5qeWQ1mX3LY7a4xo0YiR18m69VB0ToPRpQKQvAb24nxMatXip9NtseykiQs 4jVbFSQAT/FxsnzgjJRMVHJOBZFvAQ== =1G9v -----END PGP SIGNATURE----- --=-YUQJ5U+i4xNz/NZrjBJR--