Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp637734pxb; Thu, 19 Nov 2020 09:57:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwW3nJp84x2FK7jfQpjSwFizLTyIUDNldQpfDQJpkOLv1vznUFvJHuW2PUQo9eAREllR9Qv X-Received: by 2002:a05:6402:b8b:: with SMTP id cf11mr31844520edb.74.1605808629811; Thu, 19 Nov 2020 09:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605808629; cv=none; d=google.com; s=arc-20160816; b=B9mjDpH8XpcXhbg1B+3mrfWbBLUAwiBXH+4jhz3V+UlNghVPfClH+uVbxCfjqEH6eT W14jD6ZLBQBkdRTIkTR1siHATmAfVluF2gkzJj9xUdvDCAJK6J+36ODpg7awN+FoKNZx M9Bb+dEh1QTAAqHudSqMiQQhKqQn/POB6vWyBncbYrQQTlzRh1xkAXZCkLNSdbdeOKqm EgwIfdc25OKIedRJA9i31QT0z7S2gTMOROJ9vRgC/T+uVowEyT/FAD+ZQHQomA+nRGLw B5tyIVmojt7lPne9ltMkwNzQx1xojvKpH8/4Iv0tDqJOZ2Ifh/JmEcVUsQra9kfNEfec zTmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JHIqod89t2NK/R1kFOoaFm9+/I02M30d2GugXBoN4v8=; b=LAHW86weu7CFhbwW9dNBeyNoo6/MqAC6oHyZIoxwubQfY216Peorln7BLr/RardD2l 7EhV2KFTMpGORVAuOxOgqe/1Ox2p6B86O1V85Q0+hsb7r9295ZIW9Uw9e1uUbQoLDcg/ bj/QuBk1E/E+NGwDLdoRG1UvXKExxPQOaMp0fj0GSjTIBaA+7iqI5/mWLOAkF9kACSLN yEpRq1FmUTizddWm6oIkC/gCwQKVsmnhZeqcadH6f8rDKJFYCNZ0bm7SYktFz8AQKUVT u/28fIWrX/+PtaoK5IH1TGZn1LNL7U3pdtywzO0vLCjOfGX4Sh+jVEeZFkzYooJP4fFB pTKA== 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 s17si256649edt.578.2020.11.19.09.56.47; Thu, 19 Nov 2020 09:57:09 -0800 (PST) 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 S1729501AbgKSRyM (ORCPT + 99 others); Thu, 19 Nov 2020 12:54:12 -0500 Received: from mx2.suse.de ([195.135.220.15]:40718 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727395AbgKSRyK (ORCPT ); Thu, 19 Nov 2020 12:54:10 -0500 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 07E31AD07; Thu, 19 Nov 2020 17:54:10 +0000 (UTC) From: Nicolas Saenz Julienne To: robh+dt@kernel.org, catalin.marinas@arm.com, hch@lst.de, ardb@kernel.org, linux-kernel@vger.kernel.org, Frank Rowand Cc: robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, jeremy.linton@arm.com, iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, will@kernel.org, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, Nicolas Saenz Julienne , Rob Herring Subject: [PATCH v7 4/7] of: unittest: Add test for of_dma_get_max_cpu_address() Date: Thu, 19 Nov 2020 18:53:56 +0100 Message-Id: <20201119175400.9995-5-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201119175400.9995-1-nsaenzjulienne@suse.de> References: <20201119175400.9995-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce a test for of_dma_get_max_cup_address(), it uses the same DT data as the rest of dma-ranges unit tests. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Rob Herring --- Changes since v5: - Update address expected by test Changes since v3: - Remove HAS_DMA guards drivers/of/unittest.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 06cc988faf78..98cc0163301b 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -869,6 +869,23 @@ static void __init of_unittest_changeset(void) #endif } +static void __init of_unittest_dma_get_max_cpu_address(void) +{ + struct device_node *np; + phys_addr_t cpu_addr; + + np = of_find_node_by_path("/testcase-data/address-tests"); + if (!np) { + pr_err("missing testcase data\n"); + return; + } + + cpu_addr = of_dma_get_max_cpu_address(np); + unittest(cpu_addr == 0x4fffffff, + "of_dma_get_max_cpu_address: wrong CPU addr %pad (expecting %x)\n", + &cpu_addr, 0x4fffffff); +} + static void __init of_unittest_dma_ranges_one(const char *path, u64 expect_dma_addr, u64 expect_paddr) { @@ -3266,6 +3283,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.29.2