From patchwork Thu Mar 17 13:47:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 8611151 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B36CAC0553 for ; Thu, 17 Mar 2016 13:47:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE85D201F5 for ; Thu, 17 Mar 2016 13:47:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF8202035E for ; Thu, 17 Mar 2016 13:47:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936114AbcCQNrf (ORCPT ); Thu, 17 Mar 2016 09:47:35 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:54728 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936064AbcCQNrd (ORCPT ); Thu, 17 Mar 2016 09:47:33 -0400 Received: from ayla.of.borg ([84.195.106.123]) by andre.telenet-ops.be with bizsmtp id X1nU1s00S2fm56U011nUb0; Thu, 17 Mar 2016 14:47:29 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1agYGu-0001Bv-F6; Thu, 17 Mar 2016 14:47:28 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1agYGx-0003Df-2X; Thu, 17 Mar 2016 14:47:31 +0100 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Jiri Slaby , Peter Hurley , Magnus Damm Cc: Laurent Pinchart , Yoshinori Sato , linux-serial@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 3/5] serial: sh-sci: Always set TIOCM_CTS in .get_mctrl() callback Date: Thu, 17 Mar 2016 14:47:27 +0100 Message-Id: <1458222449-12324-4-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458222449-12324-1-git-send-email-geert+renesas@glider.be> References: <1458222449-12324-1-git-send-email-geert+renesas@glider.be> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Documentation/serial/driver clearly states: If the port does not support CTS, DCD or DSR, the driver should indicate that the signal is permanently active. Hence always set TIOCM_CTS, as we currently don't look at the CTS hardware line state at all. FWIW, this fixes the transmit path when hardware-assisted flow control is enabled, and userspace enables CRTSCTS. The receive path is still broken, as RTS is never asserted. Signed-off-by: Geert Uytterhoeven --- drivers/tty/serial/sh-sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 0130feb069aee02f..135f836642ab1c5a 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1835,9 +1835,9 @@ static unsigned int sci_get_mctrl(struct uart_port *port) { /* * CTS/RTS is handled in hardware when supported, while nothing - * else is wired up. Keep it simple and simply assert DSR/CAR. + * else is wired up. Keep it simple and simply assert CTS/DSR/CAR. */ - return TIOCM_DSR | TIOCM_CAR; + return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; } static void sci_break_ctl(struct uart_port *port, int break_state)