get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2222765,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2222765/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260413152526.153605-2-gregor.herburger@linutronix.de/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260413152526.153605-2-gregor.herburger@linutronix.de>",
    "list_archive_url": null,
    "date": "2026-04-13T15:24:54",
    "name": "[v4,2/2] cli: flush stdin before enabling cli",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "fb2ed0bcad9484ba6bdd4c76a3af0f19a33c7e85",
    "submitter": {
        "id": 93018,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/93018/?format=api",
        "name": "Gregor Herburger",
        "email": "gregor.herburger@linutronix.de"
    },
    "delegate": {
        "id": 3651,
        "url": "http://patchwork.ozlabs.org/api/1.2/users/3651/?format=api",
        "username": "trini",
        "first_name": "Tom",
        "last_name": "Rini",
        "email": "trini@ti.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260413152526.153605-2-gregor.herburger@linutronix.de/mbox/",
    "series": [
        {
            "id": 499722,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/499722/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=499722",
            "date": "2026-04-13T15:24:53",
            "name": "[v4,1/2] console: add console_flush_stdin()",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/499722/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2222765/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2222765/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 secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256\n header.s=2020 header.b=VImv68iF;\n\tdkim=pass header.d=linutronix.de header.i=@linutronix.de\n header.a=ed25519-sha256 header.s=2020e header.b=9VpB7Gnd;\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=none dis=none) header.from=linutronix.de",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n secure) header.d=linutronix.de header.i=@linutronix.de header.b=\"VImv68iF\";\n\tdkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de\n header.b=\"9VpB7Gnd\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linutronix.de",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=gregor.herburger@linutronix.de"
        ],
        "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 4fvWT96qDmz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 01:26:05 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id C02C4841BE;\n\tMon, 13 Apr 2026 17:26:03 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 9470484198; Mon, 13 Apr 2026 17:25:57 +0200 (CEST)",
            "from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])\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 A7F9E841CD\n for <u-boot@lists.denx.de>; Mon, 13 Apr 2026 17:25:54 +0200 (CEST)"
        ],
        "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,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "From": "Gregor Herburger <gregor.herburger@linutronix.de>",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;\n s=2020; t=1776093954;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=z3XnIE6ZKWle+h529DSwEdbUCC7FPfDs4YbGL/zetfQ=;\n b=VImv68iFcQsjO0Y4kPdIM2Dpsi0DOohQ9+zfmQQ8L15hr0T06Adll5n/kjvcb49ZO6Vw3i\n 2Tw+jrs9xIU+5Tskcw5xmcmB16n6Pl1HtN8nwm96KuWW2iS9SWXodxMYl20GBpJN6qKDLg\n gdkj5UooiQdL86zx43gViRrfT2Ztj/edPpazo2GVP8y8lQPEKrYHX3vR+R8QpWNx045iJa\n EmOnFqpwSWL37yir1JlfXAOJpJp4fMzmb9ZDnEGbGtx1zmDykFaoEPPkW43AkUNDoT8r1n\n zmNSYn8ZWwja+ddr+Swr4txnaUKWNLKLmQAE5i9r5VNiK302BkpmLLgAklpL2w==",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;\n s=2020e; t=1776093954;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=z3XnIE6ZKWle+h529DSwEdbUCC7FPfDs4YbGL/zetfQ=;\n b=9VpB7GndZbyKyhTfWCZcmy2ClK6D8HEmEXbyiRME77py3F7cspMj5PyFBVqm9O+ei34Pvd\n PQ/Yq3TmrlIdc8CQ=="
        ],
        "To": "u-boot@lists.denx.de,\n\tQuentin Schulz <quentin.schulz@cherry.de>",
        "Cc": "Gregor Herburger <gregor.herburger@linutronix.de>,\n Simon Glass <sjg@chromium.org>,\n Andrew Goodbody <andrew.goodbody@linaro.org>,\n Heiko Schocher <hs@nabladev.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Jerome Forissier <jerome.forissier@arm.com>,\n \"Kory Maincent (TI.com)\" <kory.maincent@bootlin.com>,\n Mattijs Korpershoek <mkorpershoek@kernel.org>,\n Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,\n Tom Rini <trini@konsulko.com>",
        "Subject": "[PATCH v4 2/2] cli: flush stdin before enabling cli",
        "Date": "Mon, 13 Apr 2026 17:24:54 +0200",
        "Message-ID": "<20260413152526.153605-2-gregor.herburger@linutronix.de>",
        "In-Reply-To": "<20260413152526.153605-1-gregor.herburger@linutronix.de>",
        "References": "<20260413152526.153605-1-gregor.herburger@linutronix.de>",
        "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": "Currently there is no possibility to flush stdin after autocommands are\nexecuted. If in the bootcmd the stdin is changed, e.g. from nulldev to\nserial, it could happen that junk characters sit in the fifo and appear\non the cli.\n\nAdd a option to clear stdin before starting the CLI.\n\nSigned-off-by: Gregor Herburger <gregor.herburger@linutronix.de>\nReviewed-by: Simon Glass <sjg@chromium.org>\n\n---\n\nChanges in v4:\n- Collect tags\n\nChanges in v3:\n- Update helptext\n\nChanges in v2:\n- add a common console_flush_stdin to console.c\n- replace all caller of while(getchar()) with function call\n\n cmd/Kconfig  | 8 ++++++++\n common/cli.c | 4 ++++\n 2 files changed, 12 insertions(+)",
    "diff": "diff --git a/cmd/Kconfig b/cmd/Kconfig\nindex 7bbeaad04ff..33a7952c9b8 100644\n--- a/cmd/Kconfig\n+++ b/cmd/Kconfig\n@@ -47,6 +47,14 @@ config HUSH_SELECTABLE\n \tdefault y if HUSH_OLD_PARSER && HUSH_MODERN_PARSER\n endmenu\n \n+config CMDLINE_FLUSH_STDIN\n+\tbool \"Enable flushing input before starting cli\"\n+\thelp\n+\t  When this option is enabled the stdin buffer will be flushed before\n+\t  starting the CLI. This is useful when stdin is changed during boot\n+\t  (e.g. from nulldev to serial) and junk characters may be pending\n+\t  in the buffer.\n+\n config CMDLINE_EDITING\n \tbool \"Enable command line editing\"\n \tdefault y\ndiff --git a/common/cli.c b/common/cli.c\nindex 4694a35cd0e..bcc7264d51a 100644\n--- a/common/cli.c\n+++ b/common/cli.c\n@@ -295,6 +295,10 @@ err:\n void cli_loop(void)\n {\n \tbootstage_mark(BOOTSTAGE_ID_ENTER_CLI_LOOP);\n+\n+\tif (IS_ENABLED(CONFIG_CMDLINE_FLUSH_STDIN))\n+\t\tconsole_flush_stdin();\n+\n #if CONFIG_IS_ENABLED(HUSH_PARSER)\n \tif (gd->flags & GD_FLG_HUSH_MODERN_PARSER)\n \t\tparse_and_run_file();\n",
    "prefixes": [
        "v4",
        "2/2"
    ]
}