Message ID | 20250303133231.405279-5-sughosh.ganu@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1561:b0:38f:210b:807b with SMTP id 1csp2122501wrz; Mon, 3 Mar 2025 05:33:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVVagYjgwkowGG4gwJDbM3IQtr+eJmu4zHtURUhlkfUF2dTQOw5PjDr8H+bzIWrVt6phCWknA==@linaro.org X-Google-Smtp-Source: AGHT+IEWoI08FjOlMn5q3sRk2fW9xgkmI7A3G6PmX1SaD8T/rNOFx017day5vzJzlXHU0nFb0+/7 X-Received: by 2002:a05:6a20:7348:b0:1ee:be88:f5cf with SMTP id adf61e73a8af0-1f2f4e00bfbmr25529452637.32.1741008823281; Mon, 03 Mar 2025 05:33:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741008823; cv=none; d=google.com; s=arc-20240605; b=LjmsLI9291Ktth1qFiMLpojwwDUbOCtKYiyhT8tHrFrXQolPv1suPj6aYnn+rUKETJ CHuG7o0ndVCtA2XNRVVQI/J0Xm0JvgqFX6pLp6tPP+O9s4XZssnrxSphpQCiK2/P7qc3 TVg64sNfxqk9UVbw395sX3bMADzYz13sBD4uDEqqIQqpcsC0u2keX3HT7ehn3txXn/bU W1P0zXdFjJVRFEJ/s7uIePdUUnUDGRvEzlF61HY9FhoXENmwV4BAYyL2H94EixkVVngI 42SsFGlX34r+WqhQyHDYsWbC2tzUAdbN10wUQexmtVhIsC/+wTym+oIlc1wc5z9PT3jB 4UnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=JnizsOqRrfPu/ZSgQ5K24sT6epsbRQfjAhXUblbywo8=; fh=2HGKihHUAicyV3F+aHiaoPpwvqWA0zlC04Ew6QaQoEg=; b=Qv02dBRzas0tOXjiC/A3ffb+T5z0ngp4uHUjDH41aMoTVS5DiYdNq0PWXL2056pH3R HW5MkynxjNQqDSYaSh6J450Ifh0lmhfDmsqlLfL+Umuw7/9s3AtwBRPPi5pERl5jwuiq 23BnYUeEy7o0SWUzkmoj/siONgWe18qfE7y/JJcp2z1HzRkOLElCd8dUBiioahnSt+/c P5cu5Az+0Bh1aHC1w2FfbWUPzwDNgIH5Iz8E3Gc1WGuOU/DuASKuaFRMLtwZ8td8FXxW rJxZKSRV6mmvWcgYpi9gP9kOkgGeOa/elStfoHnoWlrsv9ey1O7prGZcT//DI/uYDJc5 RTBg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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: <u-boot-bounces@lists.denx.de> Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 41be03b00d2f7-af1e7ea62d9si7853388a12.289.2025.03.03.05.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 05:33:43 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 5DC5A812C8; Mon, 3 Mar 2025 14:33:09 +0100 (CET) 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 3DD55811B2; Mon, 3 Mar 2025 14:33:08 +0100 (CET) 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_DNSWL_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL 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 33349812BE for <u-boot@lists.denx.de>; Mon, 3 Mar 2025 14:33:06 +0100 (CET) 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 B495D106F; Mon, 3 Mar 2025 05:33:19 -0800 (PST) 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 1C49A3F673; Mon, 3 Mar 2025 05:33:02 -0800 (PST) From: Sughosh Ganu <sughosh.ganu@linaro.org> To: u-boot@lists.denx.de Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>, Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>, Quentin Schulz <quentin.schulz@cherry.de>, Udit Kumar <u-kumar1@ti.com>, Heinrich Schuchardt <heinrich.schuchardt@canonical.com>, Sughosh Ganu <sughosh.ganu@linaro.org> Subject: [PATCH v3 4/6] lmb: remove superfluous address overlap check from lmb_add_region_flags() Date: Mon, 3 Mar 2025 19:02:29 +0530 Message-Id: <20250303133231.405279-5-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250303133231.405279-1-sughosh.ganu@linaro.org> References: <20250303133231.405279-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean |
Series |
lmb: miscellaneous fixes and improvements
|
expand
|
diff --git a/lib/lmb.c b/lib/lmb.c index 53af96fa2a9..9af942c6b42 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -195,9 +195,6 @@ static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base, coalesced++; break; } else if (lmb_addrs_overlap(base, size, rgnbase, rgnsize)) { - if (flags != LMB_NONE) - return -EEXIST; - ret = lmb_resize_regions(lmb_rgn_lst, i, base, size); if (ret < 0) return -1;
U-Boot allows re-use of already reserved memory through the lmb_reserve() and lmb_alloc_addr() API's. This memory re-use is allowed only when the flag of the existing reserved region and that of the requested region is LMB_NONE. A check was put in the lmb_add_region_flags() in commit 8b8b35a4f5e to handle the scenario where an already reserved region was re-requested with region flag other than LMB_NONE -- the function then returns -EEXIST in such a scenario. The lmb_reserve() function now does a check for a reservation request with existing reserved regions, and returns -EEXIST in case of an overlap but when the flag check fails. Remove this now redundant check from lmb_add_region_flags(). Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> --- Changes since V2: * Add more description to the commit message on the logic behind this change lib/lmb.c | 3 --- 1 file changed, 3 deletions(-)