[{"id":3680054,"web_url":"http://patchwork.ozlabs.org/comment/3680054/","msgid":"<CAFLszTggCLQPaJcRoxhjHOuRM10yW3pr8JjRj+LLA-ZupVOSjg@mail.gmail.com>","list_archive_url":null,"date":"2026-04-21T20:40:51","subject":"Re: [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb\n reservations","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi Randolph,\n\nOn 2026-04-20T19:25:18, Randolph Sapp <rs@ti.com> wrote:\n> boot_fdt_add_mem_rsv_regions: free old dtb reservations\n>\n> Add a free flag and an initial call to free allocations covered by the\n> global FDT. This assumes that all calls to boot_fdt_add_mem_rsv_regions\n> occur before the transition to the new device tree, thus we can access\n> the currently active device tree through the global data pointer.\n>\n> This allows us to clearly indicate to the user when a device tree\n> reservation fails. How we handle this can still use some improvement.\n> Right now we'll keep the default behavior and try to boot anyway.\n>\n> This functionality was broken in:\n> 5a6aa7d (\"boot: fdt: Handle already reserved memory in boot_fdt_reserve_region()\")\n>\n> Signed-off-by: Randolph Sapp <rs@ti.com>\n>\n> arch/mips/lib/bootm.c |  2 +-\n>  boot/bootm.c          |  2 +-\n>  boot/bootm_os.c       |  2 +-\n>  boot/image-board.c    |  2 +-\n>  boot/image-fdt.c      | 57 +++++++++++++++++++++++++++++++++++----------------\n>  include/image.h       |  2 +-\n>  lib/lmb.c             |  2 +-\n>  7 files changed, 45 insertions(+), 24 deletions(-)\n\n> diff --git a/boot/image-fdt.c b/boot/image-fdt.c\n> @@ -69,35 +69,51 @@ static const struct legacy_img_hdr *image_get_fdt(ulong fdt_addr)\n> +static void boot_fdt_reserve_region(u64 addr, u64 size, u32 flags, bool free)\n>  {\n> -     long ret;\n> +     int ret;\n\nnit: perhaps keep this one 'long' since lmb_free() returns long ?\n\nRegards,\nSimon","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=d3Jgd+LQ;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"d3Jgd+LQ\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0Z5406ynz1yHB\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 06:41:11 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 1529E805D7;\n\tTue, 21 Apr 2026 22:41:08 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 3606483BC8; Tue, 21 Apr 2026 22:41:06 +0200 (CEST)","from mail-ej1-x634.google.com (mail-ej1-x634.google.com\n [IPv6:2a00:1450:4864:20::634])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 3843880433\n for <u-boot@lists.denx.de>; Tue, 21 Apr 2026 22:41:04 +0200 (CEST)","by mail-ej1-x634.google.com with SMTP id\n a640c23a62f3a-ba67b332bbaso442521566b.0\n for <u-boot@lists.denx.de>; Tue, 21 Apr 2026 13:41:04 -0700 (PDT)"],"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,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1776804064; cv=none;\n d=google.com; s=arc-20240605;\n b=SI6wCt2dLSQrXaUbRGTkiogZ4I1Hfm+AI0f7/3igY2pWA/Iqy2XEWyMT99MfLTAMiT\n XVpg70lErp8/dgVMJP3EniQWHl3ZmGyeRmjZl64MrF+RAqueLDek+oCmPIJEb16Kxl2i\n MMMYrzgL6iZaIzIdrDgPN8sKa82NCE29FFdgeTXlNMqD+pP/6VHN6aqGBFCp2qzMMk30\n iFQH+2HHWcfkJYtkSnNksL63uOlNN0F5AmhYa4zXKBepFGgOJYvA+NsQ+2ikzY5CJTNk\n /QnkpaAEn7Ovu90F7pvK/1vOS43ZBi5pikMc3H956AbPZzEeQZ+C0Xp5AhQpjDPoPkLq\n 8XVg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=CCEI8tAeQvo/lqqRVV60IhtT/AMxKbC0CNuj37fqjxw=;\n fh=waS3EJk31RVDeGVicECCeqlXRchlLuFxWeT8ek9mn1g=;\n b=ACklDe6nj27yJ4cocdzzQsd+chiuEIjUFqIcXv7GRSR9C/6wtulk9xswKtVyKci9GQ\n ZGM6ZcfHNr6uw6hFk7AEV8nD4ma3AhXHFCOrX2UvD3i43IJdzoAAsm4JPN6+uZl+zizM\n 06AWTv2ea7P+Un73Iu5fIaCmjEwypOu4tgZe1OzwbDQceOsvrZvJbhwYcU045Jn0fAa+\n vvCppwnsOueQ4EEG/0b6e1xIro+XTEnw9+9cHqbmmEB1/OzKxOnpFcc/oP6VkxrUgd5y\n 5DqCZdZwUBaf3ZIdgbjd/J778g5rHlkPO/9U9aLLOC8jPCJyLO+z/VMhDsX0GQAOGYST\n yAGg==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1776804064; x=1777408864; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=CCEI8tAeQvo/lqqRVV60IhtT/AMxKbC0CNuj37fqjxw=;\n b=d3Jgd+LQKP4l2CdpSnB2acrYNFinJmsdwzIr/PuFFEYLo2GXdJMiqA1gY5yLcYNftT\n m00ZkTkT7y2nt/FY00ivGrtXdvY5mJYipZIqy8oQn+hpm0jolsDh0UfhWPjOu5mjVbEa\n 28HTUVs9L+HzapiVV2g0UujZLznYxSJk2djQc=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776804064; x=1777408864;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=CCEI8tAeQvo/lqqRVV60IhtT/AMxKbC0CNuj37fqjxw=;\n b=MjltXHATp/HbKkCOr7buNfF0pGfC4uZvHs6OAU1teiKci5mVVPipGWe9UdhD6NUI+h\n /FY9eDaxLC/Ugavf4b3JT8Qugw1YubulNnu1lx6ox8kjI5wQUBLfCq9gtpjpo2qQqSL7\n jnuwqe9WdiwhCh2sQ9WArk5Kk0GdCmaewBUtJjBHnp8+fO8+TgyQNt+czAjzF0QIQfA/\n 7lFVVu5VvlwiB5VkUggXiDwBAKc5rsaeqgJ/hf6WdOBmDtbbQs4Io1cWl4ovOkuO1zdx\n ys8NzJ1MXDgGgAXLrymvBQfg/RP2TeslIfygpji5c6xV9IA1IQLlfJrt3A8h8iLc2+qd\n nIGg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/RRIk9nvKF1PqoOfboPMX0ieS51CDTlisfqL0OjKQ3x3Bh5TTRs1DSpELM/CThf1mwWQRA4Yo=@lists.denx.de","X-Gm-Message-State":"AOJu0Yy2G1EH3bzMNpez/1RESqTEjvzfe6zd8ebasqXqd7pyUT7Lsoww\n UsvIrjhpZrIFLfgGhPq13d3LR8NkdjeCbhef3rLGFcuWGqeAv+bBUBRh6GugxppMQcwYEe8bxkD\n OVOk9058MwQ8HWXKbtxSdtTJSAv9aRb37lRZooVItdyDpyRIQO/lhjw==","X-Gm-Gg":"AeBDiet1Nere8dlliQYO0mZ6prqYT+6oAKAwx5VaLk0uBANfdxCBvCSSi00GioWk5KV\n EWh2YCAVb6Cgk/lJJeZzgbSx9KDWc8CPyOxTS47MwaV3YCiODCQ6L1kJ/rrqHuaqWDrC0rkD55f\n Ji6qO1OAGjF17cN5z5bpOgXNUm77Z/dVo32yXAgAKDaeIXvZWqFWEeyDE6A1ky1hwhZPixkGkZT\n AjP6gr7OVRS8IL45Pm0jx4SL9NeyeldolEOyYIhM2bjnT8m2Czvp/aKLWHRGgro8z9i3fceqgvl\n F/qiq8RYIG/SXD396/nv","X-Received":"by 2002:a17:907:7f94:b0:baa:77ac:97a with SMTP id\n a640c23a62f3a-baa77ac0facmr102322666b.36.1776804063618; Tue, 21 Apr 2026\n 13:41:03 -0700 (PDT)","MIME-Version":"1.0","References":"<20260420192520.1444749-1-rs@ti.com>\n <20260420192520.1444749-3-rs@ti.com>","In-Reply-To":"<20260420192520.1444749-3-rs@ti.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Wed, 22 Apr 2026 08:40:51 +1200","X-Gm-Features":"AQROBzAUjeroKDli-DbiyaZviQPRrFL9rLle9PoHSJS73bheZ9_NDbJ0JqBGf0w","Message-ID":"\n <CAFLszTggCLQPaJcRoxhjHOuRM10yW3pr8JjRj+LLA-ZupVOSjg@mail.gmail.com>","Subject":"Re: [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb\n reservations","To":"rs@ti.com","Cc":"robertcnelson@gmail.com, ayush@beagleboard.org,\n Erik.Welsh@octavosystems.com, anshuld@ti.com, bb@ti.com, trini@konsulko.com,\n afd@ti.com, xypron.glpk@gmx.de, ilias.apalodimas@linaro.org,\n u-boot@lists.denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","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>,\n <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>,\n <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"}},{"id":3680087,"web_url":"http://patchwork.ozlabs.org/comment/3680087/","msgid":"<DHZ6GETQ2Z6C.2EZP9ISNJR0E7@ti.com>","list_archive_url":null,"date":"2026-04-21T22:14:14","subject":"Re: [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb\n reservations","submitter":{"id":88727,"url":"http://patchwork.ozlabs.org/api/people/88727/","name":"Randolph Sapp","email":"rs@ti.com"},"content":"On Tue Apr 21, 2026 at 3:40 PM CDT, Simon Glass wrote:\n> Hi Randolph,\n>\n> On 2026-04-20T19:25:18, Randolph Sapp <rs@ti.com> wrote:\n>> boot_fdt_add_mem_rsv_regions: free old dtb reservations\n>>\n>> Add a free flag and an initial call to free allocations covered by the\n>> global FDT. This assumes that all calls to boot_fdt_add_mem_rsv_regions\n>> occur before the transition to the new device tree, thus we can access\n>> the currently active device tree through the global data pointer.\n>>\n>> This allows us to clearly indicate to the user when a device tree\n>> reservation fails. How we handle this can still use some improvement.\n>> Right now we'll keep the default behavior and try to boot anyway.\n>>\n>> This functionality was broken in:\n>> 5a6aa7d (\"boot: fdt: Handle already reserved memory in boot_fdt_reserve_region()\")\n>>\n>> Signed-off-by: Randolph Sapp <rs@ti.com>\n>>\n>> arch/mips/lib/bootm.c |  2 +-\n>>  boot/bootm.c          |  2 +-\n>>  boot/bootm_os.c       |  2 +-\n>>  boot/image-board.c    |  2 +-\n>>  boot/image-fdt.c      | 57 +++++++++++++++++++++++++++++++++++----------------\n>>  include/image.h       |  2 +-\n>>  lib/lmb.c             |  2 +-\n>>  7 files changed, 45 insertions(+), 24 deletions(-)\n>\n>> diff --git a/boot/image-fdt.c b/boot/image-fdt.c\n>> @@ -69,35 +69,51 @@ static const struct legacy_img_hdr *image_get_fdt(ulong fdt_addr)\n>> +static void boot_fdt_reserve_region(u64 addr, u64 size, u32 flags, bool free)\n>>  {\n>> -     long ret;\n>> +     int ret;\n>\n> nit: perhaps keep this one 'long' since lmb_free() returns long ?\n>\n> Regards,\n> Simon\n\nUgh, yeah though it should only return 0, -EEXIST, or -1 since that's all\nlmb_add_region_flags returns. I'm not going to ask why that's the case.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256\n header.s=selector1 header.b=r+yCFbOR;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.b=\"r+yCFbOR\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com","phobos.denx.de; spf=pass smtp.mailfrom=rs@ti.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0c8s6rYPz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 08:14:37 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 35C3F83AC5;\n\tWed, 22 Apr 2026 00:14:28 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 8E8BD83AC5; Wed, 22 Apr 2026 00:14:26 +0200 (CEST)","from SA9PR02CU001.outbound.protection.outlook.com\n (mail-southcentralusazlp170130001.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c10c::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 3790B839D5\n for <u-boot@lists.denx.de>; Wed, 22 Apr 2026 00:14:24 +0200 (CEST)","from BN1PR13CA0020.namprd13.prod.outlook.com (2603:10b6:408:e2::25)\n by IA1PR10MB5972.namprd10.prod.outlook.com (2603:10b6:208:3ec::7)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.17; Tue, 21 Apr\n 2026 22:14:19 +0000","from BN2PEPF000055E0.namprd21.prod.outlook.com\n (2603:10b6:408:e2:cafe::ae) by BN1PR13CA0020.outlook.office365.com\n (2603:10b6:408:e2::25) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9846.15 via Frontend Transport; Tue,\n 21 Apr 2026 22:14:18 +0000","from flwvzet200.ext.ti.com (198.47.21.194) by\n BN2PEPF000055E0.mail.protection.outlook.com (10.167.245.10) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9870.4 via Frontend Transport; Tue, 21 Apr 2026 22:14:17 +0000","from DFLE208.ent.ti.com (10.64.6.66) by flwvzet200.ext.ti.com\n (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 21 Apr\n 2026 17:14:14 -0500","from DFLE210.ent.ti.com (10.64.6.68) by DFLE208.ent.ti.com\n (10.64.6.66) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 21 Apr\n 2026 17:14:14 -0500","from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE210.ent.ti.com\n (10.64.6.68) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend\n Transport; Tue, 21 Apr 2026 17:14:14 -0500","from localhost (rs-desk.dhcp.ti.com [128.247.81.39])\n by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 63LMEEYU1020442;\n Tue, 21 Apr 2026 17:14:14 -0500"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,T_SPF_PERMERROR autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=lCF9Mdx+d4SJpnu4LzJVa8CEL1gbQB67qj/xYfXXNs/sDUmpLQMV8hM60gzBCHw6Vd3qKu05T2+/V9vnLVNkgtglCccKSr5/0frM0Dx9uCzZOKU3CMmF6tU+LTFJr+Q70TLefHe6KKwoQedi9lOoyGQdyEbKeVXIGYhFR7mZSc1UnhyIIWB+905w7QTPG926puNnKxirz127KyugdSmPP5Ak6b6eaC+cI+f/vI3zCF1TZ+oH6B6yJQY/uD+jZyasRZCeDDBmaokieRRMcy5bAtC8uyNt86PawxLNLtHarW5XgojRa17srVhtlfau8moqJ8oOpZLfwdJO/4dJeuTMBw==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=xvAGlGNN4hFFq0bvboPMfN5jk3YGvPcdecEwMvbeBx4=;\n b=U/a0NqliFOfDVro1PA+JBPjzyq+BuUdaJSSK1L7jWuI0TaOcrqyPbk8UENgWkuagoN/+g4SeNWeVPmomQaOanU0i3ctPI1ZOBsLjSRwoEy2qIMRPJ/1YNgyF6YvrKAOQYc0A2NB/voBtDXe+u7/YHSrO/0KsWicqICXkObCdVIoV1zOT+bEtCeRrSdZnFC9ph4sFzq80w5hZlnPUwJXa6lw/sMvMF1Z/bwq/cuZht5TSgWRqbVhcHXhAx7W6+NxdzG6K3KKloL/QC25z/yS8lhchaMIKPaB7mhNTJWC/DSZM7htYd38DSIj0qO1wr3yTtXgiIU/yP8jBnfXj+y2T5Q==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 198.47.21.194) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=ti.com;\n dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com;\n dkim=none (message not signed); arc=none (0)","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=xvAGlGNN4hFFq0bvboPMfN5jk3YGvPcdecEwMvbeBx4=;\n b=r+yCFbORjLBaz2/iCUQKN9bxZkjnrq9ilFNMBV6K5iqVUHUNfjiEyDZ3pBl7b0InpG056lswwhRoNpH4THAW0VftiQCVqHxCdnVO2f9kTGqh6ltKQDEioaoKE6ZACU8X2FIJt1wb0mmjmegNWVmNj2F9JWTjexgKCnO579dQQek=","X-MS-Exchange-Authentication-Results":"spf=pass (sender IP is 198.47.21.194)\n smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;\n dmarc=pass\n action=none header.from=ti.com;","Received-SPF":"Pass (protection.outlook.com: domain of ti.com designates\n 198.47.21.194 as permitted sender) receiver=protection.outlook.com;\n client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","Content-Type":"text/plain; charset=\"UTF-8\"","Date":"Tue, 21 Apr 2026 17:14:14 -0500","Message-ID":"<DHZ6GETQ2Z6C.2EZP9ISNJR0E7@ti.com>","CC":"<robertcnelson@gmail.com>, <ayush@beagleboard.org>,\n <Erik.Welsh@octavosystems.com>, <anshuld@ti.com>, <bb@ti.com>,\n <trini@konsulko.com>, <afd@ti.com>, <xypron.glpk@gmx.de>,\n <ilias.apalodimas@linaro.org>, <u-boot@lists.denx.de>","Subject":"Re: [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb\n reservations","From":"Randolph Sapp <rs@ti.com>","To":"Simon Glass <sjg@chromium.org>, <rs@ti.com>","X-Mailer":"aerc 0.21.0-0-g5549850facc2","References":"<20260420192520.1444749-1-rs@ti.com>\n <20260420192520.1444749-3-rs@ti.com>\n <CAFLszTggCLQPaJcRoxhjHOuRM10yW3pr8JjRj+LLA-ZupVOSjg@mail.gmail.com>","In-Reply-To":"\n <CAFLszTggCLQPaJcRoxhjHOuRM10yW3pr8JjRj+LLA-ZupVOSjg@mail.gmail.com>","X-C2ProcessedOrg":"333ef613-75bf-4e12-a4b1-8e3623f5dcea","X-EOPAttributedMessage":"0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"BN2PEPF000055E0:EE_|IA1PR10MB5972:EE_","X-MS-Office365-Filtering-Correlation-Id":"3a2365cc-286f-48c4-0bc7-08de9ff35455","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;\n ARA:13230040|82310400026|376014|36860700016|1800799024|56012099003|18002099003|22082099003;","X-Microsoft-Antispam-Message-Info":"\n qH57Cre0VtLtdlqjZIfCXhsARTmyFBZZJLC49TLHx0EYA4l5oePLi9VABNttdbSI6qWS8Gt+tOMcDBZj5hTPlazAI3Nc+6TjIZQ+0wNIdleU+SEnaazFWBL2vDZooV7/i7G1qV7ua1Cs7mAEnYUIvUmp6jN3ilPigrzGZqitwEF9l7m6P6dCl8ZJi5VLR6O5mF2FljLSzo7lUV8rQM3O3JauRUx+HoxqbUZCePVVuMMRriJARoSK8Dz2gNGqypgj8WKBoHhpipOxOH9jUKb9OBRvBsonMr48hsqz9sQwgnxU29eQ/A4jlJuyssKjNDAQozmJXglAwQAVGz5kBbwoHdbrCMOF0mT0lnGmG2hl21YL25T0WM/fZptcP4R4zaZ/+6uNtfIzjQCJxcjiKwrd6A2S1S9orUhwgLwP9KJvjipr9lCe7yBhDlcDar0X09jsfQfSKG9Wu34Fc2xhKxN4ujaq52M8FZRZNSc0jj/KwQCYDCudA4JQ927QBOwQylvMyjIrvLr0nCpSGyqeobTfUHBzv05ub6VUmfGgp5ixuHlUUvyMxfL5o/Jooae4YpFNSHjV/40Ke3kkn8cQLQkK9Oy3buRibYoDsHgqHwjWeCQITQGDhCy1+FCwsYE7+Df0pHFBaDWMsgk7azCrBF7bPI/LdCxbrSkzZUqTF6VT3TN5FhMj7tmSo6o6M5FdYlJbKYk5Xwc0cFdpM4XnOzxmPuAG8koCNjzgCI+QDPM/1Jzqti/it++EZ2LUl88931Mnq5vqBDCDQczDhJ4XEIe3XA==","X-Forefront-Antispam-Report":"CIP:198.47.21.194; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:flwvzet200.ext.ti.com; PTR:ErrorRetry; CAT:NONE;\n SFS:(13230040)(82310400026)(376014)(36860700016)(1800799024)(56012099003)(18002099003)(22082099003);\n DIR:OUT; SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n HubBAUwnGdyQ2nTNC6eFfuDgzZpnWBrkjPz2ewy7H8GaUpXcoOl3sdOIiorb9hhvD3Z0ybGztctA/OxSOkngDLTTXBDwtQkZoNSK0+0yLVUMMgMQ8ejaL5N/n5xUAY0B7CuZnbl8PTcP/4mg7K9smfbjdEeiJU2OrDWLSS4DCNiicY3AIAb2NW7ZEJMQQd7OpoFsUrSOHgU1g2Pk9QUsx4cAO0bCRO2BpmlcpP01Wx0qjFHxcXKogIyDmnrFOIylvAsYKGjGeoGAOhDiGfAWxOrnJ/7aHt1HGZ5hYmReKANzGmzEu4Xl1rM7Yc+48SChT+X7AM4Kp8c/vz4016JzqhSYUSEq6ai3YFCmRfprITOYP2Oiv8+ZkiUDqnK9wiz4KnBObb/DXUuCd1J9OqOghaXQobNNwRBqec2arjIbTN48zEKsifPIzN/5jmZw6vo0","X-OriginatorOrg":"ti.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"21 Apr 2026 22:14:17.2700 (UTC)","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 3a2365cc-286f-48c4-0bc7-08de9ff35455","X-MS-Exchange-CrossTenant-Id":"e5b49634-450b-4709-8abb-1e2b19b982b7","X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp":"\n TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7; Ip=[198.47.21.194];\n Helo=[flwvzet200.ext.ti.com]","X-MS-Exchange-CrossTenant-AuthSource":"\n BN2PEPF000055E0.namprd21.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Anonymous","X-MS-Exchange-CrossTenant-FromEntityHeader":"HybridOnPrem","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"IA1PR10MB5972","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>,\n <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>,\n <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"}},{"id":3680123,"web_url":"http://patchwork.ozlabs.org/comment/3680123/","msgid":"<CAFLszTi-6pmOYA1F8eZuXtV=Lg5fByTsPCeSBCp65kzw5DAW_g@mail.gmail.com>","list_archive_url":null,"date":"2026-04-21T22:54:13","subject":"Re: [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb\n reservations","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi Randolph,\n\nOn Wed, 22 Apr 2026 at 10:14, Randolph Sapp <rs@ti.com> wrote:\n>\n> On Tue Apr 21, 2026 at 3:40 PM CDT, Simon Glass wrote:\n> > Hi Randolph,\n> >\n> > On 2026-04-20T19:25:18, Randolph Sapp <rs@ti.com> wrote:\n> >> boot_fdt_add_mem_rsv_regions: free old dtb reservations\n> >>\n> >> Add a free flag and an initial call to free allocations covered by the\n> >> global FDT. This assumes that all calls to boot_fdt_add_mem_rsv_regions\n> >> occur before the transition to the new device tree, thus we can access\n> >> the currently active device tree through the global data pointer.\n> >>\n> >> This allows us to clearly indicate to the user when a device tree\n> >> reservation fails. How we handle this can still use some improvement.\n> >> Right now we'll keep the default behavior and try to boot anyway.\n> >>\n> >> This functionality was broken in:\n> >> 5a6aa7d (\"boot: fdt: Handle already reserved memory in boot_fdt_reserve_region()\")\n> >>\n> >> Signed-off-by: Randolph Sapp <rs@ti.com>\n> >>\n> >> arch/mips/lib/bootm.c |  2 +-\n> >>  boot/bootm.c          |  2 +-\n> >>  boot/bootm_os.c       |  2 +-\n> >>  boot/image-board.c    |  2 +-\n> >>  boot/image-fdt.c      | 57 +++++++++++++++++++++++++++++++++++----------------\n> >>  include/image.h       |  2 +-\n> >>  lib/lmb.c             |  2 +-\n> >>  7 files changed, 45 insertions(+), 24 deletions(-)\n> >\n> >> diff --git a/boot/image-fdt.c b/boot/image-fdt.c\n> >> @@ -69,35 +69,51 @@ static const struct legacy_img_hdr *image_get_fdt(ulong fdt_addr)\n> >> +static void boot_fdt_reserve_region(u64 addr, u64 size, u32 flags, bool free)\n> >>  {\n> >> -     long ret;\n> >> +     int ret;\n> >\n> > nit: perhaps keep this one 'long' since lmb_free() returns long ?\n> >\n> > Regards,\n> > Simon\n>\n> Ugh, yeah though it should only return 0, -EEXIST, or -1 since that's all\n> lmb_add_region_flags returns. I'm not going to ask why that's the case.\n\nAh yes, I suppose it could be changed to return an int.\n\nRegards,\nSimon","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=a/87x80o;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"a/87x80o\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0d2v1rJKz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 08:54:31 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 55F5483FED;\n\tWed, 22 Apr 2026 00:54:28 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id DCDB5841C8; Wed, 22 Apr 2026 00:54:27 +0200 (CEST)","from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com\n [IPv6:2a00:1450:4864:20::62f])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id C607783AC5\n for <u-boot@lists.denx.de>; Wed, 22 Apr 2026 00:54:25 +0200 (CEST)","by mail-ej1-x62f.google.com with SMTP id\n a640c23a62f3a-ba699316b42so490234566b.3\n for <u-boot@lists.denx.de>; Tue, 21 Apr 2026 15:54:25 -0700 (PDT)"],"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,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1776812065; cv=none;\n d=google.com; s=arc-20240605;\n b=REYT+nEEr0w7Bs88yUvq40rZg6E+QzCOZ1wiw8wMOExG7YSjCy4h50HjCJ458ALRNl\n wVNDDVB68oUZPI3ZE/e0DhchKLFpg2pPsVcZ2T+SOW5FCCccDTFVttelumPJtPJYWknI\n icRpUIz7P14JbH8YVtZedLxxA5wyhWJ8GcchS10/7yGju7kiU85HkVYj0iG+V0JPlq8y\n 4/UTkMd/qSpyz7ZM0h7TZ/R804DUTehv7E9j8DTm1mYuJGbGdBBYc+C5mn3lnkTP3oOt\n V3hZS79JZG+8/u99Z0TxMQw6LL2YbZ2qQGQeRtgQixTy9XTeO3Wdpa/E8dkmcqLZe+oT\n w6zA==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=+2MHSIVhgjFnGx4NY48zdPFpOVk9soZ08gsQsPm+ZpQ=;\n fh=Rg0xNKHxZ4g1flPBYXxd2BdumAWPW6DQK67vLImDETQ=;\n b=jcxxvKPKMpUkOkMfIygURV0i+tVQHV4upRR5M6G0o/809nu8scpMsN49Wdq3fEZ/nY\n 8/ounNqGmU/3JDEkLAif7I+SjbklOTxAUAxLV+eLgKuFFc88UnidNK+S/B0LF/jl7q+y\n qGEBGiRj8jwxHMOOGrW917fJtBtBC0LL5K8JEXd7651itOhAAHk/69CLlmMiwOO9u+8+\n aQnkE1mznJGE8nQ6u8ade7HMhfyKid3X8EfFuyC0a43vTz+3/L+3EwrUVnj0jCxW3Fq/\n srsEUcoVKZjEeFVTws+zegoG0b0FSlpqZAE5OCsWeRqcLtpaE5iPSkbioQtS/DlpaI5D\n azCg==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1776812065; x=1777416865; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=+2MHSIVhgjFnGx4NY48zdPFpOVk9soZ08gsQsPm+ZpQ=;\n b=a/87x80o4MJVih2HhfqQ5UkehVa2Aa3yKlqR24ThUm8jDVZOIYIRuxkz2/uhYEZrWe\n v9mg5fwm5hZEF9+Hd67J1JZKarywAwqhRyCVqwhYLhqvA59hVjS82l7WVt/ipBaDGVUD\n 5OqIA9LuV56RSZpbovha2Jm23XLINoQe8k4TI=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776812065; x=1777416865;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=+2MHSIVhgjFnGx4NY48zdPFpOVk9soZ08gsQsPm+ZpQ=;\n b=JKAtKA6A63Z9Y3apzpq9n5GElnvDIn9X9vOVnRKc00KJRsroOKfprzUFs1JVZ4z22g\n BWjtPbwB5BNFv1Z1VCpoNWRDQxO9WlxSrSWzGutZ3e0MvywSl+zj2ujzSb5mRsJv/TGx\n qWi5R/qXM9uJLDUIZrxIAeEccC1URUgX1XMs6xhbyUSoDg5b6u0Q0nYTyGlM/MnX1Kfx\n LJhebm/uy/nFQMa+OaNQDJDD1kmUQn7uKgb/PVSf0fNgirp8Db+EAkkNcQHBnLbyyAEW\n whf0UCRafRftuk4PPsGqaoPNu8wgIxmBNG+6K6Qc5oygEUU2h3TPGORxYIVfjCEdVpSH\n /WwA==","X-Forwarded-Encrypted":"i=1;\n AFNElJ9E9EBrFuH3KYxuQlntlP24I85vFwvgr+oUiKw+eH5i80/Qi4n7uSyi0O5RcQO7QR6vhrCofwc=@lists.denx.de","X-Gm-Message-State":"AOJu0Yy12lwtrs9C9sWQPr9PNGb0B75hUwtQX7b/nvoQPHBlaG0heYcl\n u+j+Ui6awqe03z29CTgK/6GUVPFWxyQ+7bIzhV9088srCEafjYJ9VSdgg5DDOEGYnD7rAmV6HDX\n 7rrn7d1AiTG4ELuBKlSsQ6BiHOCLzdXrGxPoC+Z7o","X-Gm-Gg":"AeBDiet5hAMJKKY1G3tAM2E+cqbD/+YctY2A6R5xpDWX8g0cVGry/tnV3mk37RnmVC8\n 9oj8BbvLR13zkVK9qv16HNG2yJKoyubHOlHWN0Xa16NPvWzHVM3N4zCCT45dAvunlgifhEIe15M\n fiDG53xco6WQu41Isu2IlrAQwnJEB4/ZPxCOMNsa8IMlflaAPG7v7ItzmcQKlVhcbJXew7vbFNS\n /QblV1YCVaUdiksMroWgEDr6bNvOx2Q541OetL37sOygJKh2D9eKIDEVwBGWzRe9WG+Gl6EiTC6\n hEHjX8Num+++80Dbkbxk","X-Received":"by 2002:a17:907:3d90:b0:ba7:cc67:4874 with SMTP id\n a640c23a62f3a-ba7cc674c7bmr490781666b.46.1776812065195; Tue, 21 Apr 2026\n 15:54:25 -0700 (PDT)","MIME-Version":"1.0","References":"<20260420192520.1444749-1-rs@ti.com>\n <20260420192520.1444749-3-rs@ti.com>\n <CAFLszTggCLQPaJcRoxhjHOuRM10yW3pr8JjRj+LLA-ZupVOSjg@mail.gmail.com>\n <DHZ6GETQ2Z6C.2EZP9ISNJR0E7@ti.com>","In-Reply-To":"<DHZ6GETQ2Z6C.2EZP9ISNJR0E7@ti.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Wed, 22 Apr 2026 10:54:13 +1200","X-Gm-Features":"AQROBzCU23CVpGruY4Cu5iYaLAc-kESq2FsXOTxhP7CquQp_kUE0vR_eBSwoxfM","Message-ID":"\n <CAFLszTi-6pmOYA1F8eZuXtV=Lg5fByTsPCeSBCp65kzw5DAW_g@mail.gmail.com>","Subject":"Re: [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb\n reservations","To":"Randolph Sapp <rs@ti.com>","Cc":"robertcnelson@gmail.com, ayush@beagleboard.org,\n Erik.Welsh@octavosystems.com, anshuld@ti.com, bb@ti.com, trini@konsulko.com,\n afd@ti.com, xypron.glpk@gmx.de, ilias.apalodimas@linaro.org,\n u-boot@lists.denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","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>,\n <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>,\n <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"}},{"id":3680124,"web_url":"http://patchwork.ozlabs.org/comment/3680124/","msgid":"<DHZ7CA8ENGEC.1TQBC71ZOAULX@ti.com>","list_archive_url":null,"date":"2026-04-21T22:55:52","subject":"Re: [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb\n reservations","submitter":{"id":88727,"url":"http://patchwork.ozlabs.org/api/people/88727/","name":"Randolph Sapp","email":"rs@ti.com"},"content":"On Tue Apr 21, 2026 at 5:54 PM CDT, Simon Glass wrote:\n> Hi Randolph,\n>\n> On Wed, 22 Apr 2026 at 10:14, Randolph Sapp <rs@ti.com> wrote:\n>>\n>> On Tue Apr 21, 2026 at 3:40 PM CDT, Simon Glass wrote:\n>> > Hi Randolph,\n>> >\n>> > On 2026-04-20T19:25:18, Randolph Sapp <rs@ti.com> wrote:\n>> >> boot_fdt_add_mem_rsv_regions: free old dtb reservations\n>> >>\n>> >> Add a free flag and an initial call to free allocations covered by the\n>> >> global FDT. This assumes that all calls to boot_fdt_add_mem_rsv_regions\n>> >> occur before the transition to the new device tree, thus we can access\n>> >> the currently active device tree through the global data pointer.\n>> >>\n>> >> This allows us to clearly indicate to the user when a device tree\n>> >> reservation fails. How we handle this can still use some improvement.\n>> >> Right now we'll keep the default behavior and try to boot anyway.\n>> >>\n>> >> This functionality was broken in:\n>> >> 5a6aa7d (\"boot: fdt: Handle already reserved memory in boot_fdt_reserve_region()\")\n>> >>\n>> >> Signed-off-by: Randolph Sapp <rs@ti.com>\n>> >>\n>> >> arch/mips/lib/bootm.c |  2 +-\n>> >>  boot/bootm.c          |  2 +-\n>> >>  boot/bootm_os.c       |  2 +-\n>> >>  boot/image-board.c    |  2 +-\n>> >>  boot/image-fdt.c      | 57 +++++++++++++++++++++++++++++++++++----------------\n>> >>  include/image.h       |  2 +-\n>> >>  lib/lmb.c             |  2 +-\n>> >>  7 files changed, 45 insertions(+), 24 deletions(-)\n>> >\n>> >> diff --git a/boot/image-fdt.c b/boot/image-fdt.c\n>> >> @@ -69,35 +69,51 @@ static const struct legacy_img_hdr *image_get_fdt(ulong fdt_addr)\n>> >> +static void boot_fdt_reserve_region(u64 addr, u64 size, u32 flags, bool free)\n>> >>  {\n>> >> -     long ret;\n>> >> +     int ret;\n>> >\n>> > nit: perhaps keep this one 'long' since lmb_free() returns long ?\n>> >\n>> > Regards,\n>> > Simon\n>>\n>> Ugh, yeah though it should only return 0, -EEXIST, or -1 since that's all\n>> lmb_add_region_flags returns. I'm not going to ask why that's the case.\n>\n> Ah yes, I suppose it could be changed to return an int.\n>\n> Regards,\n> Simon\n\nI'll leave that for later cleanup considering I've still got to get the\npocketbeagle2 series submitted after this stuff.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256\n header.s=selector1 header.b=VkFRlQ6S;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.b=\"VkFRlQ6S\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com","phobos.denx.de; spf=pass smtp.mailfrom=rs@ti.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0d4k69RDz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 08:56:06 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id C4400842A4;\n\tWed, 22 Apr 2026 00:56:04 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id DD0CD842B7; Wed, 22 Apr 2026 00:56:03 +0200 (CEST)","from PH8PR06CU001.outbound.protection.outlook.com\n (mail-westus3azlp170120001.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c107::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 4417C83FED\n for <u-boot@lists.denx.de>; Wed, 22 Apr 2026 00:55:57 +0200 (CEST)","from CH0PR08CA0002.namprd08.prod.outlook.com (2603:10b6:610:33::7)\n by BL3PR10MB6259.namprd10.prod.outlook.com (2603:10b6:208:38e::10) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.33; Tue, 21 Apr\n 2026 22:55:52 +0000","from CH3PEPF00000015.namprd21.prod.outlook.com\n (2603:10b6:610:33:cafe::77) by CH0PR08CA0002.outlook.office365.com\n (2603:10b6:610:33::7) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9791.48 via Frontend Transport; Tue,\n 21 Apr 2026 22:55:53 +0000","from lewvzet201.ext.ti.com (198.47.23.195) by\n CH3PEPF00000015.mail.protection.outlook.com (10.167.244.120) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9870.4 via Frontend Transport; Tue, 21 Apr 2026 22:55:52 +0000","from DLEE213.ent.ti.com (157.170.170.116) by lewvzet201.ext.ti.com\n (10.4.14.104) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 21 Apr\n 2026 17:55:52 -0500","from DLEE213.ent.ti.com (157.170.170.116) by DLEE213.ent.ti.com\n (157.170.170.116) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 21 Apr\n 2026 17:55:52 -0500","from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE213.ent.ti.com\n (157.170.170.116) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend\n Transport; Tue, 21 Apr 2026 17:55:52 -0500","from localhost (rs-desk.dhcp.ti.com [128.247.81.39])\n by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 63LMtqNl1071565;\n Tue, 21 Apr 2026 17:55:52 -0500"],"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,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,T_SPF_PERMERROR autolearn=ham\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=AjmxhadG7Y/Fn6hnpox2vzz74mpQ46KCnMgTSULnQpY6xvpME9xvSDO038p1EwhnEkFJj4kG2liCUJUdZfe9hTgvL3dYW+XD8A7Ulp42IWC/OBmwC4L2eFr3xEx0PG/1z8QtI7w2yu/VM6Wwesrkne3LyOabjlzJf3cq4G1sTwJp9GXCSbxEQ7ZxLvP4XwqsprMSelPrqzBxALrJEIZC/kpRzc1k+RSx+k2tdOKHnqxS5kmexlOARfdPJeNiZ36ty4m+0abxj7sQbW65rB/aqt8gej0rsDK973qgEEUwG/BWt52uj/I+63dFOa0+hG6jrd0RbGFXtLrHJu91AkQTTg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=IiVnj0v8GuGNp97pe+WorlcjiS5mpC/wn7rOX5M5IUQ=;\n b=eBVvZg1SupJ9cPSwrT3jE00rTTIrPyCjHIjFmeI3/+E9Wo55sdbHLPgOyLRIpfgZKMTCEkT/JlT2qhThj20HY1Q4zHZHBXE43CaLIu+zys9pBEOrpmralf8Wl1xKy/HrQoyUSVysS5GZq4Mk2E7Z3oi1XD9XDSdQgVmMRMj2KoZ14z2UY6UsARZGPleshv/HNKDZL/XXHK12mBMpRCi9uVCLYrRQ6IjQ2lMRDkKkKA2jHvUubdMeYaFB8N/+cMIiHzVwk+txLM+vk03IfyLKXxLxNiglkN677F22OGMS0qy3Fp+GS3tFNXBIppGUWblszjekaQIt89bnfhg3SH/4oA==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 198.47.23.195) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=ti.com;\n dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com;\n dkim=none (message not signed); arc=none (0)","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=IiVnj0v8GuGNp97pe+WorlcjiS5mpC/wn7rOX5M5IUQ=;\n b=VkFRlQ6S/xqnVkiwAcFNdvVyjgj+sriAhUH41dGgzUw1K6yvZLW2j+v94pnTlBeN1x+NVQTgGFiNnvjmcCHsojkXXYvdlFFj1uwODinklMdImckgBuhDc0pz09ocEQ6s8XZGm0vnie2DPa4FHC+GJ/NIbqEnWQjU8Rnw8KpA3xo=","X-MS-Exchange-Authentication-Results":"spf=pass (sender IP is 198.47.23.195)\n smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;\n dmarc=pass\n action=none header.from=ti.com;","Received-SPF":"Pass (protection.outlook.com: domain of ti.com designates\n 198.47.23.195 as permitted sender) receiver=protection.outlook.com;\n client-ip=198.47.23.195; helo=lewvzet201.ext.ti.com; pr=C","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","Content-Type":"text/plain; charset=\"UTF-8\"","Date":"Tue, 21 Apr 2026 17:55:52 -0500","Message-ID":"<DHZ7CA8ENGEC.1TQBC71ZOAULX@ti.com>","CC":"<robertcnelson@gmail.com>, <ayush@beagleboard.org>,\n <Erik.Welsh@octavosystems.com>, <anshuld@ti.com>, <bb@ti.com>,\n <trini@konsulko.com>, <afd@ti.com>, <xypron.glpk@gmx.de>,\n <ilias.apalodimas@linaro.org>, <u-boot@lists.denx.de>","Subject":"Re: [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb\n reservations","From":"Randolph Sapp <rs@ti.com>","To":"Simon Glass <sjg@chromium.org>, Randolph Sapp <rs@ti.com>","X-Mailer":"aerc 0.21.0-0-g5549850facc2","References":"<20260420192520.1444749-1-rs@ti.com>\n <20260420192520.1444749-3-rs@ti.com>\n <CAFLszTggCLQPaJcRoxhjHOuRM10yW3pr8JjRj+LLA-ZupVOSjg@mail.gmail.com>\n <DHZ6GETQ2Z6C.2EZP9ISNJR0E7@ti.com>\n <CAFLszTi-6pmOYA1F8eZuXtV=Lg5fByTsPCeSBCp65kzw5DAW_g@mail.gmail.com>","In-Reply-To":"\n <CAFLszTi-6pmOYA1F8eZuXtV=Lg5fByTsPCeSBCp65kzw5DAW_g@mail.gmail.com>","X-C2ProcessedOrg":"333ef613-75bf-4e12-a4b1-8e3623f5dcea","X-EOPAttributedMessage":"0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"CH3PEPF00000015:EE_|BL3PR10MB6259:EE_","X-MS-Office365-Filtering-Correlation-Id":"cd00aba6-f8ac-4165-83e0-08de9ff923e5","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;\n ARA:13230040|36860700016|1800799024|376014|82310400026|22082099003|56012099003|18002099003;","X-Microsoft-Antispam-Message-Info":"\n z33mqpTMRuF+PSvTdBRwBDZychD3KouN65eOUAxhoVYo9Eedgjz4HcbYXV/VtSqkwQB0X4KIoffL+upvOk86i+xds4qIBHYmXc4PL3Yo7AGjleJ7xuIOK9qrqFy0V6UxBm2ifE7a3uuFQeSwlVC8Hf9sSKVTOdMpi7o8Bu2u7YbZ/gCndoeQx0p46QlWxh532y6c3LrfCRrzcTQV1PZkbwJ/UxbmMvFX7DY2X/Adwm0YRNB/JhigDKSpS5PV3rZIwnTzjwwDb8GwPPzr4k3WHWqYZGhXA7tQ9mtgcGllADMLXX0dLCF9wxtp2h9ApT26NDdSfUGn6yJrEwmHeWDISSevirrqcWuSbhrqIKZCC1L/A0EO050y+3+SDgiPg3LXgqVU9iaNsEmOy6dPqyZZ4LxeXgxF8qGqRbravervbTdpSoxih5X28toAA06V9+ZJgLgGTtVU+5OoU8KUfCmd79vaDCzZjB7+INXlhlplVgdG3SsIzrc5CSrDLfgtOohVE0nPAttQdjkeGXPw0Cx5vutQl4neVess2LAai1hzMz7AfcMJ8stqTb0B6smIRuWsPVvGV4XVE77iFexgPxpNtjoIEIGzfdVqEDtAk0yZM8rcqEnb7BR8UfBjhYSU0PuJlOkEozG1fnf9wITQkghjI7R7BcaNp7Xfmvz+5tN3nv7BcbEMLIX5JQWa4M0y26UPYIVdmTSj//T1b9dUfSIsUQK9nUCkMUf+wwP5Ah8ks0ouNPYOphhgLNsltzStCmaTviMtn58a8mMYJS6mEN3orA==","X-Forefront-Antispam-Report":"CIP:198.47.23.195; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:lewvzet201.ext.ti.com; PTR:InfoDomainNonexistent;\n CAT:NONE;\n SFS:(13230040)(36860700016)(1800799024)(376014)(82310400026)(22082099003)(56012099003)(18002099003);\n DIR:OUT; SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n S3Ii4TwpAwOGlC9I/14TbJvpHN5Dz+g3rp6gbePK/7dnJ28hQoPpHfXtwZd4R4E3AyQHn5auA6bdffplZgudloIP3iZauyk0MWgMOFQ5XVizfCkl9sjp7I7FTW/1f4iGFhnXAZs9qHhK4Oay+iIZlgaG6RUPC+UlhdTBFME0F+1AElDxpPnWRdhsKemBYI9e7IO/yeQhKpysJPjJjQiIWTBSMJ8nJ+S0v21zvXfIDKYeqGr08J+9faSjLe4vnA7bgKH1T3aFPCaOU+tR1GDDtond0NpJSbYHf286SJG6qrPCIwo4jce8FczHFax9DKHq17OhpjaXywYnWpbkyhbV8sk9y88MiIY+nqYsZAHfCsobFjLet+3pbQkhJX3k1xG+zMC0l3R2R95CAXn1K59aVNvl/a0FTiqMu2+AXaWIkZIXxY6wbl9OyEk3aL3z5xBl","X-OriginatorOrg":"ti.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"21 Apr 2026 22:55:52.9996 (UTC)","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n cd00aba6-f8ac-4165-83e0-08de9ff923e5","X-MS-Exchange-CrossTenant-Id":"e5b49634-450b-4709-8abb-1e2b19b982b7","X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp":"\n TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7; Ip=[198.47.23.195];\n Helo=[lewvzet201.ext.ti.com]","X-MS-Exchange-CrossTenant-AuthSource":"\n CH3PEPF00000015.namprd21.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Anonymous","X-MS-Exchange-CrossTenant-FromEntityHeader":"HybridOnPrem","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"BL3PR10MB6259","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>,\n <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>,\n <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"}}]