From patchwork Fri Jun 7 18:52:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 802336 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp949843wro; Fri, 7 Jun 2024 11:57:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW1i+Rj7WOyYk/TJXh7wvRBrKmNHHc7Oe3/nIuLgOqpnqnoo5cl7Y3GyVs0v5rNizzYPfac9lGnMBPXHYeqwhmN X-Google-Smtp-Source: AGHT+IHOcrZH0ZZkW+snGz9l6pp/JJtcAH68CQRU5xxtyKB4kTBP7drfFee4ki0bE24+FH8mYDMq X-Received: by 2002:a17:906:698:b0:a68:cc6f:cb5a with SMTP id a640c23a62f3a-a6cdbd0e35bmr233814266b.68.1717786671074; Fri, 07 Jun 2024 11:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717786671; cv=none; d=google.com; s=arc-20160816; b=P1B9AezTGiAGW9qD9wpW4pafdpWKU9tNO9UfYBqeWx6WyCU/aKEUAMId2bDcXWiyYZ RJTr/palv1B1gWykeJFRfFb6lJwZOtaldgWmvBk1t8TdwBZfczEyiJBAjG27SI492Clr kzU0veNa4VbkpWfMdTJOw95UxV4u1umeuNJshQy4kwMFQE8PqDCzBHT2pDdaTGjVU6xd 9Xg3tS/uKRv/+PenXCHC4q4Ir0ulLum+u9NZ2r7jESxiultoXM1FSU1TGUbdEzntDiAo HflbO8x4WTWjPE1M2OK8++Ac9JMqIXJzvBIvij2nJQlbBDpmLdtCwPKll5Q7WP5cq0pO JZtQ== 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=0Bo4muIiheIBPLWQ+o6d1C1ypXQezxG3/8gM+Kers6Q=; fh=xLSOOz5Q0Mrmzd+lwBRTYS7D/8TpUWM8TEHgIjpMzow=; b=ThrhnBEnA/ABIskcQjE21Ont74Cntk6/13UKhrlH7beEUyEiGWoVPgsjhDPY1ntO0U i/WmyCXqpQri2V12f2jy6Dt4k/HzRAIc+oEmKU73msN8gdQqGKOGX7e3skabkUR1Oveo Eg9U04CY/Vz//luSxj8WqKhhXduhVKclS5Mxq7cQZoNz9IP+G+Knlj349JLXZewBaN34 NHpvP5F0Xaooq1m3pWzxre2mB39pwigKi7dTZ2dvuW+cEqQUMbzAwHAaSHp2ghQ+AqUR LQoGDP6Q6blJ4C34PctNjc/gJgiaVrmQJY2wl69fZQ6/Us96J5uTlRjsZ/DhOg8YVn48 0BAA==; 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 a640c23a62f3a-a6c80588837si212016566b.188.2024.06.07.11.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 11:57:51 -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 56A1D8855E; Fri, 7 Jun 2024 20:54:56 +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 AF00288557; Fri, 7 Jun 2024 20:54:55 +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 BF6B488445 for ; Fri, 7 Jun 2024 20:54:53 +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 AF1091480; Fri, 7 Jun 2024 11:55:17 -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 9561F3F792; Fri, 7 Jun 2024 11:54:50 -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 25/31] test: lmb: adjust the test case to handle overlapping regions Date: Sat, 8 Jun 2024 00:22:34 +0530 Message-Id: <20240607185240.1892031-26-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 The LMB code can now accept reserving and adding overlapping regions of memory. Adjust the test for checking the reservation of overlapping memory regions to work with this corresponding change in the LMB code. Signed-off-by: Sughosh Ganu --- test/lib/lmb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/lib/lmb.c b/test/lib/lmb.c index 9b0e023b67..67a6be5bc3 100644 --- a/test/lib/lmb.c +++ b/test/lib/lmb.c @@ -451,15 +451,15 @@ static int lib_test_lmb_overlapping_reserve(struct unit_test_state *uts) ut_asserteq(ret, 0); ASSERT_LMB(&lmb, ram, ram_size, 1, 0x40010000, 0x10000, 0, 0, 0, 0); - /* allocate overlapping region should fail */ + /* allocate overlapping region should return the coalesced count */ ret = lmb_reserve(0x40011000, 0x10000); - ut_asserteq(ret, -1); - ASSERT_LMB(&lmb, ram, ram_size, 1, 0x40010000, 0x10000, + ut_asserteq(ret, 1); + ASSERT_LMB(&lmb, ram, ram_size, 1, 0x40010000, 0x11000, 0, 0, 0, 0); /* allocate 3nd region */ ret = lmb_reserve(0x40030000, 0x10000); ut_asserteq(ret, 0); - ASSERT_LMB(&lmb, ram, ram_size, 2, 0x40010000, 0x10000, + ASSERT_LMB(&lmb, ram, ram_size, 2, 0x40010000, 0x11000, 0x40030000, 0x10000, 0, 0); /* allocate 2nd region , This should coalesced all region into one */ ret = lmb_reserve(0x40020000, 0x10000);