Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2059125/?format=api
{ "id": 2059125, "url": "http://patchwork.ozlabs.org/api/patches/2059125/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20250312074019.2281884-1-mwalle@kernel.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20250312074019.2281884-1-mwalle@kernel.org>", "list_archive_url": null, "date": "2025-03-12T07:40:19", "name": "[3/3] env: mmc: fix offsets relative to the end of the partition", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "e5b1e36aad71484113f9fbd002a57deecf8541e8", "submitter": { "id": 86646, "url": "http://patchwork.ozlabs.org/api/people/86646/?format=api", "name": "Michael Walle", "email": "mwalle@kernel.org" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20250312074019.2281884-1-mwalle@kernel.org/mbox/", "series": [ { "id": 448076, "url": "http://patchwork.ozlabs.org/api/series/448076/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=448076", "date": "2025-03-12T07:36:55", "name": "[1/3] fastboot: lift restrictions on !NET_LWIP for USB", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/448076/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2059125/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2059125/checks/", "tags": {}, "related": [], "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 (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=B+dDxV13;\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=quarantine dis=none) header.from=kernel.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.b=\"B+dDxV13\";\n\tdkim-atps=neutral", "phobos.denx.de; dmarc=pass (p=quarantine dis=none)\n header.from=kernel.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=mwalle@kernel.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))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4ZCMxB1S1Sz20JV\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 12 Mar 2025 18:40:29 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id EFD0B805D7;\n\tWed, 12 Mar 2025 08:40:28 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id 2F72080756; Wed, 12 Mar 2025 08:40:27 +0100 (CET)", "from dfw.source.kernel.org (dfw.source.kernel.org\n [IPv6:2604:1380:4641:c500::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 D882E801BE\n for <u-boot@lists.denx.de>; Wed, 12 Mar 2025 08:40:24 +0100 (CET)", "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by dfw.source.kernel.org (Postfix) with ESMTP id B0B135C4CD3;\n Wed, 12 Mar 2025 07:38:06 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 32973C4CEE3;\n Wed, 12 Mar 2025 07:40:22 +0000 (UTC)" ], "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", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1741765223;\n bh=w1GqLqhQmfwwEukCTWgH4PkZtO1XxD/KyahoTDFhbE8=;\n h=From:To:Cc:Subject:Date:From;\n b=B+dDxV13PP41a4gLdoh7QfU4cYnnBSvv9vViN0wQyFH06RPv0s6k4/Z5D4wq0M5Cl\n NU0i8FtHskGzEAhSMFSRb3E3fFRkTLmrM/XUick92qRA5akrsjxxtzKuhgmdJDKK/T\n runy8R/Xpsw1/15tScMRX9GBIpMNxCV14+k2vob7sXvqGmENbA36BrAYwzSMGAAN4K\n 4h0YPyyaVrK0Z7FKFgR4EbRfVUBCzLo1nNCEFHv8nfjCr+RbdNpX1Gujz7vWjBjZoG\n 6b73Gytv/kBEyerVJu46YbAgMUpquQHYJh9hlPI+/9jI6P+FvY75mcDIJB35gimbI9\n aJoo6rz8nnzsA==", "From": "Michael Walle <mwalle@kernel.org>", "To": "Tom Rini <trini@konsulko.com>,\n\tJoe Hershberger <joe.hershberger@ni.com>", "Cc": "u-boot@lists.denx.de,\n\tMichael Walle <mwalle@kernel.org>", "Subject": "[PATCH 3/3] env: mmc: fix offsets relative to the end of the\n partition", "Date": "Wed, 12 Mar 2025 08:40:19 +0100", "Message-Id": "<20250312074019.2281884-1-mwalle@kernel.org>", "X-Mailer": "git-send-email 2.39.5", "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>,\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" }, "content": "According to the help text, you can set negative offsets to indicated\nthat the offset is relative to the end of the parition. But kconfig\ndoesn't let you specify negative hex values. I think this fell through\nthe cracks when converting the symbol from a '#define' to a kconfig\noption.\n\nIntroduce a new boolean kconfig option to switch on the \"relative to the\nend\" behavior.\n\nSigned-off-by: Michael Walle <mwalle@kernel.org>\n---\n env/Kconfig | 42 +++++++++++++++++++++++++-----------------\n env/mmc.c | 8 ++++++++\n 2 files changed, 33 insertions(+), 17 deletions(-)", "diff": "diff --git a/env/Kconfig b/env/Kconfig\nindex 4438f0b392c..49888bf700c 100644\n--- a/env/Kconfig\n+++ b/env/Kconfig\n@@ -231,14 +231,6 @@ config ENV_IS_IN_MMC\n \t These two #defines specify the offset and size of the environment\n \t area within the specified MMC device.\n \n-\t If offset is positive (the usual case), it is treated as relative to\n-\t the start of the MMC partition. If offset is negative, it is treated\n-\t as relative to the end of the MMC partition. This can be useful if\n-\t your board may be fitted with different MMC devices, which have\n-\t different sizes for the MMC partitions, and you always want the\n-\t environment placed at the very end of the partition, to leave the\n-\t maximum possible space before it, to store other data.\n-\n \t These two values are in units of bytes, but must be aligned to an\n \t MMC sector boundary.\n \n@@ -249,9 +241,6 @@ config ENV_IS_IN_MMC\n \t valid backup copy in case the other copy is corrupted, e.g. due\n \t to a power failure during a \"saveenv\" operation.\n \n-\t This value may also be positive or negative; this is handled in the\n-\t same way as CONFIG_ENV_OFFSET.\n-\n \t In case CONFIG_SYS_MMC_ENV_PART is 1 (i.e. environment in eMMC boot\n \t partition) then setting CONFIG_ENV_OFFSET_REDUND to the same value\n \t as CONFIG_ENV_OFFSET makes use of the second eMMC boot partition for\n@@ -592,9 +581,18 @@ config ENV_OFFSET\n \t Offset from the start of the device (or partition).\n \n \t This offset may be interpreted differently depending on the chosen\n-\t ENV_IS_IN_* options. For example, for ENV_IS_IN_MMC=y, this offset may\n-\t be negative to indicate an offset backwards from the end of the\n-\t partition. See the relevant help messages for more details.\n+\t ENV_IS_IN_* options. See the relevant help messages for more details.\n+\n+config ENV_OFFSET_RELATIVE_END\n+\tbool \"Offset is relative to the end of the partition\"\n+\tdepends on ENV_IS_IN_MMC\n+\thelp\n+\t Treat the environment offset as relative to the end of the MMC\n+\t partition. This can be useful if your board may be fitted with\n+\t different MMC devices, which have different sizes for the MMC\n+\t partitions, and you always want the environment placed at the very end\n+\t of the partition, to leave the maximum possible space before it, to\n+\t store other data.\n \n config ENV_OFFSET_REDUND\n \thex \"Redundant environment offset\"\n@@ -607,9 +605,19 @@ config ENV_OFFSET_REDUND\n \t environment location.\n \n \t This offset may be interpreted differently depending on the chosen\n-\t ENV_IS_IN_* options. For example, for ENV_IS_IN_MMC=y, this offset may\n-\t be negative to indicate an offset backwards from the end of the\n-\t partition. See the relevant help messages for more details.\n+\t ENV_IS_IN_* options. See the relevant help messages for more details.\n+\n+config ENV_OFFSET_REDUND_RELATIVE_END\n+\tbool \"Offset is relative to the end of the partition\"\n+\tdepends on SYS_REDUNDAND_ENVIRONMENT\n+\tdepends on ENV_IS_IN_MMC\n+\thelp\n+\t Treat the redundnat environment offset as relative to the end of the\n+\t MMC partition. This can be useful if your board may be fitted with\n+\t different MMC devices, which have different sizes for the MMC\n+\t partitions, and you always want the environment placed at the very end\n+\t of the partition, to leave the maximum possible space before it, to\n+\t store other data.\n \n config ENV_SIZE\n \thex \"Environment Size\"\ndiff --git a/env/mmc.c b/env/mmc.c\nindex 379f5ec9be7..fd8095f9793 100644\n--- a/env/mmc.c\n+++ b/env/mmc.c\n@@ -29,11 +29,19 @@\n \n #else\n /* Default ENV offset when not defined in Device Tree */\n+#if !defined(CONFIG_ENV_OFFSET_RELATIVE_END)\n #define ENV_MMC_OFFSET\t\tCONFIG_ENV_OFFSET\n+#else\n+#define ENV_MMC_OFFSET\t\t(-(CONFIG_ENV_OFFSET))\n+#endif\n \n #if defined(CONFIG_ENV_OFFSET_REDUND)\n+#if !defined(CONFIG_ENV_OFFSET_REDUND_RELATIVE_END)\n #define ENV_MMC_OFFSET_REDUND\tCONFIG_ENV_OFFSET_REDUND\n #else\n+#define ENV_MMC_OFFSET_REDUND\t(-(CONFIG_ENV_OFFSET_REDUND))\n+#endif\n+#else\n #define ENV_MMC_OFFSET_REDUND\tENV_MMC_INVALID_OFFSET\n #endif\n #endif\n", "prefixes": [ "3/3" ] }