From patchwork Tue Apr 5 02:49:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 65038 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp211660lbc; Mon, 4 Apr 2016 19:46:44 -0700 (PDT) X-Received: by 10.66.102.106 with SMTP id fn10mr58978440pab.60.1459824404698; Mon, 04 Apr 2016 19:46:44 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n76si36044909pfa.84.2016.04.04.19.46.44; Mon, 04 Apr 2016 19:46:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753321AbcDECqo (ORCPT + 2 others); Mon, 4 Apr 2016 22:46:44 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:5204 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753244AbcDECqn (ORCPT ); Mon, 4 Apr 2016 22:46:43 -0400 Received: from 172.24.1.60 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.60]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DEQ35757; Tue, 05 Apr 2016 10:46:35 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.235.1; Tue, 5 Apr 2016 10:46:23 +0800 From: Kefeng Wang To: Noam Camus , Greg Kroah-Hartman CC: Andy Shevchenko , Heikki Krogerus , , , , , Kefeng Wang Subject: [PATCH v2] serial: 8250_dw: fix wrong logic in dw8250_check_lcr() Date: Tue, 5 Apr 2016 10:49:06 +0800 Message-ID: <1459824546-9942-1-git-send-email-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.6.0.GIT MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.5703270C.00BA, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: fd5fc72387d3979d400cc10899bd60a0 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit cdcea058e510("serial: 8250_dw: Avoid serial_outx code duplicate with new dw8250_check_lcr()") introduce a wrong logic when write val to LCR reg. When CONFIG_64BIT enabled, __raw_writeq is used unconditionally. The __raw_readq/__raw_writeq is introduced by commit bca2092d7897("serial: 8250_dw: Use 64-bit access for OCTEON") for OCTEON, so for !PORT_OCTEON, we better to use coincident write func. Fixes: cdcea058e510("serial: 8250_dw: Avoid serial_outx code duplicate with new dw8250_check_lcr()") Signe:-off-by: Kefeng Wang --- drivers/tty/serial/8250/8250_dw.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 2.6.0.GIT -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index a3fb95d..003ce60 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -103,16 +103,14 @@ static void dw8250_check_lcr(struct uart_port *p, int value) dw8250_force_idle(p); -#ifdef CONFIG_64BIT - __raw_writeq(value & 0xff, offset); -#else - if (p->iotype == UPIO_MEM32) + if (IS_ENABLED(CONFIG_64BIT) && p->type == PORT_OCTEON) + __raw_writeq(value & 0xff, offset); + else if (p->iotype == UPIO_MEM32) writel(value, offset); else if (p->iotype == UPIO_MEM32BE) iowrite32be(value, offset); else writeb(value, offset); -#endif } /* * FIXME: this deadlocks if port->lock is already held