Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1708947pxb; Mon, 8 Mar 2021 04:36:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFtijirtqShM7m0nxITjV1qDqg15xwVuhq/S+hkEI25JBrn/zMrOyO1+OD1WGGLqbUtmIC X-Received: by 2002:a17:906:7e12:: with SMTP id e18mr15426628ejr.316.1615206964737; Mon, 08 Mar 2021 04:36:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615206964; cv=none; d=google.com; s=arc-20160816; b=XKQ5i0KXigm5O/OlIlk6lgHiR9WYD4FftJ9V62LG5Zv0zw69ZlxMOmaTSizQ5JcaNu B8ZcIXdhq4hcY2Uto3ry0VNXiZctNGYHEBaNsQJnmr5yEeS1VsKtNHHf4WmjptbEIwiP 8b6n6Di4jG2BPww9zPiy5bpoAcnMn2jEHvp/eCZTttTb40b/oD8FhCHuuF9R0S213eDR dzpgeHYLYWmBdjnT7DDte41l6HbPXQIgNL2sxmCdIBQIgdE7avPEE777Uu1QS9bu1A6t uSzqy2Lp+svUyKnDVBd1G6FKeIwRtvcCwtK2byefKFMGgagiSZl9dGLQ/lW3hRGXgLfs MPXw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Iu3c0gw+mlGGRjmhUYP/dZoJf7jPrnaWsDz5F1HvcW4=; b=MQluLJWoIsvNhVQ0JuMdpMN/WlVfV1tZFt8WkTSXtdrAAz8Z90Xx6Rlo/HCLdbnOx5 5qoQv8c5v2gr/UsighXHDMMtTTbMZFKjv3w/G2lF2RaXR4Cm6BECyotJ2/lzANmRE1VU ryZZ6uFqHNP3LY555jLXAsz0fll5ITErP0RgaWExxa4Rfnrw2cO5AXd86QFPXvtgTM8Q nk2AmTpTRyCXGkUpBnQnDrqCgreBbuQ41Ri2HIqdnXXh1KsZdTBD4dAk3WidyjT5nWo0 Y4UF1klBTwCQLNRTPdegHILSo33WiI+E0enn3SpSpO39FFdUoQq0h1sU55ET4HSQVoO/ dllQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Y2/pI5y0"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by3si6717562edb.496.2021.03.08.04.35.42; Mon, 08 Mar 2021 04:36:04 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Y2/pI5y0"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229573AbhCHMep (ORCPT + 99 others); Mon, 8 Mar 2021 07:34:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:42834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhCHMeJ (ORCPT ); Mon, 8 Mar 2021 07:34:09 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 67724651CF; Mon, 8 Mar 2021 12:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615206848; bh=F5akjDWHp3LV9bRAZxw84XdwjvgbxiVEz7QpotCOHbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2/pI5y0cw3ohcO89n/4/mOoj/9GI+r2WTz3ZClYtq+BP2uXd6WB8bALsQ3ugdmWr GBTOCqeby0fLW8Yb9DM1QP6qex87JSAQvckHyQ+WQlGPte6KtIZhx8MCdjjuBBEOuy rlfGt4E1JsN8EwGXBTRres6g1RRMGx+p+dMHicoU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Saenz Julienne , Rob Herring , Catalin Marinas , Jing Xiangfeng Subject: [PATCH 5.10 27/42] of: unittest: Add test for of_dma_get_max_cpu_address() Date: Mon, 8 Mar 2021 13:30:53 +0100 Message-Id: <20210308122719.466319281@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210308122718.120213856@linuxfoundation.org> References: <20210308122718.120213856@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Saenz Julienne commit 07d13a1d6120d453c3c1f020578693d072deded5 upstream 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 Link: https://lore.kernel.org/r/20201119175400.9995-5-nsaenzjulienne@suse.de Signed-off-by: Catalin Marinas Cc: Signed-off-by: Jing Xiangfeng Signed-off-by: Greg Kroah-Hartman --- drivers/of/unittest.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -869,6 +869,23 @@ static void __init of_unittest_changeset #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();