get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2194968,
    "url": "http://patchwork.ozlabs.org/api/patches/2194968/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260210101702.3980804-1-peter.maydell@linaro.org/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260210101702.3980804-1-peter.maydell@linaro.org>",
    "list_archive_url": null,
    "date": "2026-02-10T10:17:02",
    "name": "hw/char/pl011: Only log \"data written to disabled UART\" once",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "275c43ccfd80aff96d369162785427579e7882f1",
    "submitter": {
        "id": 5111,
        "url": "http://patchwork.ozlabs.org/api/people/5111/?format=api",
        "name": "Peter Maydell",
        "email": "peter.maydell@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260210101702.3980804-1-peter.maydell@linaro.org/mbox/",
    "series": [
        {
            "id": 491642,
            "url": "http://patchwork.ozlabs.org/api/series/491642/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491642",
            "date": "2026-02-10T10:17:02",
            "name": "hw/char/pl011: Only log \"data written to disabled UART\" once",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/491642/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2194968/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2194968/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "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=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=Q1a7qSzH;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4f9HZC3RWGz1xvb\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 21:17:55 +1100 (AEDT)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vpknu-0001Ag-UH; Tue, 10 Feb 2026 05:17:10 -0500",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1vpknr-0001AH-Ef\n for qemu-devel@nongnu.org; Tue, 10 Feb 2026 05:17:08 -0500",
            "from mail-wm1-x329.google.com ([2a00:1450:4864:20::329])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1vpknp-0002JJ-Pg\n for qemu-devel@nongnu.org; Tue, 10 Feb 2026 05:17:07 -0500",
            "by mail-wm1-x329.google.com with SMTP id\n 5b1f17b1804b1-4806cc07ce7so6094965e9.1\n for <qemu-devel@nongnu.org>; Tue, 10 Feb 2026 02:17:05 -0800 (PST)",
            "from lanath.. (wildly.archaic.org.uk. [81.2.115.145])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-48320410b78sm176406295e9.2.2026.02.10.02.17.02\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 10 Feb 2026 02:17:03 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1770718624; x=1771323424; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:from:to:cc:subject:date:message-id:reply-to;\n bh=IwbOHvrrzpGMbGAUKbGftHqrOlOGZFCWb0ibIgC3XdQ=;\n b=Q1a7qSzHehl0f53aDZy0M6XlbNEPp39IPzHTj1EfQxiGi6PIN8mBfUvRIL8ysEEvyP\n 80xLr/JuruJYv/GNv8l/KcI28VQ6gGLNZcEWDW7yFw8VEV92r/LpIrNsebf/G94zQzBF\n j9YcUY5zCyaA/SQDpY5vgP4trOtDaQE68cbBB1wjG0DXcUjImH0lrwEBR97WQflegDya\n JmYSzahD9TxFdQIFQK5nrP7tn7GEjqHKAmSt/Vcp2lmlSdnBSCGLKnICqKVVk2aGQkjw\n Rkp0WKfj+FrpXgTIMRN2jwELQCFOf3i2wf30M8JH1llRERIBjQ4oRJnyLy0AfzJp+TrJ\n 8Qcg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770718624; x=1771323424;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=IwbOHvrrzpGMbGAUKbGftHqrOlOGZFCWb0ibIgC3XdQ=;\n b=qpx37qxqJZmh0bcHrCjKi5ViGd/NnyIDWeJqj1t77pizuW6KYDaYZ1cIvQVewyub2b\n TMG7M4TGBScNHEwnZhvob+/IjJkdBoYAXWUo6rJT41nSVmI+tHV2xBVJ1nm51H5xzTVe\n j2qDmgz2BSmoOX72wmFp2nr1P2ssTTpWt3y3jkOYvHrAzr/MRj3n0G+BpfEby//GrrHL\n q+N7efOQUBgOpTTUPlmND73LfUz7gx7Np2JvzYnS2Yrw31EmUL3vliDBESsH3blHOa4+\n QYhd2bmksnXv1E3Jq3aYkakW2S9+BUCvOJmN+r3GY8EoH9LCYEJdTD2Xnlt9skt4GloL\n Etqg==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCXCVBvw2J5XaT6+AyiCn4IiSBLeu+11bSg4EB9obCjvj95bqoY9rZr7mprgJx4De1PQGcOxAjsk3l1u@nongnu.org",
        "X-Gm-Message-State": "AOJu0Yyfdy4nxODTC8P2IA4gNOAOQx5iOGyYekqdkPogTyV0dpceiZhx\n Sj9eZuk97qna+oSTOuYF2pYgWiDo6qM6fDNhUIFLrO5hUvow9iZ2cW09P4g3Z/tb9ROLd2sT+56\n kavf8",
        "X-Gm-Gg": "AZuq6aKVPD0WF7vIZT0gm6QE6bFDFR4Q6HFZ3eet3C7QADVaUp/klazzLZdgOGY0L+A\n e8NpemOpeJ7cNsKc30+DnCceQqAD21uz0kBllZpOdSzSobGhdOGqEq0yoilvSNhly+ZSTAvwivz\n 0mxfAjH/5DIXlNg/drDBn+5LoNGFmSWVGb9sK2cp3m7lD7PJZVMX28IqcCwSGJHM0DnL1eQEhX5\n rnietEElaaUgGe87ksglO9GGFBHZ2i2dX2WZrlPAy1GrtY+tME3qsZdgk1FZ73a3w9q63kX15a5\n wqM/eANfoRdzxV3j4Mo28N4BRLxDudCFxUkaE3jp3wwXPFZD0Iz3hb4ZOsWC/dy4ExVYFuQLoA2\n 682jgyQ2XVwV1MmcWpvMEPYc8S3b9ThzoSnNHiAcyb35swl4/pOnTa91mOAqWAH1e1Y+ldO4AUH\n FIHWNa2XFMYXL0Qs3LxpFBD7yZcm0TRd2zr5SjdHGRle5SaxAeD+e5x+xgHCjshoQ4UFiLd30Nj\n g/Xk1VsTbaZa953ovSToz5HwZextUIx+PsPzgXq2Q==",
        "X-Received": "by 2002:a05:600c:c05a:b0:483:456a:514b with SMTP id\n 5b1f17b1804b1-483456a51dbmr58762355e9.12.1770718623878;\n Tue, 10 Feb 2026 02:17:03 -0800 (PST)",
        "From": "Peter Maydell <peter.maydell@linaro.org>",
        "To": "qemu-arm@nongnu.org,\n\tqemu-devel@nongnu.org",
        "Subject": "[PATCH] hw/char/pl011: Only log \"data written to disabled UART\" once",
        "Date": "Tue, 10 Feb 2026 10:17:02 +0000",
        "Message-ID": "<20260210101702.3980804-1-peter.maydell@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2a00:1450:4864:20::329;\n envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "We log a GUEST_ERROR message \"PL011 data written to disabled UART\" if\nthe guest writes data to the TX FIFO when it has not set the enable\nbit in the UART.  The idea is to note that the guest has done\nsomething dubious but let it work anyway.  However, since we print\nthis message for every output character, it floods the logs when\nrunning a guest that does this.\n\nKeep a note of whether we've printed the log message or not, so we\nonly output it once.  If the guest actively disables the UART, we\nre-arm the log message.\n\nNotably, the Linux kernel does not bother to enable the UART if it is\nused for earlycon, relying on the firmware having already done that.\n\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\n---\nThe log messages here were getting in my way trying to debug something\nelse, but I didn't want to just delete them completely.\n\n hw/char/pl011.c         | 24 ++++++++++++++++++++++--\n include/hw/char/pl011.h |  1 +\n 2 files changed, 23 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/hw/char/pl011.c b/hw/char/pl011.c\nindex b2ca68e3e8..cb12c3e224 100644\n--- a/hw/char/pl011.c\n+++ b/hw/char/pl011.c\n@@ -227,10 +227,25 @@ static void pl011_loopback_tx(PL011State *s, uint32_t value)\n static void pl011_write_txdata(PL011State *s, uint8_t data)\n {\n     if (!(s->cr & CR_UARTEN)) {\n-        qemu_log_mask(LOG_GUEST_ERROR,\n-                      \"PL011 data written to disabled UART\\n\");\n+        /*\n+         * Only log this message once, not every time the guest outputs:\n+         * otherwise we would flood the logs with this message, making\n+         * harder to debug guests. (Some very popular guests like Linux\n+         * don't actively enable the UART.)\n+         */\n+        if (!s->logged_disabled_uart) {\n+            qemu_log_mask(LOG_GUEST_ERROR,\n+                          \"PL011 data written to disabled UART\\n\");\n+            s->logged_disabled_uart = true;\n+        }\n     }\n     if (!(s->cr & CR_TXE)) {\n+        /*\n+         * We don't bother with the only-log-once machinery for this check\n+         * because TXE is enabled by default from PL011 reset, so there\n+         * isn't likely to be existing in-the-wild guest code that trips\n+         * over this one.\n+         */\n         qemu_log_mask(LOG_GUEST_ERROR,\n                       \"PL011 data written to disabled TX UART\\n\");\n     }\n@@ -457,6 +472,10 @@ static void pl011_write(void *opaque, hwaddr offset,\n         break;\n     case 12: /* UARTCR */\n         /* ??? Need to implement the enable bit.  */\n+        if ((s->cr ^ value) & CR_UARTEN) {\n+            /* Re-arm the log warning when the guest toggles UARTEN */\n+            s->logged_disabled_uart = false;\n+        }\n         s->cr = value;\n         pl011_loopback_mdmctrl(s);\n         break;\n@@ -665,6 +684,7 @@ static void pl011_reset(DeviceState *dev)\n     s->ifl = 0x12;\n     s->cr = 0x300;\n     s->flags = 0;\n+    s->logged_disabled_uart = false;\n     pl011_reset_rx_fifo(s);\n     pl011_reset_tx_fifo(s);\n }\ndiff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h\nindex ff735b5234..5695787650 100644\n--- a/include/hw/char/pl011.h\n+++ b/include/hw/char/pl011.h\n@@ -51,6 +51,7 @@ struct PL011State {\n     qemu_irq irq[6];\n     Clock *clk;\n     bool migrate_clk;\n+    bool logged_disabled_uart;\n     const unsigned char *id;\n     /*\n      * Since some users embed this struct directly, we must\n",
    "prefixes": []
}