[PATCH v6 18/22] drm: bridge: dw_hdmi: Use delayed_work to debounce hotplug event
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sat May 16 12:42:59 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Removing the top-level interrupt mute in the remove path leaves already-latched interrupts unmasked, causing an unhandled interrupt storm after the IRQ is freed.
--
commit 0025156a478e265d2ea625b34b904b8645d80bed
Author: Jonas Karlman <jonas at kwiboo.se>
drm: bridge: dw_hdmi: Use delayed_work to debounce hotplug event
This commit uses a delayed work queue to debounce HDMI hotplug detect events,
improving the handling of HPD low voltage level pulses. It also updates
the driver remove path to explicitly mask the PHY interrupt and free the
IRQ handler earlier during cleanup.
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
[ ... ]
> @@ -3531,6 +3592,14 @@ EXPORT_SYMBOL_GPL(dw_hdmi_probe);
>
> void dw_hdmi_remove(struct dw_hdmi *hdmi)
> {
> + struct platform_device *pdev = to_platform_device(hdmi->dev);
> + int irq = platform_get_irq(pdev, 0);
> +
> + /* Disable cable hot plug irq. */
> + hdmi_writeb(hdmi, ~0, HDMI_PHY_MASK0);
> + devm_free_irq(hdmi->dev, irq, hdmi);
> + cancel_delayed_work_sync(&hdmi->hpd_work);
> +
> drm_bridge_remove(&hdmi->bridge);
>
> if (hdmi->audio && !IS_ERR(hdmi->audio))
> @@ -3538,9 +3607,6 @@ void dw_hdmi_remove(struct dw_hdmi *hdmi)
> if (!IS_ERR(hdmi->cec))
> platform_device_unregister(hdmi->cec);
>
> - /* Disable all interrupts */
> - hdmi_writeb(hdmi, ~0, HDMI_IH_MUTE_PHY_STAT0);
> -
Can removing the top-level interrupt mute cause an unhandled interrupt storm?
While writing to HDMI_PHY_MASK0 stops the PHY from latching new interrupts,
it does not clear interrupts that are already latched in the
HDMI_IH_PHY_STAT0 register. Because the top-level HDMI_IH_MUTE_PHY_STAT0
mute is no longer applied, any previously latched interrupt might continue
to assert the physical IRQ line.
Immediately after writing the mask earlier in the function, devm_free_irq()
removes the driver's handler from the IRQF_SHARED line. With the handler
removed, the kernel will not invoke dw_hdmi_hardirq() to clear the device's
pending interrupt.
Since the interrupt controller might see the line continuously asserted,
other drivers sharing the IRQ would return IRQ_NONE. Could this lead to the
kernel logging an 'irq nobody cared' error and permanently disabling the
shared IRQ line, breaking other devices?
Would it be safer to restore the HDMI_IH_MUTE_PHY_STAT0 write to guarantee
the IRQ line drops before the handler is freed?
> if (hdmi->i2c)
> i2c_del_adapter(&hdmi->i2c->adap);
> else
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260516183838.2024991-1-jonas@kwiboo.se?part=18
More information about the linux-amlogic
mailing list