From patchwork Fri Jun 7 18:52:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 802331 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp949601wro; Fri, 7 Jun 2024 11:57:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXAoasgejFyvQjjgva7fvZ9XQOhLKdDxJdYtqz2lmCNlGWGfkPflS3UPuCTxbhgZn3/iDmGqz3+2ZKGmktBnkkN X-Google-Smtp-Source: AGHT+IE/ocSQMtuAvjp0nNrw5gQSxFAz1rBWfTs3RQvMDR05WLFba3MoNJ149YWredOZxEfklb7p X-Received: by 2002:a50:d4d8:0:b0:57a:2ccb:b3e5 with SMTP id 4fb4d7f45d1cf-57c549edcb4mr1492546a12.42.1717786621972; Fri, 07 Jun 2024 11:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717786621; cv=none; d=google.com; s=arc-20160816; b=L9n8+V9v2ty4mC86sJU1DhovnK2a7jTtcOQ5cd1wvBRCChaVsk3zBLHyYgUx9Wpfqd i+hL15fKFI6bqLXbBNxaoEcQgN7VJoBMkuwiSMt8VZ/rr3HSul3nhDTGtuQTtSV9nOVG ks2za1msuxa+i8207HBbdWo5ztxa/phGhfF8SYH6IBn6dp3v+HoMcx5nTuSwKvtzCZP2 bFtoGM/iXkLVvKTToBx1HT7JhHwSRryISByy0M9ybsaaaNiTtzRQGVgmpzzM8we5lWnv rGm8s29MPmitCjZWS95VrjJr9K0zeNiW9YyZ/rqzNo7/eR7M3yRzYpxbmx0IsQOAZmfU rwCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=0FwaQtNl+lgV4eUsNre3c93HYl+SLhaCz7RbcPESu5A=; fh=xLSOOz5Q0Mrmzd+lwBRTYS7D/8TpUWM8TEHgIjpMzow=; b=e69zYlIkjTGBqt5Ai296MjuqOqKn2n3eHzrpbXs6BAqDRqjXc1gS5y8pbx+Vs+Ca6f CNNp6zAbgcF7kasZhYLNVBXFgqD6cAvHE7qHeLJ8aSQzV6LfbPAzMARWYIVYWsnkXlqT s87fCawh2L2qI3tvdKOERruhAAMsjTln6qZ2l3pN5aiWT8rn5ZOEVtSkHMuqY8IgsX+W UpMYpH6IZsGAtomCiNSsRgza4Nvst3BpVtx62rCynL5g6KFdKrIk0cy7h90hyicXZQHE jiZwjtK67bnsa/2Dl4T2JObweQsi0U5BmDrb9lPcKkfWiOSOS29sO5elIP8aLcLO32CR cjEA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c57ee709dsi883551a12.643.2024.06.07.11.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 11:57:01 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 854388851A; Fri, 7 Jun 2024 20:54:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id BA41288470; Fri, 7 Jun 2024 20:54:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id CEB4B8851A for ; Fri, 7 Jun 2024 20:54:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BCF971480; Fri, 7 Jun 2024 11:55:01 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 943A93F8A4; Fri, 7 Jun 2024 11:54:34 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Tom Rini , Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Marek Vasut , Mark Kettenis , Fabio Estevam , Sughosh Ganu Subject: [RFC PATCH 20/31] test: cedit: use allocated address for reading file Date: Sat, 8 Jun 2024 00:22:29 +0530 Message-Id: <20240607185240.1892031-21-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607185240.1892031-1-sughosh.ganu@linaro.org> References: <20240607185240.1892031-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Instead of a randomly selected address, use an LMB allocated one for reading the file into memory. With the LMB map now being persistent and global, the address used for reading the file might be already allocated as non-overwritable, resulting in a failure. Get a valid address from LMB and then read the file to that address. Signed-off-by: Sughosh Ganu --- test/boot/cedit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/boot/cedit.c b/test/boot/cedit.c index aa41719048..1f4147da89 100644 --- a/test/boot/cedit.c +++ b/test/boot/cedit.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -62,7 +63,7 @@ static int cedit_fdt(struct unit_test_state *uts) struct video_priv *vid_priv; extern struct expo *cur_exp; struct scene_obj_menu *menu; - ulong addr = 0x1000; + ulong addr; struct ofprop prop; struct scene *scn; oftree tree; @@ -87,6 +88,8 @@ static int cedit_fdt(struct unit_test_state *uts) str = abuf_data(&tline->buf); strcpy(str, "my-machine"); + addr = lmb_alloc(1024, 1024); + ut_asserteq(!!addr, !0); ut_assertok(run_command("cedit write_fdt hostfs - settings.dtb", 0)); ut_assertok(run_commandf("load hostfs - %lx settings.dtb", addr)); ut_assert_nextlinen("1024 bytes read");