[PATCH v5 2/2] serial: mxc: have putc use the TXFIFO

Fabio Estevam festevam at gmail.com
Thu Nov 3 12:14:24 CET 2022


On Thu, Nov 3, 2022 at 3:17 AM SCHNEIDER Johannes
<johannes.schneider at leica-geosystems.com> wrote:
>
> Hi all,
>
> flushing and waiting... maybe you're onto something: what if one printf races another since it thinks considers its buffer handed to the FIFO as "done" a bit too soon?
>
> might the below variation on "waiting for the fifo" solve the symptoms on imx6?
>
> regards
> Johannes
>
>
> diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c
> index 4207650503..dfd7670f7e 100644
> --- a/drivers/serial/serial_mxc.c
> +++ b/drivers/serial/serial_mxc.c
> @@ -329,8 +329,23 @@ static int mxc_serial_pending(struct udevice *dev, bool input)
>                 return sr2 & USR2_TXDC ? 0 : 1;
>  }
>
> +static ssize_t mxc_serial_puts(struct udevice *dev, const char *s, size_t len)
> +{
> +       struct mxc_serial_plat *plat = dev_get_plat(dev);
> +       struct mxc_uart *const uart = plat->reg;
> +
> +       while (*s)
> +               mcx_serial_putc(dev, *s++);

There is a typo here: it should be mxc_serial_putc() instead.

No, it does not fix the issue.

Not sure why you mentioned imx6. The issue can be reproduced on imx8mm as well.


More information about the U-Boot mailing list