Re: [PATCH v1 23/31] serial: 8250_mxpcie: defer uart_write_wakeup to workqueue
From: Andy Shevchenko
Date: Sun Nov 30 2025 - 21:06:08 EST
On Sun, Nov 30, 2025 at 12:45 PM Crescent Hsieh
<crescentcy.hsieh@xxxxxxxx> wrote:
>
> When the TX FIFO drops below WAKEUP_CHARS, mxpcie used to call
> uart_write_wakeup() directly from the interrupt path. Move this into a
> per-port work item so we avoid doing TTY wakeups in interrupt context and
> reduce IRQ-side work.
>
> Changes:
> - Add per-port state (event_flags, work, cached uport pointer).
> - In tx_chars(), set a TXLOW event and schedule the per-port work instead
> of calling uart_write_wakeup() directly.
> - The work handler test-and-clear the TXLOW bit and calls
> uart_write_wakeup().
>
> This keeps IRQ handlers lightweight and avoids potential locking or RT
> latency issues while preserving existing behavior.
>
> Note: removal path must cancel pending works before unregistering ports.
...
> + struct pci_dev *pdev = to_pci_dev(port->dev);
> + struct mxpcie8250 *priv = pci_get_drvdata(pdev);
dev_get_drvdata();
--
With Best Regards,
Andy Shevchenko