linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Christoph Baumann <cbaumann@visteon.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] serial: sh-sci: Fix early deassertion of dedicated RTS
Date: Mon, 09 Jan 2017 13:57:40 +0200	[thread overview]
Message-ID: <164893846.trXPIhPmcX@avalon> (raw)
In-Reply-To: <CAMuHMdXfmjqQV6ms-Q21WaQUbEeKNyt5DZ89nV8rifWf-7Ypfg@mail.gmail.com>

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:
> > On Friday 02 Dec 2016 13:35:10 Geert Uytterhoeven wrote:
> >> 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

  reply	other threads:[~2017-01-09 11:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 12:35 [PATCH 0/2] serial: sh-sci: Assorted flow control fixes Geert Uytterhoeven
2016-12-02 12:35 ` [PATCH 1/2] serial: sh-sci: Fix early deassertion of dedicated RTS Geert Uytterhoeven
2017-01-06 12:30   ` Laurent Pinchart
2017-01-09  9:53     ` Geert Uytterhoeven
2017-01-09 11:57       ` Laurent Pinchart [this message]
2016-12-02 12:35 ` [PATCH 2/2] serial: sh-sci: Fix hang in sci_reset() Geert Uytterhoeven
2017-01-06 12:31   ` Laurent Pinchart
2017-01-11  9:04     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=164893846.trXPIhPmcX@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=cbaumann@visteon.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).