Linux Serial subsystem development
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	Biju Das <biju.das.jz@bp.renesas.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	linux-serial <linux-serial@vger.kernel.org>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v4 5/5] tty: serial: sh-sci: Fix end of transmission on SCI
Date: Fri, 21 Apr 2023 15:53:33 +0300 (EEST)	[thread overview]
Message-ID: <1860434a-8915-3ea4-60e1-5f7d4598a16@linux.intel.com> (raw)
In-Reply-To: <CAMuHMdUQ05U9oiepVJsShg8xFoHTD6M7XczQ2=Qce+pE+0RPag@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]

On Fri, 21 Apr 2023, Geert Uytterhoeven wrote:

> Hi Biju,
> 
> On Wed, Apr 12, 2023 at 4:51 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > We need to set TE to "0" (i.e., disable serial transmission) to
> > get the expected behavior of the end of serial transmission.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/drivers/tty/serial/sh-sci.c
> > +++ b/drivers/tty/serial/sh-sci.c
> > @@ -847,6 +847,11 @@ static void sci_transmit_chars(struct uart_port *port)
> >                 } else if (!uart_circ_empty(xmit) && !stopped) {
> >                         c = xmit->buf[xmit->tail];
> >                         xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
> > +               } else if (port->type == PORT_SCI && uart_circ_empty(xmit)) {
> > +                       ctrl = serial_port_in(port, SCSCR);
> > +                       ctrl &= ~SCSCR_TE;
> > +                       serial_port_out(port, SCSCR, ctrl);
> > +                       return;
> 
> So nothing after the while loop should be done anymore?
> What about clearing SCSCR_TE in sci_stop_tx() (which is called after
> the while loop) instead?

Yes, this added fragment doesn't really seem to belong into the tx loop.

The right direction would be to aim towards converting the whole tx loop 
into using uart_port_tx_limited().

-- 
 i.

> >                 } else {
> >                         break;
> >                 }
> 
> So combined with my comments on patch 4/5, that would become
> 
> -    if (port->type == PORT_SCI)
> +    if (port->type == PORT_SCI) {
>              ctrl |= SCSCR_TEIE;
> +            ctrl &= ~SCSCR_TE;
> +    }
> 
> in sci_stop_tx().

  parent reply	other threads:[~2023-04-21 12:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 14:50 [PATCH v4 0/5] Add RZ/G2L SCIFA DMAC/ SCI TX support Biju Das
2023-04-12 14:50 ` [PATCH v4 1/5] tty: serial: sh-sci: Add RZ/G2L SCIFA DMA tx support Biju Das
2023-04-21  9:22   ` Geert Uytterhoeven
2023-04-21  9:56     ` Biju Das
2023-04-21 10:04       ` Geert Uytterhoeven
2023-04-12 14:50 ` [PATCH v4 2/5] tty: serial: sh-sci: Add RZ/G2L SCIFA DMA rx support Biju Das
2023-04-21  9:22   ` Geert Uytterhoeven
2023-04-12 14:50 ` [PATCH v4 3/5] tty: serial: sh-sci: Fix TE setting on SCI IP Biju Das
2023-04-21  9:28   ` Geert Uytterhoeven
2023-04-12 14:50 ` [PATCH v4 4/5] tty: serial: sh-sci: Add support for tx end interrupt handling Biju Das
2023-04-21  9:37   ` Geert Uytterhoeven
2023-04-21 10:46     ` Biju Das
2023-04-12 14:50 ` [PATCH v4 5/5] tty: serial: sh-sci: Fix end of transmission on SCI Biju Das
2023-04-21  9:49   ` Geert Uytterhoeven
2023-04-21 10:55     ` Biju Das
2023-04-21 12:53     ` Ilpo Järvinen [this message]
2023-04-24  7:06       ` Biju Das

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=1860434a-8915-3ea4-60e1-5f7d4598a16@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=ysato@users.sourceforge.jp \
    /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