Re: [PATCH v4 5/5] tty: serial: sh-sci: Fix end of transmission on SCI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Biju,

On Wed, Apr 12, 2023 at 4:51 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx>

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?

>                 } 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().

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux