[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve8tgYZAJB=ECq2O1ZZshFaD6EHvSH7hUt4XjQK445Wzw@mail.gmail.com>
Date: Mon, 1 Dec 2025 04:06:39 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Crescent Hsieh <crescentcy.hsieh@...a.com>
Cc: gregkh@...uxfoundation.org, jirislaby@...nel.org,
ilpo.jarvinen@...ux.intel.com, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org
Subject: Re: [PATCH v1 24/31] serial: 8250_mxupci: defer uart_write_wakeup to workqueue
On Sun, Nov 30, 2025 at 12:45 PM Crescent Hsieh
<crescentcy.hsieh@...a.com> 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 mxupci8250 *priv = pci_get_drvdata(pdev);
dev_get_drvdata();
...
> +static void mxupci8250_work_handler(struct work_struct *work)
> +{
> + struct mxupci8250_port *priv_port = container_of(work, struct mxupci8250_port, work);
> +
> + if (test_and_clear_bit(MOXA_EVENT_TXLOW, &priv_port->event_flags))
> + uart_write_wakeup(priv_port->uport);
> +
Stray new line.
> +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists