From patchwork Fri Jan 27 17:27:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 92706 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp341952qgi; Fri, 27 Jan 2017 09:30:22 -0800 (PST) X-Received: by 10.13.203.130 with SMTP id n124mr7113379ywd.199.1485538222253; Fri, 27 Jan 2017 09:30:22 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id s10si1523187ywc.409.2017.01.27.09.30.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jan 2017 09:30:22 -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 1cXALr-0003c2-N7; Fri, 27 Jan 2017 17:30:19 +0000 Received: from mail-wm0-f42.google.com ([74.125.82.42]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cXALH-0001ba-4H for linux-arm-kernel@lists.infradead.org; Fri, 27 Jan 2017 17:29:47 +0000 Received: by mail-wm0-f42.google.com with SMTP id r126so127044655wmr.0 for ; Fri, 27 Jan 2017 09:29:22 -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=hlKrZUbdZb3ODtd0dth/ItQyMint0+JkHFNCQC/C7kc=; b=X0BNYmen2jjAjIh/muz4x1GVwJmaKOkLYt92FEV4FqryV2u+gWp9uw2lg7f8cQFEAM 4i8m9OVKrBMl2TpDhFhbTvSr06GB0bxj/g9VtJ3r9om+wkDJ7msetKgwAWYK7C+5My28 GZ9rVhPHvJIFHo7DBOf2rV4EV2aMpARu+nGFE= 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=hlKrZUbdZb3ODtd0dth/ItQyMint0+JkHFNCQC/C7kc=; b=U83ZUmxUlYOVnffFD+EIc7NCGwV1tUH3mxnvXnZVZw6nIBpkI4bOJM1BMuGOfcF0Ah CztP2I8d61LUyh/BPGtofEFwkWF1FWR/RszfW/FYnBJ9/OTdifXtjFBmm5rXdV8eucYX P0MR/ORWK06qF34KjXHC3C4uzNoxtFdBiJA4gmzrgHBlrdb15UccmgtTshTyTHe5b9to zQ/kgPsixN58dxuLyS74hMsQ5SHuahOmIOELmh0N5kfaFZZw8QhZkpgp/Hi+pIJFK+dr AFXB1SDUGGeFunXMnmyvLAf3KnUjSqEyvw0p7bAueRhL9DEdX1ipA0wvgb/PVff7UmtM Stgg== X-Gm-Message-State: AIkVDXKRb4bojvfWcSILGtA+QajruaBH8IjCFOaC8esKofvdI8WfduYEr46HBK4kB1eMb7b6 X-Received: by 10.223.177.202 with SMTP id r10mr8433993wra.94.1485538101345; Fri, 27 Jan 2017 09:28:21 -0800 (PST) Received: from localhost.localdomain ([2a01:4c8:1b:eeec:f122:1b92:9371:359c]) by smtp.gmail.com with ESMTPSA id k4sm4822140wmf.22.2017.01.27.09.28.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jan 2017 09:28:20 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 01/10] serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled Date: Fri, 27 Jan 2017 17:27:55 +0000 Message-Id: <20170127172804.23881-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170127172804.23881-1-lee.jones@linaro.org> References: <20170127172804.23881-1-lee.jones@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170127_092943_501146_A97B2397 X-CRM114-Status: GOOD ( 12.34 ) 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.42 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.125.82.42 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.42 listed in wl.mailspike.net] -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_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." Acked-by: Peter Griffin Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) -- 2.9.3 _______________________________________________ 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)) {