Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196079/?format=api
{ "id": 2196079, "url": "http://patchwork.ozlabs.org/api/patches/2196079/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260212204511.619392-6-javierm@redhat.com/", "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": "<20260212204511.619392-6-javierm@redhat.com>", "list_archive_url": null, "date": "2026-02-12T20:44:59", "name": "[v2,5/7] disk: part_dos: Refactor to allow retrieving raw MBR partition data", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "8eac7bec1a16e6b87f049fee72e38d78be32a41f", "submitter": { "id": 72132, "url": "http://patchwork.ozlabs.org/api/people/72132/?format=api", "name": "Javier Martinez Canillas", "email": "javierm@redhat.com" }, "delegate": { "id": 68728, "url": "http://patchwork.ozlabs.org/api/users/68728/?format=api", "username": "xypron", "first_name": "Heinrich", "last_name": "Schuchardt", "email": "xypron.glpk@gmx.de" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260212204511.619392-6-javierm@redhat.com/mbox/", "series": [ { "id": 492022, "url": "http://patchwork.ozlabs.org/api/series/492022/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=492022", "date": "2026-02-12T20:44:54", "name": "efi_loader: disk: Add EFI_PARTITION_INFO_PROTOCOL support for MBR", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/492022/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196079/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196079/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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=X64nf7Id;\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=redhat.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=redhat.com header.i=@redhat.com header.b=\"X64nf7Id\";\n\tdkim-atps=neutral", "phobos.denx.de; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=javierm@redhat.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 4fBnQ94NWtz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 07:46:09 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 24F0583DEC;\n\tThu, 12 Feb 2026 21:45:36 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id 6707D83D5D; Thu, 12 Feb 2026 21:45:34 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\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 285B483DCA\n for <u-boot@lists.denx.de>; Thu, 12 Feb 2026 21:45:32 +0100 (CET)", "from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-678-61p4FokNOB2qRsK1M2e80A-1; Thu, 12 Feb 2026 15:45:29 -0500", "by mail-wm1-f72.google.com with SMTP id\n 5b1f17b1804b1-4831192e66aso1746855e9.2\n for <u-boot@lists.denx.de>; Thu, 12 Feb 2026 12:45:28 -0800 (PST)", "from localhost (62-151-111-63.jazzfree.ya.com. [62.151.111.63])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4835dcfaae1sm112461635e9.10.2026.02.12.12.45.24\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 12 Feb 2026 12:45:24 -0800 (PST)" ], "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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,\n RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1770929130;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=ff3LnV4UpKOVSsEDELJfWMsPJFExXBzVTn+uK1DlVDo=;\n b=X64nf7Idq0IC6rq5QkAhzdoKAq1RzdGUvWBHjLjUSLDWlcok3jYxz32+Ont2J+TKWSlx0M\n lyEf/LovfONlSBLSpomI6xe6vna4ITWMphG3frkMM4we8yg5UUSfkiSIaQqkdYKICxx3GV\n CUYjQoiZaQ+wITnRfL9mpryGB1TMfI0=", "X-MC-Unique": "61p4FokNOB2qRsK1M2e80A-1", "X-Mimecast-MFC-AGG-ID": "61p4FokNOB2qRsK1M2e80A_1770929127", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770929127; x=1771533927;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=ff3LnV4UpKOVSsEDELJfWMsPJFExXBzVTn+uK1DlVDo=;\n b=DDGCl1TE5tPqoOr2KPoOfk39RHL1ZaD8jfVdiMWF5ZLSGKR5Pmewf9p21Uq310k/m8\n +Et7G5SMn0F1awEkR08/+9KGMtEBz8gQfDctk0DXyUzdjBT07cDlMWZfIWXtAucrR3EM\n ZObggH/ZxYhWnolaPIoqq8FbA419RW5kbn/fJJVQcUrZIgctqIQ9qBNkVABiks00Eqfy\n yY6wsKXo3+++q9iBEmO4u8SvASbbC/sFYwV58I+B4pUWtUAjUH9dW8k/AyCPYMK6wwK0\n cDC5k8Ohz9u3ssDvkTd2U1ooV75oKJ6ogcd+wuAKfbnjmEKsHrOx2T0vGmx8ybHLFrp7\n hLhw==", "X-Gm-Message-State": "AOJu0YxIREPOvTHbSafr0oKr4MzjXub6LmsEMMujdEC2s9Y2GUoQ3a8E\n NLfIciRr9WpTUOZBco+qBMv9SFrQyEWyi5jAIaYzeDpy7QOvZxmGM03Fwa/i55w3JQ6KNNRBk3i\n PiuaHJQkjHvD+GA9cChOrz3xY9xepOnu85tqA5XCSMJEJOjWyU7EkTIJul3kR6LUH3c2Vjpj1ES\n M7NIFd8wutqk/V0zTZKICQ8JzuTAs8wtRFWpsBbQ==", "X-Gm-Gg": "AZuq6aJNbfMvAL3+LMrE/y4kxFd4rSG9MJmF+VF7pDOLR07CPE5m9mKi5OLfna9jYj0\n Pb+sGmubx66I/F2nCdm/TcxEMQTRGWKEhHaHUVAFCnkmoaMvYLxU+p4kWUeHZ8lzk2DTPNXPmBr\n EFRhPTL6vQ2eRMmXx/71jifHSX8g7OpFJVcBprqwkyoFLfr4Dfb0iJ3QBalpV7ecf+rdXcwqW5u\n TG9ZrqLNsT4LHqSP6WmYSdlvyeibEeENLfpzl1UmMPlEF7DaAUQpzqDhU+HVb3+fqtD60MsaiIJ\n mgW+FZrodLaL0cwGEMcJymamGJdIj7M/rGKnMFRwxiUtKV8aYVMppk+iADMVQy4nwvawjcTj2eO\n 9CCsMFOABA/DhhV5kFsWSxHVFce1cFc7hMlLUxOPOlbABMKM=", "X-Received": [ "by 2002:a05:600c:8b4c:b0:480:5678:1fdd with SMTP id\n 5b1f17b1804b1-4837105240amr5961245e9.12.1770929126639;\n Thu, 12 Feb 2026 12:45:26 -0800 (PST)", "by 2002:a05:600c:8b4c:b0:480:5678:1fdd with SMTP id\n 5b1f17b1804b1-4837105240amr5960775e9.12.1770929126070;\n Thu, 12 Feb 2026 12:45:26 -0800 (PST)" ], "From": "Javier Martinez Canillas <javierm@redhat.com>", "To": "u-boot@lists.denx.de", "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>, eballetb@redhat.com,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Tom Rini <trini@konsulko.com>,\n Javier Martinez Canillas <javierm@redhat.com>,\n Casey Connolly <casey.connolly@linaro.org>,\n Jan Kiszka <jan.kiszka@siemens.com>, Javier Tia <javier.tia@linaro.org>,\n Rasmus Villemoes <ravi@prevas.dk>,\n Varadarajan Narayanan <quic_varada@quicinc.com>", "Subject": "[PATCH v2 5/7] disk: part_dos: Refactor to allow retrieving raw MBR\n partition data", "Date": "Thu, 12 Feb 2026 21:44:59 +0100", "Message-ID": "<20260212204511.619392-6-javierm@redhat.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260212204511.619392-1-javierm@redhat.com>", "References": "<20260212204511.619392-1-javierm@redhat.com>", "MIME-Version": "1.0", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "Zs6NXSgdnPvAWNkwYY8acCGlkSTO_JLJJjyY6Cc_c5o_1770929127", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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": "Refactor the part_get_info_extended() helper function (which already\nrecursively traverses DOS partitions) to optionally return the raw MBR\npartition structure (dos_partition_t).\n\nThis allows other subsystems, such as EFI, to retrieve the partition\ndetails in the legacy MBR format.\n\nSigned-off-by: Javier Martinez Canillas <javierm@redhat.com>\n---\n\n(no changes since v1)\n\n disk/part_dos.c | 66 ++++++++++++++++++++++++++++++-------------------\n include/part.h | 14 +++++++++++\n 2 files changed, 55 insertions(+), 25 deletions(-)", "diff": "diff --git a/disk/part_dos.c b/disk/part_dos.c\nindex a69ad8962106..4e1d01b2f21e 100644\n--- a/disk/part_dos.c\n+++ b/disk/part_dos.c\n@@ -204,7 +204,8 @@ static void print_partition_extended(struct blk_desc *desc,\n * @relative:\t\tRelative offset for the partition\n * @part_num:\t\tCurrent partition number\n * @which_part:\t\tTarget partition number\n- * @info:\t\tReturns a pointer to the partition info\n+ * @info:\t\tReturns partition information (optional)\n+ * @mbr:\t\tReturns MBR partition entry (optional)\n * @disksig:\t\tDisk signature\n *\n * Return:\t\t0 on success, negative on error\n@@ -212,7 +213,9 @@ static void print_partition_extended(struct blk_desc *desc,\n static int part_get_info_extended(struct blk_desc *desc,\n \t\t\t\t lbaint_t ext_part_sector, lbaint_t relative,\n \t\t\t\t int part_num, int which_part,\n-\t\t\t\t struct disk_partition *info, uint disksig)\n+\t\t\t\t struct disk_partition *info,\n+\t\t\t\t dos_partition_t *mbr,\n+\t\t\t\t uint disksig)\n {\n \tALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, desc->blksz);\n \tstruct disk_partition wdinfo = { 0 };\n@@ -243,9 +246,11 @@ static int part_get_info_extended(struct blk_desc *desc,\n \tif (CONFIG_IS_ENABLED(PARTITION_UUIDS) && !ext_part_sector)\n \t\tdisksig = get_unaligned_le32(&buffer[DOS_PART_DISKSIG_OFFSET]);\n \n-\tret = part_get_info_whole_disk(desc, &wdinfo);\n-\tif (ret)\n-\t\treturn ret;\n+\tif (info) {\n+\t\tret = part_get_info_whole_disk(desc, &wdinfo);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n \n \t/* Print all primary/logical partitions */\n \tpt = (dos_partition_t *) (buffer + DOS_PART_TBL_OFFSET);\n@@ -258,25 +263,29 @@ static int part_get_info_extended(struct blk_desc *desc,\n \t\t (pt->sys_ind != 0) &&\n \t\t (part_num == which_part) &&\n \t\t (ext_part_sector == 0 || is_extended(pt->sys_ind) == 0)) {\n-\t\t\tif (wdinfo.blksz > DOS_PART_DEFAULT_SECTOR)\n-\t\t\t\tinfo->blksz = wdinfo.blksz;\n-\t\t\telse\n-\t\t\t\tinfo->blksz = DOS_PART_DEFAULT_SECTOR;\n-\t\t\tinfo->start = (lbaint_t)(ext_part_sector +\n-\t\t\t\t\tget_unaligned_le32(&pt->start_sect));\n-\t\t\tinfo->size = (lbaint_t)get_unaligned_le32(&pt->nr_sects);\n-\t\t\tpart_set_generic_name(desc, part_num,\n-\t\t\t\t\t (char *)info->name);\n-\t\t\t/* sprintf(info->type, \"%d, pt->sys_ind); */\n-\t\t\tstrcpy((char *)info->type, \"U-Boot\");\n-\t\t\tinfo->bootable = get_bootable(pt);\n-\t\t\tif (CONFIG_IS_ENABLED(PARTITION_UUIDS)) {\n-\t\t\t\tchar str[12];\n-\n-\t\t\t\tsprintf(str, \"%08x-%02x\", disksig, part_num);\n-\t\t\t\tdisk_partition_set_uuid(info, str);\n+\t\t\tif (info) {\n+\t\t\t\tif (wdinfo.blksz > DOS_PART_DEFAULT_SECTOR)\n+\t\t\t\t\tinfo->blksz = wdinfo.blksz;\n+\t\t\t\telse\n+\t\t\t\t\tinfo->blksz = DOS_PART_DEFAULT_SECTOR;\n+\t\t\t\tinfo->start = (lbaint_t)(ext_part_sector +\n+\t\t\t\t\t\t\t get_unaligned_le32(&pt->start_sect));\n+\t\t\t\tinfo->size = (lbaint_t)get_unaligned_le32(&pt->nr_sects);\n+\t\t\t\tpart_set_generic_name(desc, part_num,\n+\t\t\t\t\t\t (char *)info->name);\n+\t\t\t\t/* sprintf(info->type, \"%d, pt->sys_ind); */\n+\t\t\t\tstrcpy((char *)info->type, \"U-Boot\");\n+\t\t\t\tinfo->bootable = get_bootable(pt);\n+\t\t\t\tif (CONFIG_IS_ENABLED(PARTITION_UUIDS)) {\n+\t\t\t\t\tchar str[12];\n+\n+\t\t\t\t\tsprintf(str, \"%08x-%02x\", disksig, part_num);\n+\t\t\t\t\tdisk_partition_set_uuid(info, str);\n+\t\t\t\t}\n+\t\t\t\tinfo->sys_ind = pt->sys_ind;\n \t\t\t}\n-\t\t\tinfo->sys_ind = pt->sys_ind;\n+\t\t\tif (mbr)\n+\t\t\t\tmemcpy(mbr, pt, sizeof(*mbr));\n \t\t\treturn 0;\n \t\t}\n \n@@ -296,7 +305,8 @@ static int part_get_info_extended(struct blk_desc *desc,\n \n \t\t\treturn part_get_info_extended(desc, lba_start,\n \t\t\t\t ext_part_sector == 0 ? lba_start : relative,\n-\t\t\t\t part_num, which_part, info, disksig);\n+\t\t\t\t\t\t part_num, which_part, info,\n+\t\t\t\t\t\t mbr, disksig);\n \t\t}\n \t}\n \n@@ -328,7 +338,13 @@ static void __maybe_unused part_print_dos(struct blk_desc *desc)\n static int __maybe_unused part_get_info_dos(struct blk_desc *desc, int part,\n \t\t\t\t\t struct disk_partition *info)\n {\n-\treturn part_get_info_extended(desc, 0, 0, 1, part, info, 0);\n+\treturn part_get_info_extended(desc, 0, 0, 1, part, info, NULL, 0);\n+}\n+\n+int __maybe_unused part_get_mbr(struct blk_desc *desc, int part,\n+\t\t\t\tdos_partition_t *mbr)\n+{\n+\treturn part_get_info_extended(desc, 0, 0, 1, part, NULL, mbr, 0);\n }\n \n int is_valid_dos_buf(void *buf)\ndiff --git a/include/part.h b/include/part.h\nindex daebbbc2e68f..aed089d00f64 100644\n--- a/include/part.h\n+++ b/include/part.h\n@@ -704,6 +704,20 @@ int write_mbr_partitions(struct blk_desc *dev,\n int layout_mbr_partitions(struct disk_partition *p, int count,\n \t\t\t lbaint_t total_sectors);\n \n+/**\n+ * part_get_mbr() - get the MBR partition record of a partition\n+ *\n+ * This function reads the MBR partition record for a given block\n+ * device and partition number.\n+ *\n+ * @desc:\tblock device descriptor\n+ * @part:\tpartition number for which to return the partition record\n+ * @mbr:\tMBR partition record\n+ *\n+ * Return:\t0 on success, otherwise error\n+ */\n+int part_get_mbr(struct blk_desc *desc, int part, dos_partition_t *mbr);\n+\n #endif\n \n #if CONFIG_IS_ENABLED(PARTITIONS)\n", "prefixes": [ "v2", "5/7" ] }