From patchwork Tue Jan 24 13:43:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 92353 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1718278qgi; Tue, 24 Jan 2017 05:43:14 -0800 (PST) X-Received: by 10.55.98.5 with SMTP id w5mr29124757qkb.165.1485265394721; Tue, 24 Jan 2017 05:43:14 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id 103si13179399qkq.81.2017.01.24.05.43.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 05:43:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cW1NP-0000TG-N8; Tue, 24 Jan 2017 13:43:11 +0000 Received: from mail-wm0-f51.google.com ([74.125.82.51]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cW1Ms-00008F-3t for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2017 13:42:39 +0000 Received: by mail-wm0-f51.google.com with SMTP id r126so182632091wmr.0 for ; Tue, 24 Jan 2017 05:42:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PXvkWBWBSpJ9VgrPXkPUiD1o+8ZOOHPor2B0RsZk3hY=; b=fhbOfBy1vA0Yyu81tqH2wDoCPfVewXBEes20S65vG71f0BrUSWBtEBFtlFthE41MAr 1IGF3Bi6E/uPjjNGDfoKHJiRvmEfBHz4lbVDNqEacf+VSAzQsRntEA8F+zhxNEe6kQ/p Dka9LjaLZhJhBizij/Y6I88Uxn+ACFniRmRsw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PXvkWBWBSpJ9VgrPXkPUiD1o+8ZOOHPor2B0RsZk3hY=; b=LYH7ynJHxvY56ptwZdJsvsbwfzdBrgx5SOuQOQNnWZfDzoDOjcNxCsiQA0ufNG3xML irePN5PT3DgCVpIqvxaNFifBGD52LG46VFTmX5pyq1M9vXnU0+E8Z5tGrV10CsCQJrEy +va3hxbIlspfpunMM3JRRy6msTEx75kG+yr0hhuP5wEgDqRePaiSEn0YtK3F+CecgJYf luwbh2jIc+FtavgeyJvmSJy9d3GWp4sGtk0FJzC4aat0lxUMzLFCTHek6BHWup+k2zvH olKJKSpnW5XGUrwjGzBR1q2s9VnBJmuVVb8HGP1swX/ydNPGoahLtf4ErLOzC5CixuGB DpIA== X-Gm-Message-State: AIkVDXLguN+B306VHdphCBvTxwWnFdMYd9GpZ7pE+kp0YSroHa2axzyyQr1/10jMLsPOt2Je X-Received: by 10.28.167.5 with SMTP id q5mr19833216wme.15.1485265276319; Tue, 24 Jan 2017 05:41:16 -0800 (PST) Received: from localhost.localdomain (host81-129-172-30.range81-129.btcentralplus.com. [81.129.172.30]) by smtp.gmail.com with ESMTPSA id d42sm19966165wrd.7.2017.01.24.05.41.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 05:41:15 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH 1/8] serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled Date: Tue, 24 Jan 2017 13:43:03 +0000 Message-Id: <20170124134310.27512-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170124134310.27512-1-lee.jones@linaro.org> References: <20170124134310.27512-1-lee.jones@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170124_054238_315851_0677C886 X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Score: -1.5 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [74.125.82.51 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.125.82.51 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.51 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patrice.chotard@st.com, Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@stlinux.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The datasheet states: "If the MODE field selects an 8-bit frame then this [parity error] bit is undefined. Software should ignore this bit when reading 8-bit frames." Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) -- 2.10.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 379e5bd..69e6232 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -287,9 +287,19 @@ static void asc_transmit_chars(struct uart_port *port) static void asc_receive_chars(struct uart_port *port) { struct tty_port *tport = &port->state->port; - unsigned long status; + unsigned long status, mode; unsigned long c = 0; char flag; + bool ignore_pe = false; + + /* + * Datasheet states: If the MODE field selects an 8-bit frame then + * this [parity error] bit is undefined. Software should ignore this + * bit when reading 8-bit frames. + */ + mode = asc_in(port, ASC_CTL) & ASC_CTL_MODE_MSK; + if (mode == ASC_CTL_MODE_8BIT || mode == ASC_CTL_MODE_8BIT_PAR) + ignore_pe = true; if (port->irq_wake) pm_wakeup_event(tport->tty->dev, 0); @@ -299,8 +309,8 @@ static void asc_receive_chars(struct uart_port *port) flag = TTY_NORMAL; port->icount.rx++; - if ((c & (ASC_RXBUF_FE | ASC_RXBUF_PE)) || - status & ASC_STA_OE) { + if (status & ASC_STA_OE || c & ASC_RXBUF_FE || + (c & ASC_RXBUF_PE && !ignore_pe)) { if (c & ASC_RXBUF_FE) { if (c == (ASC_RXBUF_FE | ASC_RXBUF_DUMMY_RX)) {