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

From: Andy Shevchenko
Date: Wed Dec 07 2016 - 06:10:00 EST


On Tue, 2016-12-06 at 14:34 -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.
>

It should not affect Intel HW since we are using clock for it (see
drivers/mfd/intel-lpss-pci.c, drivers/acpi/acpi_lpss.c).

Thus, I'm okay with the change.

> Reviewed-by: Scott Branden <scott.branden@xxxxxxxxxxxx>
> Reviewed-by: Ray Jui <ray.jui@xxxxxxxxxxxx>
> Signed-off-by: Jason Uy <jason.uy@xxxxxxxxxxxx>
> ---
> Â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 459d726..18f1f8b 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -246,11 +246,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);
> Â}
> Â
> @@ -308,13 +308,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;
> @@ -392,6 +390,7 @@ static int dw8250_probe(struct platform_device
> *pdev)
> Â p->iotype = UPIO_MEM;
> Â p->serial_in = dw8250_serial_in;
> Â p->serial_out = dw8250_serial_out;
> + p->set_termios = dw8250_set_termios;
> Â
> Â p->membase = devm_ioremap(dev, regs->start,
> resource_size(regs));
> Â if (!p->membase)

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy