From patchwork Tue Apr 9 06:17:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 13621865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1E45CD1284 for ; Tue, 9 Apr 2024 06:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QYH2JQ4W29t+Q13rbDalsAziKXXo4Vih3wDmNL6+ius=; b=4byYFJOFAw7YNS EvFnoRKuITx3zuF5wM17WjPgUiy5QihLiS2lDztFgtWQEg8EePVj/gefy3Q9VUWUPe6+rD4uFuW7r i1iNxodyZ1gknT1dyT14bjaUxA+7HWuJS97Mu3O1Ej3/e13Y3gdvnb7CuZWPTO3hGkEmsdViRymdA ArwZW5QqXFGGZdn/13fSSv1lOYrIW1lx2042OdqsIYvJzNHRuTRn4VVEdMXjAnoTM/LRmnFAIOXS4 F3OLA/NLYVpHxh/n8/HisHJHE0ccvTWSH5X2EhDJ/r20En83AJIIRDgvtBkswXhWMb97cdkGwhmU1 +9znmL8hmo+8djrA9dqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru4oS-00000000Y6I-3xZt; Tue, 09 Apr 2024 06:18:38 +0000 Received: from guitar.tkos.co.il ([84.110.109.230] helo=mail.tkos.co.il) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru4oD-00000000Y2j-3liJ for linux-arm-kernel@lists.infradead.org; Tue, 09 Apr 2024 06:18:20 +0000 Received: from tarshish.tkos.co.il (unknown [10.0.8.2]) (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 E92AA4402AF; Tue, 9 Apr 2024 09:17:43 +0300 (IDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tkos.co.il; s=default; t=1712643464; bh=gBrssBZlXRFpb/uFLqMMzn9TEci+17z5aWBNXa2ngBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X694B3ZvoBbd8hdHi7EzW+8J3OhjQ3vGjltGuIcjUGUE2fwOJptEAEdfejjw64iAN lijKzF39aagDuh+BBzePRq6AGkXS7wMIDboXTR/qyUZYG1iR9j9UE4FLbS4my6aExL grP8xNQYjxSa+353MHFEkx5KeiJJyzng3Lgxngls4wOIpTyqxeAo3aYtRUotgD1s+b RNnGfxtA9aNNWIO47r3iSmqxFw6TwBTMJsLU7SAtgqv66YixNdry2dmyQ981D42CIR ZrkL6mcP1A3ER8fnpQtJ/cjZInpCjfyeUkRT4Puuvkm3pNUJm2LFMZoHx58lBg0eEA IEQfxVkwMVY+g== From: Baruch Siach To: Christoph Hellwig , Marek Szyprowski , Rob Herring , Saravana Kannan , 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, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, =?utf-8?b?UGV0?= =?utf-8?b?ciBUZXNhxZnDrWs=?= , Ramon Fried , Elad Nachman Subject: [PATCH RFC v2 3/5] of: unittest: add test for of_dma_get_cpu_limits() 'min' param Date: Tue, 9 Apr 2024 09:17:56 +0300 Message-ID: <945ff87c765a461d46f0033fbef422e97f9aede0.1712642324.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240408_231818_406488_E4920C5E X-CRM114-Status: GOOD ( 12.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 2d632d4ec5b1..8fabb445a62a 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -924,7 +924,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; @@ -935,10 +935,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,