get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 819472,
    "url": "http://patchwork.ozlabs.org/api/patches/819472/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pwm/patch/20170928094627.31017-9-romain.izard.pro@gmail.com/",
    "project": {
        "id": 38,
        "url": "http://patchwork.ozlabs.org/api/projects/38/?format=api",
        "name": "Linux PWM development",
        "link_name": "linux-pwm",
        "list_id": "linux-pwm.vger.kernel.org",
        "list_email": "linux-pwm@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "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": "superseded",
    "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-pwm/patch/20170928094627.31017-9-romain.izard.pro@gmail.com/mbox/",
    "series": [
        {
            "id": 5525,
            "url": "http://patchwork.ozlabs.org/api/series/5525/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pwm/list/?series=5525",
            "date": "2017-09-28T09:46:20",
            "name": "Various patches for SAMA5D2 backup mode",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/5525/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/819472/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/819472/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-pwm-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-pwm-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\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 vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2qc55HdSz9t3v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 19:47:33 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752777AbdI1JrI (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 28 Sep 2017 05:47:08 -0400",
            "from mail-wm0-f66.google.com ([74.125.82.66]:46855 \"EHLO\n\tmail-wm0-f66.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752595AbdI1Jqu (ORCPT\n\t<rfc822; linux-pwm@vger.kernel.org>); Thu, 28 Sep 2017 05:46:50 -0400",
            "by mail-wm0-f66.google.com with SMTP id m72so1067971wmc.1;\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; c=relaxed/relaxed;\n\td=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=ctR3/JW3NvWH8Q9hFLnExn2v5phw7zEv/yOIa09bbmecqe1B17JIASVsO+gPTcYH1x\n\tFmiXTAqLlogETA7tO49Geqfxm8/olA/ddAK7cjLbwN1rE142xWSOLu/Q+Yv2b8ofP45M\n\tTV8E4E9D8m2F2DStZPxNYPZUrjaTrB4ZHmTfw3q+2nb7Y4Y1+1AI39oeqF5zL9cihxbX\n\tr3syti+RqBttXC/AVD2aU14/bNbZwjvFFvVSEW2ZruR8Ve9EnUhVjD18j2pt2HfjaLTT\n\t89eQaIQjSsEeldcwnGZjyFEkjHkDvltpd5lla7z5W/hpDtl8x/Ltx3b+HSEhq4jflDMJ\n\tb9rA==",
        "X-Gm-Message-State": "AHPjjUi4mxvXDFoteLz3Ild4Api5uDvFR4xTz4R0hf1y8i70UNRB1THu\n\tY27ZZom5Lqft6/gF/Yh+cKM=",
        "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>",
        "Cc": "linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org, linux-pwm@vger.kernel.org,\n\tlinux-serial@vger.kernel.org, linux-usb@vger.kernel.org,\n\tRomain Izard <romain.izard.pro@gmail.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>",
        "Sender": "linux-pwm-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<linux-pwm.vger.kernel.org>",
        "X-Mailing-List": "linux-pwm@vger.kernel.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"
    ]
}