Re: [PATCH] serial: msm: Disable DMA for kernel console UART
From: Konrad Dybcio
Date: Tue Jul 07 2026 - 04:10:33 EST
On 7/6/26 8:03 PM, Stephan Gerhold wrote:
> At the moment, concurrent writes from userspace and the kernel to the
> console can trigger a race condition that results in an infinite loop of
> the same messages printed over and over again. This is most likely to
> happen during system startup or shutdown when the init system starts/stops
> a large number of system services that interact with various kernel code.
>
> When userspace writes to the TTY device, the driver initiates an
> asynchronous DMA transfer and releases the port lock. At the same moment,
> the kernel printk path might grab the port lock and re-configure the UART
> controller for PIO, without waiting for the DMA operation to complete. It
> seems like this collision results in zero progress being reported for the
> DMA engine, so the same text is printed to the console over and over again.
>
> For the kernel console, we want a reliable output path that will be
> functional even during crashes etc. So rather than implementing complex
> code to synchronize the kernel console write routines with the userspace
> DMA write routines, simply disable DMA for the console UART instance.
>
> Similar checks exist in many other serial drivers, e.g. 8250_port.c,
> imx.c, sh-sci.c etc.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 3a878c430fd6 ("tty: serial: msm: Add TX DMA support")
> Signed-off-by: Stephan Gerhold <stephan.gerhold@xxxxxxxxxx>
> ---
Acked-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
Konrad