From patchwork Wed Dec 27 15:04:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 183489 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1489516dyb; Wed, 27 Dec 2023 07:13:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwbPFT6VOD6c4oW8AsXmFLDIdrG1cn+JAsc2gSP+tWHzA1EqtRUVMUhzPBHYSyG8kkuL99 X-Received: by 2002:a05:6808:4490:b0:3bb:c750:b99e with SMTP id eq16-20020a056808449000b003bbc750b99emr1203935oib.76.1703689990567; Wed, 27 Dec 2023 07:13:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703689990; cv=none; d=google.com; s=arc-20160816; b=plkeAil3W9a7xaJ76VtV4ssGzB3hqT0iLpuDCfsjWVvYr0LrBQHQRpMPSIG6qetmMF O6vq55uVMwvqUqXKk7+d/VMijHFjk+2x1aAaDyw4TAx1trw8EQOTH3SmZyUSA11usi+n jGKwv2DR6BWClHzTWUnY0xyoCh3B0VZtYJ1IC/bTqPA/A/RuAmKKLubpmr8hilweMnOj DOObTw3LANbw1x2rkFxEv4GrSdXH84vvoO5aCwIFcVhRWS9/iKRbgzkGndSH639vghy1 gF/f5n6BCjC9ykLYD891i3nSLTbg3ArFSt7RpjgLJo0j1VVFoUFe3Zy+WNRI0YwBk7Js 9hpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=GWsenZ5c4q8EEYc1AND5IbedgsVdySqhxGYR7OEzvMs=; fh=4ESZ1c62iMGhYlhC2pjn9wB4qPFQ2ZNstb13IlN3w/8=; b=Ntzj2kplyC1Zjbo1Y+UA1RLXo46N/gaGp3y8A+WVYmlWebHx2SHaZ122hNASol+MQb Ve7j+IsfZuFz11xX/SfhQNFsyKT2c42ES4/oScn5BVlbSj5Nm4OrFcykFsdQu/ISZOn7 EvNwpYChOi90JJtZ68gj1HqXBe3elmczuCLbqZHOwq24jvwpsp8UhwJtLLIJOuzqnTkv FCF0Skvvdfi3fgD4eg2OCgY4nLlTvjDt1i4YUGX02pqq67Q5zW+MGKBi+hx+6Qi7g2hd LO/BUNa88VGS8OrJTlDsQ3PR8XoFn40OCx47zYvBnoZ1fXappjwQbHNDUIuKUhhfMTcK EU5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tkos.co.il header.s=default header.b=mo8kuyQN; spf=pass (google.com: domain of linux-kernel+bounces-12075-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12075-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m2-20020a0561023e8200b004671dcc7601si499218vsv.220.2023.12.27.07.13.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 07:13:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12075-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tkos.co.il header.s=default header.b=mo8kuyQN; spf=pass (google.com: domain of linux-kernel+bounces-12075-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12075-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 535381C21828 for ; Wed, 27 Dec 2023 15:13:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C034E4652F; Wed, 27 Dec 2023 15:12:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tkos.co.il header.i=@tkos.co.il header.b="mo8kuyQN" X-Original-To: linux-kernel@vger.kernel.org Received: from mail.tkos.co.il (mail.tkos.co.il [84.110.109.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1F4145945; Wed, 27 Dec 2023 15:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tkos.co.il Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tkos.co.il Received: from tarshish.tkos.co.il (unknown [10.0.8.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.tkos.co.il (Postfix) with ESMTPS id 9B3B4440F44; Wed, 27 Dec 2023 17:02:43 +0200 (IST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tkos.co.il; s=default; t=1703689363; bh=vHknldfNxE6H031gNGXJeZaZPVKmHSiQjt/n9eWWmvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mo8kuyQN+AxfYfCNDNSuV7Xg9+Hh8qX3c8Ccb7hNdP1yl4uRh6Ays7AwF/oL0Wlnb sFFQUfKuwK9waKPQYMFGGyU5MOuL49rj8n0iThLx3uWD7bWmfiY7fkOgTyd2ry9q4H I2X6UQrFkZRkBtIO0Av1+6Bnpt1FuX136J2T/zU9e6NiwGPO9N+Ar02+IiMjckBYDP lNDV/T3N3w7UXhPiHIP8UeaCfy7R6mNBgTQhndtuoWeld/Ku/vr+H2kcfwXKmge28Y IUgg/NrAtre8xqij2GLQkalGCiD7vum2qsElzd84bvK8CE1IF3l1wdjA6CCLRhG7We RyPND9l8Ga1bw== From: Baruch Siach To: Christoph Hellwig , Marek Szyprowski , Rob Herring , Frank Rowand , Catalin Marinas , Will Deacon Cc: Baruch Siach , Robin Murphy , iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?b?UGV0ciBUZXNhxZnDrWs=?= , Ramon Fried Subject: [PATCH RFC 2/4] of: unittest: add test for of_dma_get_cpu_limits() 'min' param Date: Wed, 27 Dec 2023 17:04:26 +0200 Message-ID: <9704923d06839d92f4ef6fb28523b0f47e154df4.1703683642.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786448435233479043 X-GMAIL-MSGID: 1786448435233479043 Verify that of_dma_get_cpu_limits() sets this new parameter to the expected result. Signed-off-by: Baruch Siach --- drivers/of/unittest.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 21d273a05ba6..d3b2c6ca56cd 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -911,7 +911,7 @@ static void __init of_unittest_changeset(void) static void __init of_unittest_dma_get_cpu_limits(void) { struct device_node *np; - phys_addr_t cpu_addr; + phys_addr_t cpu_addr_max, cpu_addr_min; if (!IS_ENABLED(CONFIG_OF_ADDRESS)) return; @@ -922,10 +922,13 @@ static void __init of_unittest_dma_get_cpu_limits(void) return; } - of_dma_get_cpu_limits(np, &cpu_addr, NULL); - unittest(cpu_addr == 0x4fffffff, - "of_dma_get_cpu_limits: wrong CPU addr %pad (expecting %x)\n", - &cpu_addr, 0x4fffffff); + of_dma_get_cpu_limits(np, &cpu_addr_max, &cpu_addr_min); + unittest(cpu_addr_max == 0x4fffffff, + "of_dma_get_cpu_limits: wrong CPU max addr %pad (expecting %x)\n", + &cpu_addr_max, 0x4fffffff); + unittest(cpu_addr_min == 0x40000000, + "of_dma_get_cpu_limits: wrong CPU min addr %pad (expecting %x)\n", + &cpu_addr_min, 0x40000000); } static void __init of_unittest_dma_ranges_one(const char *path,