get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 819485,
    "url": "http://patchwork.ozlabs.org/api/patches/819485/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170928094627.31017-9-romain.izard.pro@gmail.com/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170928094627.31017-9-romain.izard.pro@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-28T09:46:27",
    "name": "[v4,8/8] tty/serial: atmel: Prevent a warning on suspend",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "1d08c6d3b399a5b0d16c0ea8181b8b41adab48e9",
    "submitter": {
        "id": 8236,
        "url": "http://patchwork.ozlabs.org/api/people/8236/?format=api",
        "name": "Romain Izard",
        "email": "romain.izard.pro@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170928094627.31017-9-romain.izard.pro@gmail.com/mbox/",
    "series": [
        {
            "id": 5526,
            "url": "http://patchwork.ozlabs.org/api/series/5526/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=5526",
            "date": "2017-09-28T09:46:23",
            "name": "Various patches for SAMA5D2 backup mode",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/5526/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/819485/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/819485/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"Un4Nks2E\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"ZrMxLN8B\"; dkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2qfw068tz9sRq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 19:50:00 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dxVS4-0005LR-B1; Thu, 28 Sep 2017 09:49:52 +0000",
            "from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dxVPS-0002V1-G7\n\tfor linux-mtd@lists.infradead.org; Thu, 28 Sep 2017 09:47:21 +0000",
            "by mail-wm0-x242.google.com with SMTP id m127so1045965wmm.3\n\tfor <linux-mtd@lists.infradead.org>;\n\tThu, 28 Sep 2017 02:46:49 -0700 (PDT)",
            "from localhost.localdomain (146.187.3.109.rev.sfr.net.\n\t[109.3.187.146]) by smtp.gmail.com with ESMTPSA id\n\tz10sm3272395wre.6.2017.09.28.02.46.47\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 28 Sep 2017 02:46:47 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:\n\tIn-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=95BOGtLjmLLUuYMe82AwExhBEpVtRsLOqLBwb2XvX44=;\n\tb=Un4Nks2EloWy1Nm7OYNIfNFiZS\n\tYki69ucH9M6tT771fRSpMAD2j+kLZ7cwcPiX4VOIqFrvMPOMpcTGewBymsoDc22M5LWCNGVNq27C4\n\tJmRx16n1QODveZXJrEpljym2PwNxKJGLoRpQF3x2UVSU3oP49uH+bmZVyDcAw/sQXd6p139NUTFq+\n\tN/JxuhtzL4DGin0cKZbwZvGeNnM4HYBF/oeGGn9G2Mt5Lc+c/1oV5IZ8/qyE76Fmya2uMy8Si8dL3\n\tOQukT6JOxkxT43A31i6JKj4VZVB3JaiVKUBM9LNeG3lOuJzVFywvgm4hlitwCsUKLK5msT5PKpp2X\n\tSrk5cb3A==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=Kb+eYUn6sUr9qLQ2ec5i4R8VU1m7KosNeKaMrwYeb1w=;\n\tb=ZrMxLN8BtFMNgwM6gq0gyjxXLz1uKnio23i6+ETlC1ihuBOuO8pbIobUuKvWOOEitS\n\txCQZVxaYSrH6/thLOqWxWEa3UQdLBSbq/6VXQRLZhogP8sf9bEfaZCcMtBdbt14bUyWw\n\teZZNpifmjWIawT5J3NV/byhist9udYfzghe2I/cyqwG7gU77YMH7AOuS1O2yHMpk/1pB\n\tzyxuButpfhe4OdN9lyxK1xy25hmSbNkMn6QRbG757tT+SHGRJt+iGznmgVuq2pH0LEyI\n\tdEFdfbIqwiXRC+9cRJf4TDVBY+/N3sb2zZPtNqJyZ+SRl3lj2XJ9AZcubzHB6NJqiht9\n\tx/+g=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=Kb+eYUn6sUr9qLQ2ec5i4R8VU1m7KosNeKaMrwYeb1w=;\n\tb=KS5ouUrZV0NnMwIRV2apBl2UNuaBfveafpaQWJOuBeMLeoVV+wDtLQsTbi1VfLzyXH\n\tFeX6fA5uO5KUAOxcjQHut+jIXMSGv2/7z4yWinS9x0Flu4m0k3MWOgX4PypbAq+VwvQg\n\tex1QliTtsmlt1Cm0obWHUvZ3eEZbjIyxVEKUFi0oG8qPADz3m34zoBUZ10W3QFC8X6mH\n\tKOfonsNw5qn6O5OqYfQSgGx9AMculUNqzg79AlZk5SrjStEYsFv/El0e5DRB7u/7qxyq\n\tKUtw6zSIeYqqEQrxSKwe2u5cUOpaBgfISFOAtdOkvJK6VWsDZwgMEhIuXJvaJQBbDRmM\n\tvGrA==",
        "X-Gm-Message-State": "AHPjjUhwW3MIwmWjwxZSPrXO9IlQxBfNhEo408MHlgNyZLaq2uDDHuJq\n\tg5N+J/B+IUS2E03J6sCOBjc=",
        "X-Google-Smtp-Source": "AOwi7QC8vtaGUT5ewGdVT4EJVssaapRUL6wbggMzzHoqiMw1ugTolj+A97gc6o5HBWanf4OaX4sWjQ==",
        "X-Received": "by 10.28.147.199 with SMTP id v190mr509569wmd.24.1506592008445; \n\tThu, 28 Sep 2017 02:46:48 -0700 (PDT)",
        "From": "Romain Izard <romain.izard.pro@gmail.com>",
        "To": "Boris Brezillon <boris.brezillon@free-electrons.com>,\n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@codeaurora.org>, Lee Jones <lee.jones@linaro.org>,\n\tWenyou Yang <wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>, \n\tRichard Weinberger <richard@nod.at>,\n\tDavid Woodhouse <dwmw2@infradead.org>, \n\tBrian Norris <computersforpeace@gmail.com>,\n\tMarek Vasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tJiri Slaby <jslaby@suse.com>, Alan Stern <stern@rowland.harvard.edu>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tNicolas Ferre <nicolas.ferre@microchip.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>",
        "Subject": "[PATCH v4 8/8] tty/serial: atmel: Prevent a warning on suspend",
        "Date": "Thu, 28 Sep 2017 11:46:27 +0200",
        "Message-Id": "<20170928094627.31017-9-romain.izard.pro@gmail.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170928094627.31017-1-romain.izard.pro@gmail.com>",
        "References": "<20170928094627.31017-1-romain.izard.pro@gmail.com>",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170928_024711_054741_D40E8F8F ",
        "X-CRM114-Status": "GOOD (  15.43  )",
        "X-Spam-Score": "-2.0 (--)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2a00:1450:400c:c09:0:0:0:242 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (romain.izard.pro[at]gmail.com)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Cc": "linux-pwm@vger.kernel.org, linux-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-serial@vger.kernel.org, Romain Izard <romain.izard.pro@gmail.com>, \n\tlinux-clk@vger.kernel.org",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "The atmel serial port driver reported the following warning on suspend:\natmel_usart f8020000.serial: ttyS1: Unable to drain transmitter\n\nAs the ATMEL_US_TXEMPTY status bit in ATMEL_US_CSR is always cleared\nwhen the transmitter is disabled, we need to know the transmitter's\nstate to return the real fifo state. And as ATMEL_US_CR is write-only,\nit is necessary to save the state of the transmitter in a local\nvariable, and update the variable when TXEN and TXDIS is written in\nATMEL_US_CR.\n\nAfter those changes, atmel_tx_empty can return \"empty\" on suspend, the\nwarning in uart_suspend_port disappears, and suspending is 20ms shorter\nfor each enabled Atmel serial port.\n\nSigned-off-by: Romain Izard <romain.izard.pro@gmail.com>\nTested-by: Nicolas Ferre <nicolas.ferre@microchip.com>\nAcked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\nAcked-by: Richard Genoud <richard.genoud@gmail.com>\n---\n drivers/tty/serial/atmel_serial.c | 13 +++++++++++++\n 1 file changed, 13 insertions(+)",
    "diff": "diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c\nindex 7551cab438ff..ce45b4ada0bf 100644\n--- a/drivers/tty/serial/atmel_serial.c\n+++ b/drivers/tty/serial/atmel_serial.c\n@@ -171,6 +171,7 @@ struct atmel_uart_port {\n \tbool\t\t\thas_hw_timer;\n \tstruct timer_list\tuart_timer;\n \n+\tbool\t\t\ttx_stopped;\n \tbool\t\t\tsuspended;\n \tunsigned int\t\tpending;\n \tunsigned int\t\tpending_status;\n@@ -380,6 +381,10 @@ static int atmel_config_rs485(struct uart_port *port,\n  */\n static u_int atmel_tx_empty(struct uart_port *port)\n {\n+\tstruct atmel_uart_port *atmel_port = to_atmel_uart_port(port);\n+\n+\tif (atmel_port->tx_stopped)\n+\t\treturn TIOCSER_TEMT;\n \treturn (atmel_uart_readl(port, ATMEL_US_CSR) & ATMEL_US_TXEMPTY) ?\n \t\tTIOCSER_TEMT :\n \t\t0;\n@@ -485,6 +490,7 @@ static void atmel_stop_tx(struct uart_port *port)\n \t * is fully transmitted.\n \t */\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS);\n+\tatmel_port->tx_stopped = true;\n \n \t/* Disable interrupts */\n \tatmel_uart_writel(port, ATMEL_US_IDR, atmel_port->tx_done_mask);\n@@ -521,6 +527,7 @@ static void atmel_start_tx(struct uart_port *port)\n \n \t/* re-enable the transmitter */\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);\n+\tatmel_port->tx_stopped = false;\n }\n \n /*\n@@ -1866,6 +1873,7 @@ static int atmel_startup(struct uart_port *port)\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n \t/* enable xmit & rcvr */\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n+\tatmel_port->tx_stopped = false;\n \n \tsetup_timer(&atmel_port->uart_timer,\n \t\t\tatmel_uart_timer_callback,\n@@ -2122,6 +2130,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,\n \n \t/* disable receiver and transmitter */\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS | ATMEL_US_RXDIS);\n+\tatmel_port->tx_stopped = true;\n \n \t/* mode */\n \tif (port->rs485.flags & SER_RS485_ENABLED) {\n@@ -2207,6 +2216,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,\n \tatmel_uart_writel(port, ATMEL_US_BRGR, quot);\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n+\tatmel_port->tx_stopped = false;\n \n \t/* restore interrupts */\n \tatmel_uart_writel(port, ATMEL_US_IER, imr);\n@@ -2450,6 +2460,7 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)\n \n \t/* Make sure that tx path is actually able to send characters */\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);\n+\tatmel_port->tx_stopped = false;\n \n \tuart_console_write(port, s, count, atmel_console_putchar);\n \n@@ -2511,6 +2522,7 @@ static int __init atmel_console_setup(struct console *co, char *options)\n {\n \tint ret;\n \tstruct uart_port *port = &atmel_ports[co->index].uart;\n+\tstruct atmel_uart_port *atmel_port = to_atmel_uart_port(port);\n \tint baud = 115200;\n \tint bits = 8;\n \tint parity = 'n';\n@@ -2528,6 +2540,7 @@ static int __init atmel_console_setup(struct console *co, char *options)\n \tatmel_uart_writel(port, ATMEL_US_IDR, -1);\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n+\tatmel_port->tx_stopped = false;\n \n \tif (options)\n \t\tuart_parse_options(options, &baud, &parity, &bits, &flow);\n",
    "prefixes": [
        "v4",
        "8/8"
    ]
}