[PATCH] dmaengine: milbeaut-hdmac: Fix deadlock with the channel IRQ handler

Vinod Koul vkoul at kernel.org
Fri Nov 20 01:29:49 PST 2026


On 23-09-26, 17:44, Ginger Li wrote:
> milbeaut_hdmac_interrupt() is a hardirq handler and takes mc->vc.lock with a
> plain spin_lock() for the whole time it runs.  interrupts are disabled locally
> in that context, so the handler itself is fine.
> 
> milbeaut_hdmac_chan_config(), milbeaut_hdmac_chan_pause() and
> milbeaut_hdmac_chan_resume() are called from process context and take the same
> lock with a plain spin_lock() as well, so interrupts stay enabled while the
> lock is held.
> 
> If a channel interrupt is delivered on the CPU that is inside one of those
> critical sections, milbeaut_hdmac_interrupt() spins on a lock that the
> interrupted code is holding and can never release, and the CPU hangs.
> 
> Take mc->vc.lock with spin_lock_irqsave() in those three functions, as
> milbeaut_hdmac_issue_pending() and the other process context users of this
> lock already do.

Have you seen this deadlock in reallife, any logs?

-- 
~Vinod



More information about the Linux-mediatek mailing list