[bug report] Potential deadlock bug in 'drivers/dma/mediatek/mtk-hsdma.c', between 'mtk_hsdma_irq()' and 'mtk_hsdma_free_active_desc()'

Ginger ginger.jzllee at gmail.com
Fri Apr 24 01:49:23 PDT 2026


Dear Linux kernel maintainers,

My research-based static analyzer found a potential deadlock bug
within the ''drivers/dma/mediatek' subsystem, more specifically, in
''drivers/dma/mediatek/mtk-hsdma.c'.
This deadlock potentially occurs with the involvement of hard irq.

Kernel version: long-term kernel v6.18.9

Potential concurrent triggering executions:
T0:
mtk_hsdma_irq [t1]
       --> mtk_hsdma_free_rooms_in_ring
             --> spin_lock(&hvc->vc.lock); [t2]

T1:
mtk_hsdma_free_active_desc
    --> spin_lock(&hvc->vc.lock); [t0]

T1 can run in the normal process context and does not disable hardware
irqs in acquiring the spin lock. If T0 (i.e., the hard irq context)
occurs after T1 acquires the lock and both happen within the same CPU,
then T0 will not proceed because it cannot hold the spin lock that has
already been possessed by T1, yet T1 cannot proceed because the hard
irq runs disables preempts.

Thank you for your time and consideration.

Best regards,
Ginger



More information about the Linux-mediatek mailing list