From patchwork Fri Oct 18 13:51:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 836706 Delivered-To: patch@linaro.org Received: by 2002:a5d:50c9:0:b0:37d:45d0:187 with SMTP id f9csp831452wrt; Fri, 18 Oct 2024 06:53:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWy43HtfNM7o7/Cjti/w1HonBoozvwasBBQz0s2dqLLh0fHvmwkeWnIxOiYxnDKtgTomxhxVw==@linaro.org X-Google-Smtp-Source: AGHT+IH8vw+sLXqsGmHvJmt7DdDIeYpeWdtxKayN15WeYhNrtEb5rDOfVhHXLmWX/GldW7XVA/+f X-Received: by 2002:a05:6e02:1c26:b0:3a3:9461:66a4 with SMTP id e9e14a558f8ab-3a3f405c4f0mr26354345ab.10.1729259596820; Fri, 18 Oct 2024 06:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729259596; cv=none; d=google.com; s=arc-20240605; b=jc/LwPbkpcnsfLDhueCC4roHoVmCNqBgHV1fce2aVeiOR1MHyl77zTAe6kQL1eXoB9 ZlDu1ifVXkgmayEzsuhza4XmDSGJh5nGWIDgw4cyda4rOnobdclOgFWqafCu8W8W+zxg cwPsz1JzTmldBBNaerxek/Xzb2mHjBcJKj5BcbwQRddBnM4qmnH7MSb7/P7C3LQ+WMG3 mjzspe1pg6ydphWE0ReMDYMrK8nrHosTS6LLoBaT169BcGrQWgbF77Q6fR4baldTYh18 mvewcAJEWO/SgZTXpZXgF7aObh2i5dOXIn6MiKEf1janFbdpB8l4J3DQ4EIfGlPMCxEH jHxQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=bUKneQogeTe3J3lhTG7jtybMtaKq5ic7SwNABOZ9fkM=; fh=3071jniGhLIZXdBToUJvgFgaelOWaQ7FZz2oIxym1mQ=; b=dzK6+hoitK/7thcyle1PpOChI3t0psQ5ieo2diEkuckECz0sUZisWoNf4847TAoVYQ HERCoG14VhnVHLaFw6hn0CH2Qwu3AArO22DInJmLwLMcnt5oOm3jccmIPXdyBMq2MSbH H9Wb8MtgUEqob6ZPj6CXauiaF5yA4ARdi2rnyBu2cV8HaQs8ZrGyZE1ODpBhp8hFpBaK fKVvU07dFiH0Wh+vQyKShwVJHWBrNV8+otiPATwlHn+7vX0QgHF1QCzPipyc0nMFzkqX 7HkA6yEMGjWUsUkwivutsZGP1UM5sj69JfdCqOGWE48mjFMesWMZhgJyXSV722KqZ2Q8 iZRQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CRSQPbLQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@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 e9e14a558f8ab-3a3f3fe7034si7580625ab.60.2024.10.18.06.53.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 06:53:16 -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; dkim=pass header.i=@linaro.org header.s=google header.b=CRSQPbLQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6C97789093; Fri, 18 Oct 2024 15:53:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="CRSQPbLQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6A61E89057; Fri, 18 Oct 2024 15:53:12 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6245088EC9 for ; Fri, 18 Oct 2024 15:53:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a9a628b68a7so199544266b.2 for ; Fri, 18 Oct 2024 06:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729259590; x=1729864390; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bUKneQogeTe3J3lhTG7jtybMtaKq5ic7SwNABOZ9fkM=; b=CRSQPbLQyYOwoecXoq8+rF/fF9zSoDRLWbYkYFRTszaB7A71GvR4qk0ANLRl+FwuLx OdTgLYsf0ep+Uti8+HOjEGflMt+ifXBn0QnZnhcbUso6H66JnyWEXp8jVcdwA29JXuAC U73BaKTad9eHvCPx1kkmnflLajiAPOS9zwSwHHX8x9dFFAz7igoEBUs2ByHF1d5gPDN7 QwNKMnjbFIjUyW+0J02+K9JHNTd5YQdFgE6gPIs/3OI8K0WvbC2OmaJ7ddz0QjrmC7ku 7eDJMy75wXatwJD0kXHoQ3+cT+/g55YKGCQO9gA6pnj4tWO+w1Nuqk6j88ld7LtEqOs3 x9Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729259590; x=1729864390; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bUKneQogeTe3J3lhTG7jtybMtaKq5ic7SwNABOZ9fkM=; b=TR8NkTlf7XFpEoyluf6f3iieZglzJp2F3IdzmcrF+1lhL6O+y5pfPSFDc0iYqchLjS lAMY1h8wIc9PjK/axVfvs++CDoBjzQyIZvgXYIxj4aBXkXOnn5yDna3CUKzsoaGzqrXh p0OtcmZmUIFPWdnCRu4rdbcyBaKNCky5//w4wdLBnHsjsPkfb9JIBByG85g20BfkU5Me DDqJaq0iYIrRF6V4Ho+6y3EHi2Odu1WPaOZZDCcYtJf4oI+Rj8awUfNtNPb6FJw706UT Ng17fUX4Pf4WZsGfk+Yp7iSJfLwaHS3Odc1bIk9QkktjTp+0u9iVR5LMGMbq3lxelEAd yw4Q== X-Forwarded-Encrypted: i=1; AJvYcCUZarFVp7MRONw5jenbZuVZTyKEsmEQIgf7Olv3CvkU6AQ5t3Mr5vtLk+8bbetCZdKxaaOtMSA=@lists.denx.de X-Gm-Message-State: AOJu0YyPB5Iy/XhB56n0RbuMtDTb2yRBRKFy17i+ne8IHZsFTpJeEPG0 N7WyuQ/4TMQWmkMBOs/iqQkjevkUcQqQ8N0vz/1JpZ5j5l1Z2zdIOM4RNPBEVi10nKSmtg1fKXU g X-Received: by 2002:a17:907:3d90:b0:a86:82e2:8c64 with SMTP id a640c23a62f3a-a9a69b75728mr216607266b.35.1729259589758; Fri, 18 Oct 2024 06:53:09 -0700 (PDT) Received: from cymric.caleb.rex.connolly.tech ([2a02:8109:888d:ff00::2]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68bc4f97sm99002066b.116.2024.10.18.06.53.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 06:53:09 -0700 (PDT) From: Caleb Connolly To: Ilias Apalodimas , Simon Glass , Sughosh Ganu , Tom Rini Cc: Caleb Connolly , u-boot-qcom@groups.io, u-boot@lists.denx.de Subject: [PATCH] lmb: notify when adjacent regions are added Date: Fri, 18 Oct 2024 15:51:07 +0200 Message-ID: <20241018135112.3978130-2-caleb.connolly@linaro.org> X-Mailer: git-send-email 2.46.2 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 lmb_add_region() returns a positive integer if the added regions causes existing regions to be coalesced. We still want to notify the EFI subsystem about these added regions though, so adjust lmb_add() to only bail on errors. This fixes EFI memory allocation on boards with adjacent memory banks as is the case on several Qualcomm boards like the RB3 Gen 2. Fixes: 2f6191526a13 (lmb: notify of any changes to the LMB memory map) Signed-off-by: Caleb Connolly Reviewed-by: Sughosh Ganu Tested-by: Neil Armstrong Reviewed-by: Ilias Apalodimas --- Cc: u-boot-qcom@groups.io --- lib/lmb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lmb.c b/lib/lmb.c index 78fe2d4de7c6..7e90f178763b 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -486,9 +486,9 @@ long lmb_add(phys_addr_t base, phys_size_t size) long ret; struct alist *lmb_rgn_lst = &lmb.free_mem; ret = lmb_add_region(lmb_rgn_lst, base, size); - if (ret) + if (ret < 0) return ret; if (lmb_should_notify(LMB_NONE)) return lmb_map_update_notify(base, size, MAP_OP_ADD);