get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 811674,
    "url": "http://patchwork.ozlabs.org/api/patches/811674/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170908153604.28383-11-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": "<20170908153604.28383-11-romain.izard.pro@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-08T15:36:04",
    "name": "[v1,10/10] tty/serial: atmel: Prevent a warning on suspend",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "84cf84569b88b39142648d555fad504a1c6ad49a",
    "submitter": {
        "id": 8236,
        "url": "http://patchwork.ozlabs.org/api/people/8236/?format=api",
        "name": "Romain Izard",
        "email": "romain.izard.pro@gmail.com"
    },
    "delegate": {
        "id": 58324,
        "url": "http://patchwork.ozlabs.org/api/users/58324/?format=api",
        "username": "bbrezillon",
        "first_name": "Boris",
        "last_name": "Brezillon",
        "email": "boris.brezillon@free-electrons.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170908153604.28383-11-romain.izard.pro@gmail.com/mbox/",
    "series": [
        {
            "id": 2239,
            "url": "http://patchwork.ozlabs.org/api/series/2239/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=2239",
            "date": "2017-09-08T15:35:55",
            "name": "Various patches for SAMA5D2 backup mode",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2239/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/811674/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/811674/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=\"E9SiT6Wd\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"r3hwv39J\"; 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 3xphzH6TBjz9t16\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  9 Sep 2017 02:07:07 +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 1dqLo0-0000V9-8D; Fri, 08 Sep 2017 16:06:56 +0000",
            "from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dqLKt-000691-7H; Fri, 08 Sep 2017 15:37:01 +0000",
            "by mail-wr0-x241.google.com with SMTP id n64so1409580wrb.2;\n\tFri, 08 Sep 2017 08:36:30 -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\tp199sm1689224wmb.28.2017.09.08.08.36.28\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Sep 2017 08:36:28 -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=5ZBXU0CYHxJ3uD4UKMSz3cRhAmgv1UUliwHpfQmWuz4=;\n\tb=E9SiT6WdLhrTL/n524vNqRfq6o\n\tq6JMQ1f/dAO4A49OWvcU1hG1D5OQsDkDEp9eQwMi8JOGjC6m6m5Vh1kqBQq8nfa6l+i/6Ys1kQmzA\n\tgn894GaWtBe+cPQV3rjK5POuMJP3kEdjegSLcE2HfkbuqQ7jkY5+ZjphwvmPRAv3zPJdHSC2/Muqw\n\tQ18MGwIn1SNF/FOSkw/OLepLQmg4TDOg6U1zTtWTUxMOKOg5d0V5Gf43c0wX//XbI5rgVn3pxoKZC\n\tGiiJzlrMQj6oTtbYawDwZ75rzrZcKKiK65imdH8491U8jTNK2kgzYb3OfCj32vIOPxrysRFqcKX/7\n\twdN89Z6Q==;",
            "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=+UTzhLnF6voZH5hQ1dSzML3l3kABKBZi1KBSzYm72fc=;\n\tb=r3hwv39JRwqsiKWhfSuLRkoB2rMQbv2b9qziWnDfCLKSrii1J/3fCEQfcihdgW2WHf\n\tDevm9ZXc+0HRzjELE8Y6znBPWcI1NroFWt37/bhkid1wqDx+u/qAwGGR2VNzbTbW3hk5\n\tKUAaflVdpv2YWB059NMMAXrgA007w4p4p0MKduoS41wxY8qPp2g5mCAXapXp3zhgIw8N\n\tOvHt0qtz//NfCbeMf7nXDMDC06DvABT0/J7R/Ir1m6J4vzPM5gY9WFwq8aRAU10puwRc\n\tJ1IR+sbEo4IMs64irA7uLeMazqc3Jcwuy5AixDB6Kz5NETdcXsOZ618CIKqnar971OBT\n\tqqSw=="
        ],
        "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=+UTzhLnF6voZH5hQ1dSzML3l3kABKBZi1KBSzYm72fc=;\n\tb=L6qzdBe0sdKnh/KYZXaw4kgwueNC3shF38ZQQEs1bVTmtQpzpZzqkzkZBhVVal0wHg\n\tsf+eQSnx4DT3y4ZWvUMsoDuxiQTauCcZDwCbiubmfqnGh2eIv+crB2APhBdEPzVhM/lh\n\tq9gxCR34CnJ1GA9omsQ3gAxM2km1YlLzpWq0LP6dM1B8Smwd+SSYeQiYi7YKgq/TUvY/\n\tyXRxuIXCwJRP1LZ/AYkdJIi3xXIgdo1mWqSbIOPqJwXkzlS/Xuwx4HqTBOrhUL05qmwY\n\tK5PBmrCtdlAX7JUdbogBhTon6p6IyBoG9GdH8/LAYFZRn7KurpfkDC3VAFvp5PR2xw08\n\tB+JA==",
        "X-Gm-Message-State": "AHPjjUgaFiqKUACuOZAvQpEkwun8BNEn9eO8mc7yHdEiONKu5gRWrM+E\n\tH0D4UwdAOMim/A==",
        "X-Google-Smtp-Source": "ADKCNb7vwAe4LrS7UxyBxEzoK515bJ07MMTL1qcuKyc7SPEoRv4I4NnY9JyXS29BgBwJToPM0PFUNQ==",
        "X-Received": "by 10.223.145.163 with SMTP id 32mr2377201wri.279.1504884989387; \n\tFri, 08 Sep 2017 08:36:29 -0700 (PDT)",
        "From": "Romain Izard <romain.izard.pro@gmail.com>",
        "To": "Nicolas Ferre <nicolas.ferre@microchip.com>,\n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@codeaurora.org>,\n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tJonathan Cameron <jic23@kernel.org>,\n\tWenyou Yang <wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>,\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\tAlan Stern <stern@rowland.harvard.edu>",
        "Subject": "[PATCH v1 10/10] tty/serial: atmel: Prevent a warning on suspend",
        "Date": "Fri,  8 Sep 2017 17:36:04 +0200",
        "Message-Id": "<20170908153604.28383-11-romain.izard.pro@gmail.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170908153604.28383-1-romain.izard.pro@gmail.com>",
        "References": "<20170908153604.28383-1-romain.izard.pro@gmail.com>",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170908_083651_741458_AD088596 ",
        "X-CRM114-Status": "GOOD (  14.27  )",
        "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:c0c:0:0:0:241 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-iio@vger.kernel.org,\n\tlinux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org, linux-serial@vger.kernel.org,\n\tRomain Izard <romain.izard.pro@gmail.com>, linux-clk@vger.kernel.org, \n\tlinux-arm-kernel@lists.infradead.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>\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..195c0d1b594e 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@@ -492,6 +498,7 @@ static void atmel_stop_tx(struct uart_port *port)\n \tif ((port->rs485.flags & SER_RS485_ENABLED) &&\n \t    !(port->rs485.flags & SER_RS485_RX_DURING_TX))\n \t\tatmel_start_rx(port);\n+\n }\n \n /*\n@@ -521,6 +528,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 +1874,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 +2131,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 +2217,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 +2461,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@@ -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": [
        "v1",
        "10/10"
    ]
}