get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2170003/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2170003,
    "url": "http://patchwork.ozlabs.org/api/patches/2170003/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20251128163535.2301653-2-raymondmaoca@gmail.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": "<20251128163535.2301653-2-raymondmaoca@gmail.com>",
    "list_archive_url": null,
    "date": "2025-11-28T16:35:18",
    "name": "[v5,1/6] smbios: Fix duplicated smbios handles",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "3d0d3b751b179af1707c86940e27320759a04a7f",
    "submitter": {
        "id": 91989,
        "url": "http://patchwork.ozlabs.org/api/people/91989/?format=api",
        "name": "Raymond Mao",
        "email": "raymondmaoca@gmail.com"
    },
    "delegate": {
        "id": 96103,
        "url": "http://patchwork.ozlabs.org/api/users/96103/?format=api",
        "username": "apalos",
        "first_name": "Ilias",
        "last_name": "Apalodimas",
        "email": "apalos@gmail.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20251128163535.2301653-2-raymondmaoca@gmail.com/mbox/",
    "series": [
        {
            "id": 483864,
            "url": "http://patchwork.ozlabs.org/api/series/483864/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=483864",
            "date": "2025-11-28T16:35:17",
            "name": "Implement all missing SMBIOS types required by distro tooling",
            "version": 5,
            "mbox": "http://patchwork.ozlabs.org/series/483864/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2170003/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2170003/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=ZeRA5ArT;\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=gmail.com",
            "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=gmail.com header.i=@gmail.com header.b=\"ZeRA5ArT\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=raymondmaoca@gmail.com"
        ],
        "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 4dHzSb249bz1yDd\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 29 Nov 2025 03:35:59 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 6924883B1E;\n\tFri, 28 Nov 2025 17:35:56 +0100 (CET)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 63DA083AED; Fri, 28 Nov 2025 17:35:55 +0100 (CET)",
            "from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com\n [IPv6:2607:f8b0:4864:20::72b])\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 2E70983AED\n for <u-boot@lists.denx.de>; Fri, 28 Nov 2025 17:35:53 +0100 (CET)",
            "by mail-qk1-x72b.google.com with SMTP id\n af79cd13be357-8b2d7c38352so288706485a.0\n for <u-boot@lists.denx.de>; Fri, 28 Nov 2025 08:35:53 -0800 (PST)",
            "from ubuntu.localdomain ([216.58.22.99])\n by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8b52a1b75a9sm331227985a.25.2025.11.28.08.35.50\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 28 Nov 2025 08:35:51 -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,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,\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/relaxed;\n d=gmail.com; s=20230601; t=1764347752; x=1764952552; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=jRa/XPibuvZ6Al72mq7c1N8vyOD0HIidnyiLfOOx5Wk=;\n b=ZeRA5ArT1rbTrqFBVzVUwB5aKnxtpikA0myrL6p0HEGk1LXAEGZtLUDQ7Ke2R8Dx94\n Zx229LuiPvgIKxb/e2XjEICFhcuDTw0P0GqpLkUJc3Or7ldnstzZMvt2LX7kH/fc5GWA\n b2r60gUIB5TOtEHbgeU1mVc1OWZj0gEh0CZkkFjMnra7523Z+/D1gIXnL/DhN4ykGeI+\n frXq7ryyfh3Fsd/2HBfvNeby747foSzb7A+QTHuRUPxqAkoECPuZF+64i96ufVqA4ouB\n 0++xprU7Jj35/TFIf+g16tfPyLLvtxsW65YNI78Lgs6ajqb+JRAJSPVf5j5ELiLG5ymR\n Fr9A==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1764347752; x=1764952552;\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=jRa/XPibuvZ6Al72mq7c1N8vyOD0HIidnyiLfOOx5Wk=;\n b=IM3OxaYLeq0XAK6yRHEgDRXlo7HJE+FPU92kvPLPJO6AuQr3PdQ0wQqI7SjGpWxW91\n KX0hgSSSFF4y5dz4HCvd3bpbZhxB+10pSZ4pOFIzpxRqIkp16e7wP7FdlgexUUW+Rmp5\n fmyy74HqfIs3yQdqqqIigv3ySviykpqDmNY/SEhatW4pcPDlYoPPZpMEEXQJ3eftW7EU\n 0FZViGj69qAs65Z4eNXGnGtGtV4f7Pbo4HXgM4T+pYSOYypQWJ8RvyE/welSlyw/lijD\n TXSZrXQpJ7RF1wMNJv2BKphZVOHPe6YpRNNw26Maa789V16XIOz1AmuV8e+2I6auepsv\n theA==",
        "X-Gm-Message-State": "AOJu0Yy4KGpyxG9vRSSDagCX2TaP/KelkE0rnKmqvclrJCFBlyAse83r\n lcBVYSf8aM6aFNt5yR75vn6SpuKQC3B8CszNmoxNSH4P/RtIrh0/ZYAe30goQeIkRY8=",
        "X-Gm-Gg": "ASbGncvUcHV9Uwu3g78INdGbz/2deh86psIwgbHUuRG0MtOp2/2GARnBooTTrAI0QZz\n 2FcRCYPjntOy1MZAy63k7Ih17jhzpdd2wqDmtGvPt/H7np56OvTt31gYV3pwAfTfAO2rcCvrAPu\n 9+Pri24UFmUiqjSI9beKq2faWCiD+aeq8ekO2xVLF+HBq93ttYgHfAKzgXYf7ereNIOiSL+PBfp\n XS24VR4o3X86eVdiencRNwyQgy8+95EfvtAzzAAKFWRziTodsZSCjaT8XRL8AT2dU17M4t3CcOl\n zz8eiGzRRysc1uDypoIwASe7XAkohe9KqiQmCEwl0U64ebQCWikLV7rep1pG+gdCRzlzWfTxmhu\n PWVaOEYrk7Tvwmgh5Ma0Bm4CZEJ2BEYDW/rbFai2txun2uWuYoOARyIdFaFtRRNrRsnIhLhyZtE\n Qv57ZRzJYp4vzZYPyffnZsV5bMzil8TmP9TJASS3TYKg==",
        "X-Google-Smtp-Source": "\n AGHT+IGvEaEDT1NfBMmfORx/Aa8nkH86Vkpoc6tGhF75L7qnI+L8n3N4DRMsdWiOvqxbcFgpvg1z+w==",
        "X-Received": "by 2002:a05:620a:4402:b0:8b2:eebc:64bc with SMTP id\n af79cd13be357-8b33be05c80mr5071295785a.35.1764347751734;\n Fri, 28 Nov 2025 08:35:51 -0800 (PST)",
        "From": "Raymond Mao <raymondmaoca@gmail.com>",
        "To": "u-boot@lists.denx.de",
        "Cc": "Raymond Mao <raymondmaoca@gmail.com>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Tom Rini <trini@konsulko.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Mark Kettenis <kettenis@openbsd.org>,\n Baocheng Su <baocheng.su@siemens.com>,\n Li Hua Qian <huaqian.li@siemens.com>, Jan Kiszka <jan.kiszka@siemens.com>,\n Samuel Holland <samuel.holland@sifive.com>, Peng Fan <peng.fan@nxp.com>",
        "Subject": "[PATCH v5 1/6] smbios: Fix duplicated smbios handles",
        "Date": "Fri, 28 Nov 2025 08:35:18 -0800",
        "Message-Id": "<20251128163535.2301653-2-raymondmaoca@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20251128163535.2301653-1-raymondmaoca@gmail.com>",
        "References": "<20251128163535.2301653-1-raymondmaoca@gmail.com>",
        "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": "Some smbios types can have multiple instances (e.g. Type 7, 9, 16, 17,\n19), thus the 'handle' argument should be a pointer so that the value\ncan be accumulated when writing all the instances.\nThis also fix the observed duplicated Type 7 handles.\n\nFixes: bcf456dd369e (\"smbios: add detailed smbios information\")\nSigned-off-by: Raymond Mao <raymondmaoca@gmail.com>\nReviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>\n---\nChanges in v3:\n- Initial patch.\nChanges in v4:\n- None.\nChanges in v5:\n- None.\n\n lib/smbios.c | 42 +++++++++++++++++++++++-------------------\n 1 file changed, 23 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/lib/smbios.c b/lib/smbios.c\nindex b8c2846277a..85508c06547 100644\n--- a/lib/smbios.c\n+++ b/lib/smbios.c\n@@ -103,7 +103,7 @@ struct smbios_ctx {\n  * @ctx:\tcontext for writing the tables\n  * Return:\tsize of the structure\n  */\n-typedef int (*smbios_write_type)(ulong *addr, int handle,\n+typedef int (*smbios_write_type)(ulong *addr, int *handle,\n \t\t\t\t struct smbios_ctx *ctx);\n \n /**\n@@ -364,7 +364,7 @@ static int smbios_string_table_len(const struct smbios_ctx *ctx)\n \treturn (ctx->next_ptr + 1) - ctx->eos;\n }\n \n-static int smbios_write_type0(ulong *current, int handle,\n+static int smbios_write_type0(ulong *current, int *handle,\n \t\t\t      struct smbios_ctx *ctx)\n {\n \tstruct smbios_type0 *t;\n@@ -372,7 +372,7 @@ static int smbios_write_type0(ulong *current, int handle,\n \n \tt = map_sysmem(*current, len);\n \tmemset(t, 0, len);\n-\tfill_smbios_header(t, SMBIOS_BIOS_INFORMATION, len, handle);\n+\tfill_smbios_header(t, SMBIOS_BIOS_INFORMATION, len, *handle);\n \tsmbios_set_eos(ctx, t->eos);\n \tt->vendor = smbios_add_prop_si(ctx, NULL, SYSID_SM_BIOS_VENDOR,\n \t\t\t\t       \"U-Boot\");\n@@ -423,7 +423,7 @@ static int smbios_write_type0(ulong *current, int handle,\n \treturn len;\n }\n \n-static int smbios_write_type1(ulong *current, int handle,\n+static int smbios_write_type1(ulong *current, int *handle,\n \t\t\t      struct smbios_ctx *ctx)\n {\n \tstruct smbios_type1 *t;\n@@ -434,7 +434,7 @@ static int smbios_write_type1(ulong *current, int handle,\n \n \tt = map_sysmem(*current, len);\n \tmemset(t, 0, len);\n-\tfill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, handle);\n+\tfill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, *handle);\n \tsmbios_set_eos(ctx, t->eos);\n \n \tt->manufacturer = smbios_add_prop_si(ctx, \"manufacturer\",\n@@ -471,7 +471,7 @@ static int smbios_write_type1(ulong *current, int handle,\n \treturn len;\n }\n \n-static int smbios_write_type2(ulong *current, int handle,\n+static int smbios_write_type2(ulong *current, int *handle,\n \t\t\t      struct smbios_ctx *ctx)\n {\n \tstruct smbios_type2 *t;\n@@ -485,7 +485,7 @@ static int smbios_write_type2(ulong *current, int handle,\n \t */\n \tt = map_sysmem(*current, len);\n \tmemset(t, 0, len);\n-\tfill_smbios_header(t, SMBIOS_BOARD_INFORMATION, len, handle);\n+\tfill_smbios_header(t, SMBIOS_BOARD_INFORMATION, len, *handle);\n \n \t/* eos is at the end of the structure */\n \teos_addr = (u8 *)t + len - sizeof(t->eos);\n@@ -519,7 +519,7 @@ static int smbios_write_type2(ulong *current, int handle,\n \t * t->number_contained_objects = <obj_handle_num>;\n \t */\n \n-\tt->chassis_handle = handle + 1;\n+\tt->chassis_handle = *handle + 1;\n \n \tlen = t->hdr.length + smbios_string_table_len(ctx);\n \t*current += len;\n@@ -528,7 +528,7 @@ static int smbios_write_type2(ulong *current, int handle,\n \treturn len;\n }\n \n-static int smbios_write_type3(ulong *current, int handle,\n+static int smbios_write_type3(ulong *current, int *handle,\n \t\t\t      struct smbios_ctx *ctx)\n {\n \tstruct smbios_type3 *t;\n@@ -548,7 +548,7 @@ static int smbios_write_type3(ulong *current, int handle,\n \n \tt = map_sysmem(*current, len);\n \tmemset(t, 0, len);\n-\tfill_smbios_header(t, SMBIOS_SYSTEM_ENCLOSURE, len, handle);\n+\tfill_smbios_header(t, SMBIOS_SYSTEM_ENCLOSURE, len, *handle);\n #if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLE_VERBOSE)\n \telem_addr = (u8 *)t + offsetof(struct smbios_type3, sku_number);\n \tsku_num_addr = elem_addr + elem_size;\n@@ -669,7 +669,7 @@ static void smbios_write_type4_dm(struct smbios_type4 *t,\n #endif\n }\n \n-static int smbios_write_type4(ulong *current, int handle,\n+static int smbios_write_type4(ulong *current, int *handle,\n \t\t\t      struct smbios_ctx *ctx)\n {\n \tstruct smbios_type4 *t;\n@@ -679,7 +679,7 @@ static int smbios_write_type4(ulong *current, int handle,\n \n \tt = map_sysmem(*current, len);\n \tmemset(t, 0, len);\n-\tfill_smbios_header(t, SMBIOS_PROCESSOR_INFORMATION, len, handle);\n+\tfill_smbios_header(t, SMBIOS_PROCESSOR_INFORMATION, len, *handle);\n \tsmbios_set_eos(ctx, t->eos);\n \tt->socket_design = smbios_add_prop_si(ctx, \"socket-design\",\n \t\t\t\t\t      SYSID_SM_PROCESSOR_SOCKET, NULL);\n@@ -828,13 +828,14 @@ static int smbios_write_type7_1level(ulong *current, int handle,\n \treturn len;\n }\n \n-static int smbios_write_type7(ulong *current, int handle,\n+static int smbios_write_type7(ulong *current, int *handle,\n \t\t\t      struct smbios_ctx *ctx)\n {\n \tint len = 0;\n \tint i, level;\n \tofnode parent = ctx->node;\n \tstruct smbios_ctx ctx_bak;\n+\tint hdl_base = *handle;\n \n \tmemcpy(&ctx_bak, ctx, sizeof(ctx_bak));\n \n@@ -850,15 +851,17 @@ static int smbios_write_type7(ulong *current, int handle,\n \t\t\treturn 0;\n \t\tctx->subnode_name = buf;\n \t\tctx->node = ofnode_find_subnode(parent, ctx->subnode_name);\n-\t\tlen += smbios_write_type7_1level(current, handle++, ctx, i);\n+\t\t*handle = hdl_base + i;\n+\t\tlen += smbios_write_type7_1level(current, *handle, ctx, i);\n \t\tmemcpy(ctx, &ctx_bak, sizeof(*ctx));\n \t}\n+\n \treturn len;\n }\n \n #endif /* #if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLE_VERBOSE) */\n \n-static int smbios_write_type32(ulong *current, int handle,\n+static int smbios_write_type32(ulong *current, int *handle,\n \t\t\t       struct smbios_ctx *ctx)\n {\n \tstruct smbios_type32 *t;\n@@ -866,7 +869,7 @@ static int smbios_write_type32(ulong *current, int handle,\n \n \tt = map_sysmem(*current, len);\n \tmemset(t, 0, len);\n-\tfill_smbios_header(t, SMBIOS_SYSTEM_BOOT_INFORMATION, len, handle);\n+\tfill_smbios_header(t, SMBIOS_SYSTEM_BOOT_INFORMATION, len, *handle);\n \tsmbios_set_eos(ctx, t->eos);\n \n \t*current += len;\n@@ -875,7 +878,7 @@ static int smbios_write_type32(ulong *current, int handle,\n \treturn len;\n }\n \n-static int smbios_write_type127(ulong *current, int handle,\n+static int smbios_write_type127(ulong *current, int *handle,\n \t\t\t\tstruct smbios_ctx *ctx)\n {\n \tstruct smbios_type127 *t;\n@@ -883,7 +886,7 @@ static int smbios_write_type127(ulong *current, int handle,\n \n \tt = map_sysmem(*current, len);\n \tmemset(t, 0, len);\n-\tfill_smbios_header(t, SMBIOS_END_OF_TABLE, len, handle);\n+\tfill_smbios_header(t, SMBIOS_END_OF_TABLE, len, *handle);\n \n \t*current += len;\n \tunmap_sysmem(t);\n@@ -954,7 +957,8 @@ ulong write_smbios_table(ulong addr)\n \t\t\t\tctx.node = ofnode_find_subnode(parent_node,\n \t\t\t\t\t\t\t       method->subnode_name);\n \t\t}\n-\t\tlen += method->write((ulong *)&addr, handle++, &ctx);\n+\t\tlen += method->write((ulong *)&addr, &handle, &ctx);\n+\t\thandle++;\n \t}\n \n \t/*\n",
    "prefixes": [
        "v5",
        "1/6"
    ]
}