Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/811663/?format=api
{ "id": 811663, "url": "http://patchwork.ozlabs.org/api/patches/811663/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pwm/patch/20170908153604.28383-11-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": "<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": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pwm/patch/20170908153604.28383-11-romain.izard.pro@gmail.com/mbox/", "series": [ { "id": 2238, "url": "http://patchwork.ozlabs.org/api/series/2238/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pwm/list/?series=2238", "date": "2017-09-08T15:35:55", "name": "Various patches for SAMA5D2 backup mode", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2238/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/811663/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811663/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=\"r3hwv39J\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xphX05ymPz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 9 Sep 2017 01:46:56 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1756505AbdIHPh1 (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 8 Sep 2017 11:37:27 -0400", "from mail-wr0-f196.google.com ([209.85.128.196]:36295 \"EHLO\n\tmail-wr0-f196.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932413AbdIHPgb (ORCPT\n\t<rfc822;linux-pwm@vger.kernel.org>); Fri, 8 Sep 2017 11:36:31 -0400", "by mail-wr0-f196.google.com with SMTP id g50so1407715wra.3;\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; c=relaxed/relaxed;\n\td=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=Vvb8lHOImdFqnowTEvUVf057LhTt29bI+brVZOChlLoNFXCFx/PvdL4n+PAIxoEqyj\n\t9HHWOx+X7GKtti8dJOVvEDfzMIODxfUt2dCcz2WNj8Mubnz8i2zaiuRDhUY7Bh/Lnn1I\n\thOCJrPfLqk3auGVl5r9MRyqFNxpOiFPbYAn00HAuAUA+Om7VQTVehpZycnDIDX1viIPI\n\tGJQ2N2Y8ev6QHgxXoA970J4IUuOIq+/O9ZQbliO6w+WSs5/IH7BOI65eV0L4S8bsOk6d\n\t902y58X32bJjEGtbWPxlHX2vdXm9I9qwzpjBrzZja1Tax5H0ypf+VuFAV0HGM66xasrI\n\tSs4A==", "X-Gm-Message-State": "AHPjjUiEdtletgOb7FiURE6D5Q3RW8a0YCVQFAnt1KNTd2ZNZWV5xXRE\n\tuH8AVpITIT4QLQ==", "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>, Wenyou Yang <wenyou.yang@atmel.com>,\n\tJosh 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-iio@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-pwm@vger.kernel.org, linux-serial@vger.kernel.org,\n\tlinux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tRomain Izard <romain.izard.pro@gmail.com>", "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>", "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 | 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" ] }