[PATCH] [RFC] serial: stm32: Move stm32_usart_transmit_chars() to interrupt thread

Sebastian Andrzej Siewior bigeasy at linutronix.de
Wed Dec 7 09:54:30 PST 2022


On 2022-12-07 17:55:42 [+0100], Marek Vasut wrote:
> 
> Is the suggestion therefore to completely remove the hard IRQ handler and
> move everything into the threaded IRQ handler ?

Commit
	3489187204eb7 ("serial: stm32: adding dma support")

added the threaded mode with DMA support. It didn't say _why_ this is
needed. So I would suggest to use request_irq() and merge the two
handler. The part where it ignores the IRQ handler in the
"stm32_port->throttled" case isn't nice since it returns IRQ_HANDLED
while doing nothing.

> Are there any drawbacks of doing that to a serial port driver ?
The threaded handler runs with disabled interrupts (due to irq-save
lock) so there shouldn't be any visible difference other than the thread
is gone. I'm not sure what the benefit here actually is.
With `threadirqs' and so on PREEMPT_RT the whole routine will be moved
in the thread (as it should).

Looking at drivers/tty/serial/, the stm32-usart is the only one
requesting threaded-interrupts with a primary handler. So I guess it was
not needed to begin with.

Sebastian



More information about the linux-arm-kernel mailing list