Re: [PATCH v5] serial: 8250_omap: clear rx_running on zero-length DMA completes

From: andriy.shevchenko@xxxxxxxxxxxxxxx

Date: Mon Jun 08 2026 - 07:43:19 EST


On Mon, Jun 08, 2026 at 11:00:44AM +0000, Matthias Feser wrote:
> On Tue, Jun 02, 2026, Andy Shevchenko wrote:
> > I'm wondering if this opens a window when dma->rx_buf may be
> > rewritten (or unmapped or something else) before tty layer has
> > a chance to insert bytes to its ring buffer. I.o.w. is this
> > change synchronous to other threads?
>
> Good point.
>
> RX DMA can be started from the DMA callback, the IRQ path, and
> runtime resume. These paths appear to be protected by the same
> driver locking.
>
> At the point where rx_running is cleared, DMA has already been
> terminated.
>
> So I don't see a window where rx_buf could be overwritten, but
> please let me know if there is a path where this could happen.

I don't see either, that's why I was wondering. Btw, does AI notice
anything of a such? I haven't checked Sashiko myself, others may
have also run some other AI tools for that.

--
With Best Regards,
Andy Shevchenko