get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217909,
    "url": "http://patchwork.ozlabs.org/api/patches/2217909/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260330220124.2747127-1-daniel@thingy.jp/",
    "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": "<20260330220124.2747127-1-daniel@thingy.jp>",
    "list_archive_url": null,
    "date": "2026-03-30T22:01:24",
    "name": "[v2] m68k: Add LTO support",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "132d3a057d95193cfb81a238e8d835b8b6e6f18f",
    "submitter": {
        "id": 85408,
        "url": "http://patchwork.ozlabs.org/api/people/85408/?format=api",
        "name": "Daniel Palmer",
        "email": "daniel@thingy.jp"
    },
    "delegate": {
        "id": 14103,
        "url": "http://patchwork.ozlabs.org/api/users/14103/?format=api",
        "username": "spectrum",
        "first_name": "Angelo",
        "last_name": "Dureghello",
        "email": "sysamfw@gmail.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260330220124.2747127-1-daniel@thingy.jp/mbox/",
    "series": [
        {
            "id": 498103,
            "url": "http://patchwork.ozlabs.org/api/series/498103/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=498103",
            "date": "2026-03-30T22:01:24",
            "name": "[v2] m68k: Add LTO support",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/498103/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217909/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217909/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=thingy.jp header.i=@thingy.jp header.a=rsa-sha256\n header.s=google header.b=RlVZwlnI;\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=none (p=none dis=none) header.from=thingy.jp",
            "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=thingy.jp header.i=@thingy.jp header.b=\"RlVZwlnI\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp",
            "phobos.denx.de; spf=pass smtp.mailfrom=daniel@0x0f.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 4fl4wF451Cz1y1q\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 09:01:49 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 704A88352B;\n\tTue, 31 Mar 2026 00:01:39 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 341A083CE3; Tue, 31 Mar 2026 00:01:38 +0200 (CEST)",
            "from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com\n [IPv6:2607:f8b0:4864:20::102e])\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 8B69280212\n for <u-boot@lists.denx.de>; Tue, 31 Mar 2026 00:01:34 +0200 (CEST)",
            "by mail-pj1-x102e.google.com with SMTP id\n 98e67ed59e1d1-35da8d037a5so602876a91.0\n for <u-boot@lists.denx.de>; Mon, 30 Mar 2026 15:01:34 -0700 (PDT)",
            "from kinako ([2400:2200:6b0:ddf0:675d:2610:7c9b:872f])\n by smtp.googlemail.com with ESMTPSA id\n 98e67ed59e1d1-35da9ef1b70sm3950740a91.16.2026.03.30.15.01.30\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 30 Mar 2026 15:01:32 -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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=thingy.jp; s=google; t=1774908093; x=1775512893; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=sT3+dgYjJQ/g+c3prJPPxCudB6Kw3CFizw1NngUSp5s=;\n b=RlVZwlnIdiipHrjQUsXFBpz5GZWqGlgIGLZ7JtJxi+MZp3UTyMUu1lyDqVbocPytWb\n hsiZc/42AGQuKamTXBf90y3Pk02atGhojyyI/UB81D+lMmvx7Tysho0WauzVRRJzt4Ik\n NKbAcQEy2j8tu9Jd6/cXDoYdZwIkuwe7XyUFk=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774908093; x=1775512893;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=sT3+dgYjJQ/g+c3prJPPxCudB6Kw3CFizw1NngUSp5s=;\n b=pwhECjBfVwgl8ekPMWOnmsA49lZgZzV5l/mcyYgtJohHXvYsKsHjNPjOivWfTr+u0f\n 8DxbEx7jVxVzD+T3K14k5I58EodHv/7/kWkJa6szNeY4/IeEsYl5l41K24ppaItbJBYw\n YzpFkDIUFc4MySWfDdXNk/lqNI0O25neJ9Wo0ZXAL0WCvoeO3V4GNvadGqg80uVXplLq\n XUHDyw7MxErDPYB6m47vxqyvsL7mynO7SeiBWKjbcqBTsn2VWZLStic3OG7P6oeJ1ohF\n Vva3kJhtw7c31+2yaOqnG7iTwYhRgW09XqeNWcjZyiHNHqAnXNANsyA5w63JdF//FWor\n mpSQ==",
        "X-Gm-Message-State": "AOJu0YxTxdxxJf72e3ee8EMKmwDaNqLZgKeOstwXcfuK9syhNHz+BXIh\n cxjf3xQonJ4+B1pEFnyP8MGl0sUYWIymi02xr20GNY+FjdtPxOZJHxL+1J9LJpk5xCzmWvPASI2\n 1xuyd",
        "X-Gm-Gg": "ATEYQzw+vj/w7ikGp5mRGw98Xm3nkIBdVqzfkp8W+N8U6wWPWmfOc7N8OCoR2ZOfF3u\n 4Ltqi/Po3lD3v/aFco6vXoYKxzR19z4XsEVmw/R0yNpT0KtAosZFRrAU9/lr+cF0k1QckWCP8sw\n /X2bMoQBJ7+fAFdPun12PxizayBpDWd42bZHP8fRZK3OGCXpJrT8ER+aVz8NhhWt5HahIDmKkB2\n NZMUu0W90Vx3JCdtoSVt/RIG9QWzbEqEBx/ermkWhuuDwrKItGuO0KczASECJ2o8TFdXpW0JhDx\n lsvsRkB+lxcdSDqhbHLg++9S3HcqgIYquQh3sbZqMXKMkZcUg/OJ4BfeqIah/TqdjUYaIkFZ8j7\n 9AaHNUTTCisyBglct1jbcTncFW65NSJf/tvxOdpyLr54zHccu8KdpWNisJ3t0mUW0tWulchXvT/\n MrIIE9Zv8Zm1TgpQ==",
        "X-Received": "by 2002:a17:90b:46:b0:35d:9c43:57fe with SMTP id\n 98e67ed59e1d1-35d9c435b02mr7274547a91.13.1774908092506;\n Mon, 30 Mar 2026 15:01:32 -0700 (PDT)",
        "From": "Daniel Palmer <daniel@thingy.jp>",
        "To": "visitorckw@gmail.com,\n\tangelo@kernel-space.org",
        "Cc": "u-boot@lists.denx.de,\n\tDaniel Palmer <daniel@thingy.jp>",
        "Subject": "[PATCH v2] m68k: Add LTO support",
        "Date": "Tue, 31 Mar 2026 07:01:24 +0900",
        "Message-ID": "<20260330220124.2747127-1-daniel@thingy.jp>",
        "X-Mailer": "git-send-email 2.51.0",
        "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": "Most m68k retro/homebrew machines will have limited flash/RAM\nso having LTO working would be nice.\n\nNot many changes are need really. Most of this is copy/paste\nfrom the ARM32 version.\n\nThe major change is that the direct register usage of d7 for gd\nneeds to be hidden so that when LTO passes over everything it\ndoesn't see multiple instances of d7.\n\nSigned-off-by: Daniel Palmer <daniel@thingy.jp>\n---\n arch/Kconfig                        |  1 +\n arch/m68k/config.mk                 |  8 ++++++--\n arch/m68k/cpu/m680x0/cpu.c          |  2 +-\n arch/m68k/include/asm/global_data.h | 19 +++++++++++++++++++\n arch/m68k/lib/ashldi3.c             |  6 ++++--\n arch/m68k/lib/lshrdi3.c             |  6 ++++--\n arch/m68k/lib/muldi3.c              |  4 +++-\n common/board_r.c                    |  4 ++--\n common/init/board_init.c            |  4 ++--\n 9 files changed, 42 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/arch/Kconfig b/arch/Kconfig\nindex 4af0da2485fb..488de442f557 100644\n--- a/arch/Kconfig\n+++ b/arch/Kconfig\n@@ -112,6 +112,7 @@ config ARM\n \n config M68K\n \tbool \"M68000 architecture\"\n+\tselect ARCH_SUPPORTS_LTO\n \tselect HAVE_PRIVATE_LIBGCC\n \tselect USE_PRIVATE_LIBGCC\n \tselect SYS_BOOT_GET_CMDLINE\ndiff --git a/arch/m68k/config.mk b/arch/m68k/config.mk\nindex 458953f97122..4d8c83b51cdb 100644\n--- a/arch/m68k/config.mk\n+++ b/arch/m68k/config.mk\n@@ -8,9 +8,13 @@ ifneq ($(CONFIG_M680x0),y)\n PLATFORM_CPPFLAGS += -fPIC\n endif\n KBUILD_LDFLAGS    += -n -pie\n-PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections\n PLATFORM_RELFLAGS += -ffixed-d7\n ifneq ($(CONFIG_M680x0),y)\n PLATFORM_RELFLAGS += -msep-data\n endif\n-LDFLAGS_FINAL     += --gc-sections -pie\n+LDFLAGS_FINAL     += -pie\n+\n+ifneq ($(LTO_ENABLE),y)\n+PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections\n+LDFLAGS_FINAL     += --gc-sections\n+endif\ndiff --git a/arch/m68k/cpu/m680x0/cpu.c b/arch/m68k/cpu/m680x0/cpu.c\nindex f60b932c7dd4..3f87076b8c3d 100644\n--- a/arch/m68k/cpu/m680x0/cpu.c\n+++ b/arch/m68k/cpu/m680x0/cpu.c\n@@ -24,7 +24,7 @@ void m68k_virt_init_reserve(ulong base)\n \tfor (i = 0; i < sizeof(*gd_ptr); i++)\n \t\tp[i] = 0;\n \n-\tgd = gd_ptr;\n+\tarch_setup_gd(gd);\n \n \tgd->malloc_base = base + sizeof(*gd_ptr);\n }\ndiff --git a/arch/m68k/include/asm/global_data.h b/arch/m68k/include/asm/global_data.h\nindex aea2ccabe083..9150ed4ab466 100644\n--- a/arch/m68k/include/asm/global_data.h\n+++ b/arch/m68k/include/asm/global_data.h\n@@ -32,6 +32,25 @@ struct arch_global_data {\n \n #include <asm-generic/global_data.h>\n \n+#if defined(LTO_ENABLE)\n+/* If LTO is enabled we have to hide d7 to avoid multiple symbol declarations */\n+#define DECLARE_GLOBAL_DATA_PTR\n+#define gd\tget_gd()\n+\n+static inline gd_t *get_gd(void)\n+{\n+\tgd_t *gd_ptr;\n+\n+\t__asm__ volatile(\"move.l %%d7, %0\\n\" : \"=r\" (gd_ptr));\n+\n+\treturn gd_ptr;\n+}\n+#else\n #define DECLARE_GLOBAL_DATA_PTR     register gd_t *gd asm (\"d7\")\n+#endif\n+static inline void arch_setup_gd(gd_t *new_gd)\n+{\n+\t__asm__ volatile(\"move.l %0, %%d7\\n\" : : \"r\" (new_gd));\n+}\n \n #endif /* __ASM_GBL_DATA_H */\ndiff --git a/arch/m68k/lib/ashldi3.c b/arch/m68k/lib/ashldi3.c\nindex 9a4bc676bf4c..9e84bd0d9a07 100644\n--- a/arch/m68k/lib/ashldi3.c\n+++ b/arch/m68k/lib/ashldi3.c\n@@ -6,6 +6,8 @@\n  * Copyright (C) 1989-2015 Free Software Foundation, Inc.\n  */\n \n+#include <linux/compiler_attributes.h>\n+\n #define BITS_PER_UNIT 8\n \n typedef\t\t int SItype\t__attribute__ ((mode (SI)));\n@@ -21,7 +23,7 @@ typedef union\n   DItype ll;\n } DIunion;\n \n-DItype __ashldi3 (DItype u, word_type b)\n+__used DItype __ashldi3 (DItype u, word_type b)\n {\n \tDIunion w;\n \tword_type bm;\n@@ -46,4 +48,4 @@ DItype __ashldi3 (DItype u, word_type b)\n \t}\n \n \treturn w.ll;\n-}\n\\ No newline at end of file\n+}\ndiff --git a/arch/m68k/lib/lshrdi3.c b/arch/m68k/lib/lshrdi3.c\nindex e639e676a269..53163bc5f83f 100644\n--- a/arch/m68k/lib/lshrdi3.c\n+++ b/arch/m68k/lib/lshrdi3.c\n@@ -6,6 +6,8 @@\n  * Copyright (C) 1989-2015 Free Software Foundation, Inc.\n  */\n \n+#include <linux/compiler_attributes.h>\n+\n #define BITS_PER_UNIT 8\n \n typedef\t\t int SItype\t__attribute__ ((mode (SI)));\n@@ -21,7 +23,7 @@ typedef union\n   DItype ll;\n } DIunion;\n \n-DItype __lshrdi3 (DItype u, word_type b)\n+__used DItype __lshrdi3 (DItype u, word_type b)\n {\n \tDIunion w;\n \tword_type bm;\n@@ -46,4 +48,4 @@ DItype __lshrdi3 (DItype u, word_type b)\n \t}\n \n \treturn w.ll;\n-}\n\\ No newline at end of file\n+}\ndiff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c\nindex c42ca1d753e5..06af5533fde3 100644\n--- a/arch/m68k/lib/muldi3.c\n+++ b/arch/m68k/lib/muldi3.c\n@@ -6,6 +6,8 @@\n  * Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.\n  */\n \n+#include <linux/compiler_attributes.h>\n+\n #define SI_TYPE_SIZE 32\n #define __BITS4 (SI_TYPE_SIZE / 4)\n #define __ll_B (1L << (SI_TYPE_SIZE / 2))\n@@ -54,7 +56,7 @@ typedef union\n \tDItype ll;\n } DIunion;\n \n-DItype __muldi3 (DItype u, DItype v)\n+__used DItype __muldi3 (DItype u, DItype v)\n {\n \tDIunion w;\n \tDIunion uu, vv;\ndiff --git a/common/board_r.c b/common/board_r.c\nindex 76f9fc090fbe..58eb69005468 100644\n--- a/common/board_r.c\n+++ b/common/board_r.c\n@@ -800,12 +800,12 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)\n \t * TODO(sjg@chromium.org): Consider doing this for all archs, or\n \t * dropping the new_gd parameter.\n \t */\n-\tif (CONFIG_IS_ENABLED(X86_64) && !IS_ENABLED(CONFIG_EFI_APP))\n+\tif ((CONFIG_IS_ENABLED(X86_64) && !IS_ENABLED(CONFIG_EFI_APP)) || CONFIG_IS_ENABLED(M68K))\n \t\tarch_setup_gd(new_gd);\n \n #if defined(CONFIG_RISCV)\n \tset_gd(new_gd);\n-#elif !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_ARM64)\n+#elif !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_ARM64) && !defined(CONFIG_M68K)\n \tgd = new_gd;\n #endif\n \tgd->flags &= ~GD_FLG_LOG_READY;\ndiff --git a/common/init/board_init.c b/common/init/board_init.c\nindex 2a6f39f51adb..31b499ebad9c 100644\n--- a/common/init/board_init.c\n+++ b/common/init/board_init.c\n@@ -14,10 +14,10 @@\n DECLARE_GLOBAL_DATA_PTR;\n \n /*\n- * Unfortunately x86, ARM and RISC-V can't compile this code as gd is defined\n+ * Unfortunately x86, ARM, RISC-V, M68K can't compile this code as gd is defined\n  * as macro and cannot be assigned.\n  */\n-#if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_RISCV)\n+#if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_RISCV) && !defined(CONFIG_M68K)\n __weak void arch_setup_gd(struct global_data *gd_ptr)\n {\n \tgd = gd_ptr;\n",
    "prefixes": [
        "v2"
    ]
}