Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp578414pxu; Thu, 15 Oct 2020 11:00:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziB7dXrTFgYttUocyQYHRu54HxzCvW4T3wskmdKtvU4VbxihghA4NKT10hWe9n/14KjCdH X-Received: by 2002:ac2:52b2:: with SMTP id r18mr1354349lfm.498.1602784848778; Thu, 15 Oct 2020 11:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602784848; cv=none; d=google.com; s=arc-20160816; b=jvGEPkqcFKQ1PDN3oxPtTIdpkYTxIDvgiX7wtiNohO995HVZgJv6PqkxWDzL/oglYD PQ5gABFm9S5emXCrecCaovTW1Pv4776HFrZG79H7x8lH4cG1PC6bi3f0WP0oL7ZqPdGh 2MsyuzzDUJDg/xqsVjQ9PxKTWTFfmABaegREvqfvJD4Cug4rcDdZ5pqw96UWAeKgxkuY liHTxoT/ZnWddQOcW11fPtEWORHJ8nddAEEp1VDVvdXTsCLOtroB72+bzeuQA9hkF1m7 W0gBaH3Pun1arHxCKmQQIKhL9TAqZeNLpMaiTntfTEcK3X1Yz1dqcEZN749V1vNDAN5b hUDA== 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=tuOiptwUcTw3B+JTlOPJ1hQKiAZmb57OOllS8zOlEOE=; b=TwyDy7RIRecGgoq2JyJa5Kkl0kTaTmTW/V+AlMK+hdZPHCsMsZgGWXySjZ123ndM5O eg4klLfyxN3gSVGaO0O6GOHjAPbsIba7aUfdYEwZGP4Z8fUhiiteB8wYIwcUphCKQc10 wRvWujRSB8kenDALtOr0GLgHw8dxgUZ70dOpKa/MHvxHt6Qclm9Yg4UUt8VSmSOmUWLw CAhuhYLG9xEjsezlCPQ6dDNvBT/P06FUwgWXS+4oINtk/JqrXT1uckCETR7kDrKnxiam mYLPF9F7phkE7S1L5vw890xjttTRC2c6qjjeK0GZdUj1jzz283VhJdXwCqWYZOXhUcSM sNmw== 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 ga18si3057061ejc.378.2020.10.15.11.00.15; Thu, 15 Oct 2020 11:00:48 -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 S2389004AbgJOJvd (ORCPT + 99 others); Thu, 15 Oct 2020 05:51:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:38744 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388789AbgJOJvc (ORCPT ); Thu, 15 Oct 2020 05:51:32 -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 22A4FB228; Thu, 15 Oct 2020 09:51:30 +0000 (UTC) Message-ID: <165ca8621058696f7df8e8f894cf647b3171d6fd.camel@suse.de> Subject: Re: [PATCH v3 4/8] of: unittest: Add test for 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 11:51:28 +0200 In-Reply-To: References: <20201014191211.27029-1-nsaenzjulienne@suse.de> <20201014191211.27029-5-nsaenzjulienne@suse.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-X8qOX67+76GtlnxqUBk7" User-Agent: Evolution 3.36.5 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-X8qOX67+76GtlnxqUBk7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2020-10-14 at 17:04 -0500, Rob Herring wrote: > On Wed, Oct 14, 2020 at 2:12 PM Nicolas Saenz Julienne > wrote: > > Introduce a test for of_dma_get_max_cup_address(), it uses the same DT > > data as the rest of dma-ranges unit tests. > >=20 > > Signed-off-by: Nicolas Saenz Julienne > > --- > > drivers/of/unittest.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > >=20 > > diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c > > index 06cc988faf78..2cbf2a585c9f 100644 > > --- a/drivers/of/unittest.c > > +++ b/drivers/of/unittest.c > > @@ -869,6 +869,25 @@ static void __init of_unittest_changeset(void) > > #endif > > } > >=20 > > +static void __init of_unittest_dma_get_max_cpu_address(void) > > +{ > > +#ifdef CONFIG_HAS_DMA >=20 > Can't the unittest run without this? I run the unittests under UML. It was cargo culted from its sibling of_unittest_dma_ranges_one(), now that= you mention it, I can't seem to find the reason why it's here in the first plac= e, nor for other similar usages in OF code. I ran the test in UML with all HAS_DMA conditionals removed from OF code an= d things went well. I'll prepare a fix for that. > > + struct device_node *np; > > + phys_addr_t cpu_addr; > > + > > + np =3D of_find_node_by_path("/testcase-data/address-tests"); > > + if (!np) { > > + pr_err("missing testcase data\n"); > > + return; > > + } > > + > > + cpu_addr =3D of_dma_get_max_cpu_address(np); > > + unittest(cpu_addr =3D=3D 0x50000000ULL, > > + "of_dma_get_max_cpu_address: wrong CPU addr %pad (expe= cting %llx)\n", > > + &cpu_addr, 0x50000000ULL); > > +#endif > > +} > > + > > static void __init of_unittest_dma_ranges_one(const char *path, > > u64 expect_dma_addr, u64 expect_paddr) > > { > > @@ -3266,6 +3285,7 @@ static int __init of_unittest(void) > > of_unittest_changeset(); > > of_unittest_parse_interrupts(); > > of_unittest_parse_interrupts_extended(); > > + of_unittest_dma_get_max_cpu_address(); > > of_unittest_parse_dma_ranges(); > > of_unittest_pci_dma_ranges(); > > of_unittest_match_node(); > > -- > > 2.28.0 > >=20 --=-X8qOX67+76GtlnxqUBk7 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+IG6AACgkQlfZmHno8 x/4LMAf/QcDwrq8xC+sEW6qMg3hpF9bfJCqcr+hehJmADyEcCDmz8TevhzumZXeM RtlVB67o7Z2bAeSpOqTlQGQHYLdWu3zZ+Zqu0PRjUdQ6CE1l9qzLj1TSIME93HrV kSSiqWLmOlbyISGAb1pFKbzsVqIX4t+Zn6CuH+BBLl4YimWi0Fj2aCNXSobo/K9J aOkm5VtaIWCYbrv44+KHzpP+pJZIPl0Ya0NOzH2c2YgmL7nj7meneGEWaiRX7p8d A/5dnYZRj/HJ+VOYW36zDfzsp5nHZxJVMXG76QJYFSleD36Skl2IyjfYQS+XwMEb rKyrJ54T41B/RpMYjTMKcmO+x/BUMQ== =Nev7 -----END PGP SIGNATURE----- --=-X8qOX67+76GtlnxqUBk7--