Thread (8 messages) 8 messages, 3 authors, 2017-01-11

Re: [PATCH 1/2] serial: sh-sci: Fix early deassertion of dedicated RTS

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: 2017-01-09 11:57:53
Also in: linux-renesas-soc, lkml

Hi Geert,

On Monday 09 Jan 2017 10:53:55 Geert Uytterhoeven wrote:
On Fri, Jan 6, 2017 at 1:30 PM, Laurent Pinchart wrote:
quoted
On Friday 02 Dec 2016 13:35:10 Geert Uytterhoeven wrote:
quoted
If a UART has dedicated RTS/CTS pins, there are some issues:
1. When changing hardware control flow, the new AUTORTS state is not
   immediately reflected in the hardware, but only when RTS is raised.
   However, the serial core doesn't call .set_mctrl() after
   .set_termios(), hence AUTORTS may only become effective when the port
   is closed, and reopened later.
   Note that this problem does not happen when manually using stty to
   change CRTSCTS, as AUTORTS will work fine on next open.

2. When hardware control flow is disabled (or AUTORTS is not yet
   effective), changing any serial port configuration deasserts RTS, as
   .set_termios() calls sci_init_pins().
Isn't this still a problem with this patch applied ? Calling
sci_set_mctrl() should reconfigure the pins properly, but won't there be
a short window during which the configuration will be wrong ?
You mean in between the calls to sci_init_pins() and sci_set_mctrl()?
That's what I mean, yes.
I don't think _de_asserting RTS for a few microseconds matters much, would
it? Asserting RTS wrongly would be worse.
It's not the end of the world, but as you're trying to fix this issue, maybe 
it would be a good time to refactor the code properly and fix the core problem 
(.set_termios() calling sci_init_pins()) rather than working around it :-)

-- 
Regards,

Laurent Pinchart
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help