get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2222220,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2222220/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/87ik9yzg9g.ffs@tglx/",
    "project": {
        "id": 8,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/8/?format=api",
        "name": "Linux ext4 filesystem development",
        "link_name": "linux-ext4",
        "list_id": "linux-ext4.vger.kernel.org",
        "list_email": "linux-ext4@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<87ik9yzg9g.ffs@tglx>",
    "date": "2026-04-10T20:56:11",
    "name": "[V1.1,11/38] misc: sgi-gru: Remove get_cycles() [ab]use",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a8da5805f98eea1ab3b68b8d57715dc93c5e1333",
    "submitter": {
        "id": 92397,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92397/?format=api",
        "name": "Thomas Gleixner",
        "email": "tglx@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/87ik9yzg9g.ffs@tglx/mbox/",
    "series": [
        {
            "id": 499511,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499511/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=499511",
            "date": "2026-04-10T20:56:11",
            "name": null,
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499511/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2222220/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2222220/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <SRS0=3gYh=CJ=vger.kernel.org=linux-ext4+bounces-15795-patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-ext4@vger.kernel.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "patchwork-incoming@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=GQ142PFW;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=150.107.74.76; helo=mail.ozlabs.org;\n envelope-from=srs0=3gyh=cj=vger.kernel.org=linux-ext4+bounces-15795-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c0a:e001:db::12fc:5321\"\n arc.chain=subspace.kernel.org",
            "gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org",
            "gandalf.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=GQ142PFW;\n\tdkim-atps=neutral",
            "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15795-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"GQ142PFW\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fspzy0d5Cz1yGb\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 06:58:22 +1000 (AEST)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fspzy0KW3z4wTb\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 06:58:22 +1000 (AEST)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4fspzy0GGqz4wCm; Sat, 11 Apr 2026 06:58:22 +1000 (AEST)",
            "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\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 gandalf.ozlabs.org (Postfix) with ESMTPS id 4fspzt4Vslz4wTb\n\tfor <patchwork-incoming@ozlabs.org>; Sat, 11 Apr 2026 06:58:18 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id D8E8A3011C60\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 10 Apr 2026 20:56:20 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6EF433A7589;\n\tFri, 10 Apr 2026 20:56:17 +0000 (UTC)",
            "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EDCA3644D4;\n\tFri, 10 Apr 2026 20:56:16 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id E2163C19421;\n\tFri, 10 Apr 2026 20:56:13 +0000 (UTC)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1775854702; cv=pass;\n\tb=vLqKqzOA1CLvRXL7kWbgA7suTLWlZOhqvhVfzC/5eGkd8IRxS91BK/hNao/ExuxD1kpYnjGdIVXPiEehsRKoWTZrDf+i1bm7EW92nqWiE0LloNamZgQ2UoV5DPJrbQk8IOtDezCTPlihLGSwFbfXP+YCjEHhaUbF7WWlao4i1dO1sKzY4Nh5yx3/5a+4BBWYKzrk2XRzUXVUIk3FtycNUzmNfBjuynwCQIRvMhNsLJ/bUG5GwmzzonFUxeoxhP3Fyb9HjcKt7wjuXy5Om/3BO3qBGESmSkjMK5o8M3yFv4UpzjulGwKdRcIoYXITE+D+AxV3OclVEl6GhUxKL2tXqA==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775854577; cv=none;\n b=bH7jc7dVXytGRnYXnh6WVrHbdsIUn4R8xe0iaJ44jH1+rjLc8a/Ixv8fHtRp16zTTbZB4AdPzfUZg5TvmwzB7Mj6pyjDiyFfnvMgIJwYSaYpA5YYJYmlRA6pgmGu5PF0hX5flRhx4wohLDI9uBH5Si2BKnF0zxvXT/SalN+7mEo="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1775854702; c=relaxed/relaxed;\n\tbh=C2X9IdtUnrT50yiykczKjUwFjhJemy6Dkqp8i9B0154=;\n\th=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:\n\t MIME-Version:Content-Type;\n b=AZEYBJUOMQHAAz3kvR92tB1dDvZxKvd5PhaP2c30Ypy6cosqhvpkqU+1lY2I5eUiDAuSmOC0cENAXIs8ScwSurD+09BK8mJsT+jA+gSKJ7Jb+NhT0Cx+zLWdZstS8qYXIeD/OmM0+Rl7iU9UMu490KzuqlqP4MZjNOWerH+yfUjzktv0HVeTKZSGdd0PJYV8fYL7+sL/0EPZ6/jCHghCb4deq6ltd96hGd0zw4xGEiI1vsDjhN6UYieRHM5GfqHFxpQmOQ9XUmIG8GzyWKIbP5hacW2OhIrw/dqHVakglby//H4ojV+0Diyk68I6DcfLLfL929UqUhCTVITkClDh1g==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775854577; c=relaxed/simple;\n\tbh=Pl/TPuj3MEjAUAkiR6iNGQuG7vTK4etd1CQHextbc1Q=;\n\th=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:\n\t MIME-Version:Content-Type;\n b=snYqKMd6ugFPpv8gls2Q/sbKonkUybU3qcbylL0/pn7+OFvJwwrz+MrVvlCatzSPX86y3bVLHTwb3WVhyN7wuFfPHaBCOwkwskmmNg01qFSZn7H9en1cZnJZ4Lmn7hXgaiQGlgb/xoMbPoa2OnRA3PNpH8bk23qysvpy5GP0KoM="
        ],
        "ARC-Authentication-Results": [
            "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=GQ142PFW; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15795-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org",
            "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=GQ142PFW; arc=none smtp.client-ip=10.30.226.201"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775854576;\n\tbh=Pl/TPuj3MEjAUAkiR6iNGQuG7vTK4etd1CQHextbc1Q=;\n\th=From:To:Cc:Subject:In-Reply-To:References:Date:From;\n\tb=GQ142PFWFm6CPGgxzIstxv+Opw0b8SXuQ9OyBP6RDGrB9wMYrgGJRlAIcXmjiMiJQ\n\t uvHLzYRX996/8mwPCxIT6HNprAxZjHfiZYVGdKL2zkx4tDdEJ1Qjhj23YsuYeVWZUk\n\t qB897HhG8G4RkSYw8g0MDIEY8t5mxlaTJQ0hQJRlVPLc72Bfpv47WYQcen6mmTC6UB\n\t IDYz08Lq5Ox+catFPgX2TnERo0NsyMmc6D+DEo5bfEi3Zb8CozxsaaIUnftUYBffz4\n\t eRJ2pErWPmB+XVojMvRq9gH2C+KSLENGTN6u78aH1Po3BWHW2gKcN/A+CamqsNtu9t\n\t mhyolj1ID3OUA==",
        "From": "Thomas Gleixner <tglx@kernel.org>",
        "To": "LKML <linux-kernel@vger.kernel.org>",
        "Cc": "Arnd Bergmann <arnd@arndb.de>, x86@kernel.org, Lu Baolu\n <baolu.lu@linux.intel.com>, iommu@lists.linux.dev, Michael Grzeschik\n <m.grzeschik@pengutronix.de>, netdev@vger.kernel.org,\n linux-wireless@vger.kernel.org, Herbert Xu <herbert@gondor.apana.org.au>,\n linux-crypto@vger.kernel.org, Vlastimil Babka <vbabka@kernel.org>,\n linux-mm@kvack.org, David Woodhouse <dwmw2@infradead.org>, Bernie Thompson\n <bernie@plugable.com>, linux-fbdev@vger.kernel.org, Theodore Tso\n <tytso@mit.edu>, linux-ext4@vger.kernel.org, Andrew Morton\n <akpm@linux-foundation.org>, Uladzislau Rezki <urezki@gmail.com>, Marco\n Elver <elver@google.com>, Dmitry Vyukov <dvyukov@google.com>,\n kasan-dev@googlegroups.com, Andrey Ryabinin <ryabinin.a.a@gmail.com>,\n Thomas Sailer <t.sailer@alumni.ethz.ch>, linux-hams@vger.kernel.org,\n \"Jason A. Donenfeld\" <Jason@zx2c4.com>, Richard Henderson\n <richard.henderson@linaro.org>, linux-alpha@vger.kernel.org, Russell King\n <linux@armlinux.org.uk>, linux-arm-kernel@lists.infradead.org, Catalin\n Marinas <catalin.marinas@arm.com>, Huacai Chen <chenhuacai@kernel.org>,\n loongarch@lists.linux.dev, Geert Uytterhoeven <geert@linux-m68k.org>,\n linux-m68k@lists.linux-m68k.org, Dinh Nguyen <dinguyen@kernel.org>, Jonas\n Bonn <jonas@southpole.se>, linux-openrisc@vger.kernel.org, Helge Deller\n <deller@gmx.de>, linux-parisc@vger.kernel.org, Michael Ellerman\n <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org, Paul Walmsley\n <pjw@kernel.org>, linux-riscv@lists.infradead.org, Heiko Carstens\n <hca@linux.ibm.com>, linux-s390@vger.kernel.org, \"David S. Miller\"\n <davem@davemloft.net>, sparclinux@vger.kernel.org",
        "Subject": "[patch V1.1 11/38] misc: sgi-gru: Remove get_cycles() [ab]use",
        "In-Reply-To": "<20260410120318.320727701@kernel.org>",
        "References": "<20260410120044.031381086@kernel.org>\n <20260410120318.320727701@kernel.org>",
        "Date": "Fri, 10 Apr 2026 22:56:11 +0200",
        "Message-ID": "<87ik9yzg9g.ffs@tglx>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-ext4@vger.kernel.org",
        "List-Id": "<linux-ext4.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-ext4+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-ext4+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"
    },
    "content": "Calculating a timeout from get_cycles() is a historical leftover without\nany functional requirement.\n\nUse ktime_get() instead.\n\nSigned-off-by: Thomas Gleixner <tglx@kernel.org>\n---\nV2: Fix typo\n---\n drivers/misc/sgi-gru/gruhandles.c   |   20 ++++++++------------\n drivers/misc/sgi-gru/grukservices.c |    3 ++-\n drivers/misc/sgi-gru/grutlbpurge.c  |    5 ++---\n 3 files changed, 12 insertions(+), 16 deletions(-)",
    "diff": "--- a/drivers/misc/sgi-gru/gruhandles.c\n+++ b/drivers/misc/sgi-gru/gruhandles.c\n@@ -6,26 +6,22 @@\n  */\n \n #include <linux/kernel.h>\n+#include <linux/timekeeping.h>\n #include \"gru.h\"\n #include \"grulib.h\"\n #include \"grutables.h\"\n \n-/* 10 sec */\n #include <linux/sync_core.h>\n-#include <asm/tsc.h>\n-#define GRU_OPERATION_TIMEOUT\t((cycles_t) tsc_khz*10*1000)\n-#define CLKS2NSEC(c)\t\t((c) * 1000000 / tsc_khz)\n+\n+#define GRU_OPERATION_TIMEOUT_NSEC\t(((ktime_t)10 * NSEC_PER_SEC))\n \n /* Extract the status field from a kernel handle */\n #define GET_MSEG_HANDLE_STATUS(h)\t(((*(unsigned long *)(h)) >> 16) & 3)\n \n struct mcs_op_statistic mcs_op_statistics[mcsop_last];\n \n-static void update_mcs_stats(enum mcs_op op, unsigned long clks)\n+static void update_mcs_stats(enum mcs_op op, unsigned long nsec)\n {\n-\tunsigned long nsec;\n-\n-\tnsec = CLKS2NSEC(clks);\n \tatomic_long_inc(&mcs_op_statistics[op].count);\n \tatomic_long_add(nsec, &mcs_op_statistics[op].total);\n \tif (mcs_op_statistics[op].max < nsec)\n@@ -58,21 +54,21 @@ static void report_instruction_timeout(v\n \n static int wait_instruction_complete(void *h, enum mcs_op opc)\n {\n+\tktime_t start_time = ktime_get();\n \tint status;\n-\tunsigned long start_time = get_cycles();\n \n \twhile (1) {\n \t\tcpu_relax();\n \t\tstatus = GET_MSEG_HANDLE_STATUS(h);\n \t\tif (status != CCHSTATUS_ACTIVE)\n \t\t\tbreak;\n-\t\tif (GRU_OPERATION_TIMEOUT < (get_cycles() - start_time)) {\n+\t\tif (GRU_OPERATION_TIMEOUT_NSEC < (ktime_get() - start_time)) {\n \t\t\treport_instruction_timeout(h);\n-\t\t\tstart_time = get_cycles();\n+\t\t\tstart_time = ktime_get();\n \t\t}\n \t}\n \tif (gru_options & OPT_STATS)\n-\t\tupdate_mcs_stats(opc, get_cycles() - start_time);\n+\t\tupdate_mcs_stats(opc, (unsigned long)(ktime_get() - start_time));\n \treturn status;\n }\n \n--- a/drivers/misc/sgi-gru/grukservices.c\n+++ b/drivers/misc/sgi-gru/grukservices.c\n@@ -20,6 +20,7 @@\n #include <linux/uaccess.h>\n #include <linux/delay.h>\n #include <linux/export.h>\n+#include <linux/random.h>\n #include <asm/io_apic.h>\n #include \"gru.h\"\n #include \"grulib.h\"\n@@ -1106,7 +1107,7 @@ static int quicktest3(unsigned long arg)\n \tint ret = 0;\n \n \tmemset(buf2, 0, sizeof(buf2));\n-\tmemset(buf1, get_cycles() & 255, sizeof(buf1));\n+\tmemset(buf1, get_random_u32() & 255, sizeof(buf1));\n \tgru_copy_gpa(uv_gpa(buf2), uv_gpa(buf1), BUFSIZE);\n \tif (memcmp(buf1, buf2, BUFSIZE)) {\n \t\tprintk(KERN_DEBUG \"GRU:%d quicktest3 error\\n\", smp_processor_id());\n--- a/drivers/misc/sgi-gru/grutlbpurge.c\n+++ b/drivers/misc/sgi-gru/grutlbpurge.c\n@@ -22,13 +22,12 @@\n #include <linux/delay.h>\n #include <linux/timex.h>\n #include <linux/srcu.h>\n+#include <linux/random.h>\n #include <asm/processor.h>\n #include \"gru.h\"\n #include \"grutables.h\"\n #include <asm/uv/uv_hub.h>\n \n-#define gru_random()\tget_cycles()\n-\n /* ---------------------------------- TLB Invalidation functions --------\n  * get_tgh_handle\n  *\n@@ -49,7 +48,7 @@ static inline int get_off_blade_tgh(stru\n \tint n;\n \n \tn = GRU_NUM_TGH - gru->gs_tgh_first_remote;\n-\tn = gru_random() % n;\n+\tn = get_random_u32() % n;\n \tn += gru->gs_tgh_first_remote;\n \treturn n;\n }\n",
    "prefixes": [
        "V1.1",
        "11/38"
    ]
}