From patchwork Wed Feb 8 17:31:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 9562905 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8634960236 for ; Wed, 8 Feb 2017 17:32:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CF5C284EF for ; Wed, 8 Feb 2017 17:32:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51CF228506; Wed, 8 Feb 2017 17:32:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB695284EF for ; Wed, 8 Feb 2017 17:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933066AbdBHRb6 (ORCPT ); Wed, 8 Feb 2017 12:31:58 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33136 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754665AbdBHRbx (ORCPT ); Wed, 8 Feb 2017 12:31:53 -0500 Received: by mail-wr0-f195.google.com with SMTP id i10so9373209wrb.0; Wed, 08 Feb 2017 09:31:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=MLAqJUOvu/TqwPgsI3IFyBgoXuUONyRkb0pdNhJuyKM=; b=oiaowZGlP9oACFbLw9SOky5XiqaSaOWyaEtpdMSMT2KbEACOYV0nvwR6EpQTgMrAra hCSstWcr2RZC6tarvt0gGv9iSbl4fr/e8T1fVgZhvddE2HJPbDmfUBDy850Q6v8Fkjyf ks105LTG3fTHeH1i9a4JPNzLFodLXZf42W+OR0PYWCGwS7PAiRX3VFBt0kWVDCVtUWBj IorYh/kksB6U+AjI10aS20adsLjK8DCMe9pwURDPdkhkKDnwFrHPCxLK29FigxcNXuhY 9NVj/RZXd3x2OMV1W6Fbm53+DJ3ffp6xf6fwwUCgCoAwrBR1AkWdo+7iA0BJ9p/O8AHg aV4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=MLAqJUOvu/TqwPgsI3IFyBgoXuUONyRkb0pdNhJuyKM=; b=JxxYWKOP96AeUJZtbjqtG2DIYsE5zmNp5Y/RQp5phKBBOEnBEdMnCGPZtETY8Qnaao ajlVyHcSN0zpaY30G9nd9D+B/hxIyw9EsH6MTDgMOOhvEzumNaf92mDBlXp11HLanMK1 8DHvLjefsuP4KVvX8Gll3FdxetLqxrNHVC4tz5lsAH8Uymg7iXHULCCfqwV1w8Dpvs4Y kSWsujY6RLSk94tVO8puknRoIlmJDDU8jLKQ32g5WH09lc2JFF7bNX38bFyCi4d+DJ3W VCiPinMtQvkeleceXRtZJeM9SJ/rTryPD4EwsPnKnp9TviBnVAbS54L4gnuiG8dQBAZF nyIQ== X-Gm-Message-State: AIkVDXKl68b97ipBHnmpOPoGVVOzu2SfdnGgLgFCkram+DLdzhZYu/HJcjA58+669m0Gbw== X-Received: by 10.223.169.115 with SMTP id u106mr20425484wrc.54.1486575081411; Wed, 08 Feb 2017 09:31:21 -0800 (PST) Received: from groucho.site (ipbcc0353e.dynamic.kabel-deutschland.de. [188.192.53.62]) by smtp.gmail.com with ESMTPSA id d29sm4434223wmi.19.2017.02.08.09.31.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Feb 2017 09:31:20 -0800 (PST) From: Ulrich Hecht To: linux-renesas-soc@vger.kernel.org, geert@linux-m68k.org, gregkh@linuxfoundation.org Cc: wsa@the-dreams.de, linux-serial@vger.kernel.org, magnus.damm@gmail.com, sergei.shtylyov@cogentembedded.com, Ulrich Hecht Subject: [PATCH] serial: sh-sci: fix hardware RX trigger level setting Date: Wed, 8 Feb 2017 18:31:14 +0100 Message-Id: <1486575074-20130-1-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 1. Do not set the RX trigger level for software timeout devices on reset; there is no timeout by default, and data will rot. 2. Do set the RX trigger level for hardware timeout devices when set via sysfs attribute. Fixes SCIFA-type serial consoles. Signed-off-by: Ulrich Hecht Tested-by: Geert Uytterhoeven --- drivers/tty/serial/sh-sci.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index f95a56c..9a47cc4 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1076,8 +1076,11 @@ static ssize_t rx_trigger_store(struct device *dev, if (kstrtol(buf, 0, &r) == -EINVAL) return -EINVAL; + sci->rx_trigger = scif_set_rtrg(port, r); - scif_set_rtrg(port, 1); + if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) + scif_set_rtrg(port, 1); + return count; } @@ -2179,7 +2182,11 @@ static void sci_reset(struct uart_port *port) setup_timer(&s->rx_fifo_timer, rx_fifo_timer_fn, (unsigned long)s); } else { - scif_set_rtrg(port, s->rx_trigger); + if (port->type == PORT_SCIFA || + port->type == PORT_SCIFB) + scif_set_rtrg(port, 1); + else + scif_set_rtrg(port, s->rx_trigger); } } }