Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1556873

Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used
Date Wed, 11 Jan 2017 21:00:01 +0100
Message-ID <sYxdT-2C4-7@gated-at.bofh.it> (permalink)
References <sYx4e-2yO-43@gated-at.bofh.it> <sYx4e-2yO-45@gated-at.bofh.it>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="807757344"
Organization Intel Finland Oy
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.22.3-1
MIME-Version 1.0
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 72
X-Original-Cc Kefeng Wang <wangkefeng.wang@huawei.com>, Noam Camus <noamc@ezchip.com>, Heikki Krogerus <heikki.krogerus@linux.intel.com>, Wang Hongcheng <annie.wang@amd.com>, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com
X-Original-Date Wed, 11 Jan 2017 21:53:12 +0200
X-Original-Message-ID <1484164392.2133.74.camel@linux.intel.com>
X-Original-References <1484164100-9805-1-git-send-email-jason.uy@broadcom.com> <1484164100-9805-2-git-send-email-jason.uy@broadcom.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1556873

Show key headers only | View raw


On Wed, 2017-01-11 at 11:48 -0800, Jason Uy wrote:
> In the most common use case, the Synopsys DW UART driver does not
> set the set_termios callback function.  This prevents UPSTAT_AUTOCTS
> from being set when the UART flag CRTSCTS is set.  As a result, the
> driver will use software flow control as opposed to hardware flow
> control.
> 
> To fix the problem, the set_termios callback function is set to the
> DW specific function.  The logic to set UPSTAT_AUTOCTS is moved so
> that any clock error will not affect setting the hardware flow
> control.
> 
> Reviewed-by: Scott Branden <scott.branden@broadcom.com>
> Reviewed-by: Ray Jui <ray.jui@broadcom.com>

FWIW:
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Jason Uy <jason.uy@broadcom.com>
> ---
>  drivers/tty/serial/8250/8250_dw.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_dw.c
> b/drivers/tty/serial/8250/8250_dw.c
> index c89fafc..c89ae45 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -248,11 +248,11 @@ static void dw8250_set_termios(struct uart_port
> *p, struct ktermios *termios,
>  	if (!ret)
>  		p->uartclk = rate;
>  
> +out:
>  	p->status &= ~UPSTAT_AUTOCTS;
>  	if (termios->c_cflag & CRTSCTS)
>  		p->status |= UPSTAT_AUTOCTS;
>  
> -out:
>  	serial8250_do_set_termios(p, termios, old);
>  }
>  
> @@ -326,13 +326,11 @@ static void dw8250_quirks(struct uart_port *p,
> struct dw8250_data *data)
>  			p->serial_in = dw8250_serial_in32;
>  			data->uart_16550_compatible = true;
>  		}
> -		p->set_termios = dw8250_set_termios;
>  	}
>  
>  	/* Platforms with iDMA */
>  	if (platform_get_resource_byname(to_platform_device(p->dev),
>  					 IORESOURCE_MEM,
> "lpss_priv")) {
> -		p->set_termios = dw8250_set_termios;
>  		data->dma.rx_param = p->dev->parent;
>  		data->dma.tx_param = p->dev->parent;
>  		data->dma.fn = dw8250_idma_filter;
> @@ -414,6 +412,7 @@ static int dw8250_probe(struct platform_device
> *pdev)
>  	p->serial_in	= dw8250_serial_in;
>  	p->serial_out	= dw8250_serial_out;
>  	p->set_ldisc	= dw8250_set_ldisc;
> +	p->set_termios	= dw8250_set_termios;
>  
>  	p->membase = devm_ioremap(dev, regs->start,
> resource_size(regs));
>  	if (!p->membase)

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/1] Allow hardware flow control to be used Jason Uy <jason.uy@broadcom.com> - 2017-01-11 20:50 +0100
  [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be used Jason Uy <jason.uy@broadcom.com> - 2017-01-11 20:50 +0100
    Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to  be used Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-11 21:00 +0100
    Re: [PATCH v2 1/1] serial: 8250_dw: Allow hardware flow control to be  used Kefeng Wang <wangkefeng.wang@huawei.com> - 2017-01-13 02:40 +0100

csiph-web