get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 814285,
    "url": "http://patchwork.ozlabs.org/api/patches/814285/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pwm/patch/20170915140411.31716-10-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": "<20170915140411.31716-10-romain.izard.pro@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-15T14:04:11",
    "name": "[v2,9/9] tty/serial: atmel: Prevent a warning on suspend",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "68db8a3079fa2be18449110ce2a99242e8b2e34e",
    "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/20170915140411.31716-10-romain.izard.pro@gmail.com/mbox/",
    "series": [
        {
            "id": 3315,
            "url": "http://patchwork.ozlabs.org/api/series/3315/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pwm/list/?series=3315",
            "date": "2017-09-15T14:04:06",
            "name": "Various patches for SAMA5D2 backup mode",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/3315/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/814285/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/814285/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=\"bie29Lk4\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xtxxx2STqz9s7m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 00:05:41 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751868AbdIOOFh (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 15 Sep 2017 10:05:37 -0400",
            "from mail-wr0-f196.google.com ([209.85.128.196]:36801 \"EHLO\n\tmail-wr0-f196.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751763AbdIOOFd (ORCPT\n\t<rfc822; linux-pwm@vger.kernel.org>); Fri, 15 Sep 2017 10:05:33 -0400",
            "by mail-wr0-f196.google.com with SMTP id g50so1369124wra.3;\n\tFri, 15 Sep 2017 07:05:32 -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\t55sm1399225wrw.60.2017.09.15.07.05.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 15 Sep 2017 07:05:31 -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=GfldR+qnGXYQcdupA0hg9Id/GUmPUGImlAO61011BXc=;\n\tb=bie29Lk42PJf8RGHINcDhWT2LnkOZYYx4xl7E3/yBCIi7SOOgYQuoebLYdVmSSoCss\n\twaEDs7twJ8urQAKKWd3X905GqpTUITw3J+0Ura40TIlGHu8/pYW4sSdIkQ7oAFcuazfh\n\tvaALU4U0km91GqRyDKzjB/ek2Ktwt9LIGm1xMfB1D68qOUnoKWHj42OdVM8c+aXobIVP\n\thPjoAXYPUrxzby2IoNz6ci8ikntqsgxDdt2TlOjYBFzEOQKraAa4ze1tVKuLRKRtwjT5\n\tqGFJ3j+MlRMOY9KR+Du4gIXC47R4Zy739NQyK7D7S6vhBvNeMgAggJf6DwXFhNFe7ZA+\n\tcyvA==",
        "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=GfldR+qnGXYQcdupA0hg9Id/GUmPUGImlAO61011BXc=;\n\tb=bim0Xp1Em7TBubOA0aFFYmpH9IYhmkl85PE9laXK0ccwyImxWd+2xgyZG29CXZZ9d4\n\teDgRR11GHcCYB+LO4T0HyNshELoj0ziF9Ta7NLEb66Vm19A+aHWJApunuwk/+Ba2PWm1\n\tshd42Wc5JsSVsH3OLCcQ1fCJUQUuaK5PdIBKsZQsax26SEll7rettrPUAi7l7TGXDluO\n\tNMJ7Q1meyJSdh8tLNSk4JS6PGN9FBj3OTHiZLZ4iGGG86JnxvkWaRb0rEPLBgLZdeY3w\n\tYEWRHWX3V4OIfV4ya9acuAxulQrwFbyzC/Jv9cEbooUvnhIZPvBdgLcsTc+TVQNd30Cl\n\thu4g==",
        "X-Gm-Message-State": "AHPjjUipJRJSHqIUOI+gWKjaEL7HhJDzRq0G7GVb+gYLs3w3mfKocWJF\n\tWcjc3uuXWdZAcQ==",
        "X-Google-Smtp-Source": "ADKCNb6HbWewqWC1gS5/tQnC1OS5KQB+rS/Vci7LKAHECr0BBp2kmOMsThuyTXmG7HIucY10ZVnKBg==",
        "X-Received": "by 10.223.150.113 with SMTP id c46mr20173265wra.30.1505484331631;\n\tFri, 15 Sep 2017 07:05:31 -0700 (PDT)",
        "From": "Romain Izard <romain.izard.pro@gmail.com>",
        "To": "Nicolas Ferre <nicolas.ferre@microchip.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.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\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>",
        "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\tlinux-arm-kernel@lists.infradead.org,\n\tRomain Izard <romain.izard.pro@gmail.com>",
        "Subject": "[PATCH v2 9/9] tty/serial: atmel: Prevent a warning on suspend",
        "Date": "Fri, 15 Sep 2017 16:04:11 +0200",
        "Message-Id": "<20170915140411.31716-10-romain.izard.pro@gmail.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170915140411.31716-1-romain.izard.pro@gmail.com>",
        "References": "<20170915140411.31716-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>\n---\n drivers/tty/serial/atmel_serial.c | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)",
    "diff": "diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c\nindex 7551cab438ff..783af6648be0 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@@ -2511,6 +2523,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 +2541,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": [
        "v2",
        "9/9"
    ]
}