Re: [External] Re: [PATCH] serial: 8250: fix panic due to PSLVERR
From: yunhui cui
Date: Mon Apr 07 2025 - 09:25:13 EST
Hi Andy,
On Fri, Apr 4, 2025 at 6:58 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> On Fri, Apr 04, 2025 at 10:44:09AM +0800, yunhui cui wrote:
> > On Thu, Apr 3, 2025 at 7:36 PM Andy Shevchenko
> > <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > > On Thu, Apr 03, 2025 at 05:03:36PM +0800, Yunhui Cui wrote:
>
> ...
>
> > > > To resolve this issue, relevant serial_port_out operations should be
> > >
> > > serial_port_out()
> >
> > Okay.
> >
> > >
> > > > placed in a critical section, and UART_RX data should only be read
> > > > when the UART_LSR DR bit is set.
> > >
> > > The last one is made in the common code, are you sure that all supported UARTs
> > > will be okay with such a change?
> >
> > This change enhances code robustness without being intrusive.
>
> It is intrusive as it touches the core part affecting basically
> _all_ of the 8250-based drivers.
>
> Yes, it's small, but still it needs to be done carefully with commit message
> pointing out to the other 8250 datasheets to show that this is _not_ DW
> specific change.
serial8250_clear_fifos is already part of the serial8250_do_startup
process. The purpose of adding it to the critical section is to
prevent the FIFO from being cleared while the UART is in use.
Similarly, serial_port_out(port, UART_LCR, UART_LCR_WLEN8);
It is a correct logic to check if the data is ready before reading,
which prevents the FIFO from being enabled by other CPUs before
executing serial_port_in(port, UART_RX).
>
> ...
>
> > > > Panic message:
> > >
> > > Please, read this
> > > https://www.kernel.org/doc/html/latest/process/submitting-patches.html#backtraces-in-commit-messages
> > > and act accordingly.
> >
> > Okay, I'll update the next version to follow the guideline: 'Avoid
> > directly copying full dmesg output (e.g., timestamps, registers, and
> > stack dumps); instead, extract the critical call chain.'
>
> and make it short, e.g. ~3-5 lines only.
Okay.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Thanks,
Yunhui