Received: by 10.192.165.156 with SMTP id m28csp1251762imm; Wed, 18 Apr 2018 06:47:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+X23EnbtGqLlGavq+caiFykNGZ1M7Ak2swt36raHqQ57tTsJ8NJFdYeP+/GfhJpXvbrJNZ X-Received: by 10.99.127.86 with SMTP id p22mr1842261pgn.306.1524059274438; Wed, 18 Apr 2018 06:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524059274; cv=none; d=google.com; s=arc-20160816; b=m0NtbzLCwPUA4eERx+hjP7xoF5qlcG+jbanqXA1JEtfmww3gOirS/ZwTDZGIMr0v3v WGo98zpLj5ezae7PbMO4d7Ad89P4F8zp5p/+b4aP+voNapjIAdTIhXND7sGXOfcqNIg7 ihAqOAcZQyeRfPi4Cos3hNigQx2vg+zcyDfd4mcos3bNphxoDLDS5eQJF3rzLQQWYMZQ KPXd+VzwCX91x40f3tGbPVZhfJQ1ADyB49E9NQI39rBWxMwhq0xqVrCxM5GFtn5a6sLb TMu7Qkhpa3BQq6vmY0yP2BIPgUy3/aUrs56FgI1FSlMz/1ISGYvugvADqPYtPUbIsUAt vpvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=BCpR05y4eBzZcYEJy9/XQr9FC7UoP3bWtgBVvP+UmiE=; b=f5sOriZ5fBb05M5P2HYWWIn4BI939CsHMouTVSi2i3MgQ+D+q6HUkt7qMOjHEUmvks gZh25cSkzDlB0YFB3J+5XNUUOLqV5d644hDBIgcVmLz8k7MUuSb9eU7OFtR6LlzRuUpN dTyHUtNRPwKUhpzFzt7d1e3FisYzmF+1HNrZJk+Egeobfpd/b5zO1IeqP1M+dffHSRDl WPjGhLBFfjeaxEnoI7oBsPEf5GrOKHc049bJAdSMr587WF1mAQPLxlW8oPyUYeKLNGyV IMe4lMW/hSljc96eQJZgolKsLFugm/MN7ce2odeepm0rJS7zx/WwQwLz7+4aLUYKSeOO oGVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15-v6si1246431plr.310.2018.04.18.06.47.38; Wed, 18 Apr 2018 06:47:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752696AbeDRNqa (ORCPT + 99 others); Wed, 18 Apr 2018 09:46:30 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:60577 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751431AbeDRNq3 (ORCPT ); Wed, 18 Apr 2018 09:46:29 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8nPi-00076S-Df; Wed, 18 Apr 2018 15:46:22 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1f8nPf-000825-1T; Wed, 18 Apr 2018 15:46:19 +0200 Date: Wed, 18 Apr 2018 15:46:19 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Stefan Agner Cc: gregkh@linuxfoundation.org, lukas@wunner.de, jslaby@suse.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: imx: warn user when using unsupported configuration Message-ID: <20180418134619.xubgmbiezzlzbay3@pengutronix.de> References: <20180418133217.14568-1-stefan@agner.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180418133217.14568-1-stefan@agner.ch> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Stefan, On Wed, Apr 18, 2018 at 03:32:17PM +0200, Stefan Agner wrote: > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > index 91f3a1a5cb7f..1ba7e98ddc76 100644 > --- a/drivers/tty/serial/imx.c > +++ b/drivers/tty/serial/imx.c > @@ -1833,6 +1833,10 @@ static int imx_uart_rs485_config(struct uart_port *port, > rs485conf->flags &= ~SER_RS485_ENABLED; > > if (rs485conf->flags & SER_RS485_ENABLED) { > + /* Enable receiver if low-active RTS signal is requested */ > + if (rs485conf->flags & SER_RS485_RTS_AFTER_SEND) > + rs485conf->flags |= SER_RS485_RX_DURING_TX; > + this is wrong if RTS is driven by a GPIO. > /* disable transmitter */ > ucr2 = imx_uart_readl(sport, UCR2); > if (rs485conf->flags & SER_RS485_RTS_AFTER_SEND) > @@ -2265,6 +2269,17 @@ static int imx_uart_probe(struct platform_device *pdev) > (!sport->have_rtscts && !sport->have_rtsgpio)) > dev_err(&pdev->dev, "no RTS control, disabling rs485\n"); > > + /* > + * The RTS (CTS_B) signal cannot be set low during transmission > + * in case the receiver is off (limitation of the i.MX UART IP). > + */ > + if (sport->port.rs485.flags & SER_RS485_ENABLED && sport->have_rtscts && > + (!(sport->port.rs485.flags & SER_RS485_RTS_ON_SEND) && > + !(sport->port.rs485.flags & SER_RS485_RX_DURING_TX))) > + dev_err(&pdev->dev, > + "low-active RTS not possible when receiver is off, " > + "enabling receiver\n"); If you have the choice between breaking a user visible string and a code line >80 chars, please pick the latter. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |