[PATCH v2] drm/mediatek: dsi: Don't let a signal cut the IRQ wait short
Chun-Kuang Hu
chunkuang.hu at kernel.org
Wed Dec 2 15:36:50 PST 2026
Zi-Hao Huang via B4 Relay
<devnull+zi-hao.huang.mediatek.com at kernel.org> 於 2026年11月18日週三
上午9:33寫道:
>
> From: Zi-Hao Huang <zi-hao.huang at mediatek.com>
>
> mtk_dsi_wait_for_irq_done() waits for the DSI IRQ with
> wait_event_interruptible_timeout(). If it returns early, for example
> with -ERESTARTSYS when a signal is pending, both callers still treat the
> command as done, because they only handle a return value of 0 as a
> failure.
>
> On an MT8196 board this led to a hard lockup during shutdown. The wait
> returned before the IRQ arrived, the panel disable sequence went on and
> restarted video mode, and the late CMD_DONE interrupt was then handled
> by mtk_dsi_irq(). The handler writes RACK and loops until DSI_BUSY
> clears, but DSI_BUSY stays set while video mode is running, so the CPU
> never leaves the handler until the watchdog fires. Forcing the wait to
> return early reproduces the lockup every time, and it no longer
> happens once the wait cannot return early.
>
> The wait synchronises the driver with the hardware, and it is bounded by
> its timeout. Use wait_event_timeout() so that it only ends on the IRQ or
> the timeout.
>
> wake_up_interruptible() cannot wake a task in uninterruptible sleep, so
> switch mtk_dsi_irq() to wake_up(). Without it every wait would last
> until its timeout.
Applied to mediatek-drm-fixes [1], thanks.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-fixes
Regards,
Chun-Kuang.
>
> Fixes: dd5080a54df8 ("drm/mediatek: add dsi interrupt control")
> Signed-off-by: Zi-Hao Huang <zi-hao.huang at mediatek.com>
> Reviewed-by: CK Hu <ck.hu at mediatek.com>
> ---
> Changes in v2:
> - Drop the remark that the wait is not made on behalf of userspace, since
> a userspace backlight change can reach it (CK)
> - Collect Reviewed-by
> - Link to v1: https://lore.kernel.org/r/20261118-mtk-dsi-irq-wait-v1-1-205f25fac8b2@mediatek.com
> ---
More information about the linux-arm-kernel
mailing list