From: sashiko-bot@kernel.org
To: "Damon Ding" <damon.ding@rock-chips.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 14/18] drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind
Date: Fri, 13 Nov 2026 08:50:23 +0000 [thread overview]
Message-ID: <sashiko-outbox-212466@kernel.org> (raw)
In-Reply-To: <20261113082305.541652-15-damon.ding@rock-chips.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/bridge: analogix_dp: IRQ storm and unclocked MMIO on PM
suspend
--
commit a4a512968af1f8f658769af2378618f972e953d9
Author: Damon Ding <damon.ding@rock-chips.com>
drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind
This commit moves enable_irq() and disable_irq() from the bridge enable and
disable callbacks to analogix_dp_bind() and analogix_dp_unbind(), and
converts the interrupt handler to a threaded handler that acquires a
runtime PM reference.
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index b14a8aa12394e..7f6346d45a01c 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -700,24 +700,25 @@ static int analogix_dp_enable_scramble(struct analogix_dp_device *dp,
> return ret < 0 ? ret : 0;
> }
>
> -static irqreturn_t analogix_dp_hardirq(int irq, void *arg)
> -{
> - struct analogix_dp_device *dp = arg;
> - irqreturn_t ret = IRQ_NONE;
> - u32 irq_type;
> -
> - irq_type = analogix_dp_get_irq_type(dp);
> - if (irq_type)
> - ret = IRQ_WAKE_THREAD;
> -
> - return ret;
> -}
> -
> static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
> {
> struct analogix_dp_device *dp = arg;
> u32 irq_type;
> bool hpd_detected;
> + int ret;
> +
> + /*
> + * The device may have been runtime suspended since the interrupt was
> + * raised. Hold a runtime PM reference before touching the registers,
> + * as the controller clocks are only guaranteed to be enabled while
> + * the device is runtime PM active. The GPIO HPD mode needs no such
> + * reference, since it only reads the GPIO level.
> + */
> + if (!dp->hpd_gpiod) {
> + ret = pm_runtime_resume_and_get(dp->dev);
> + if (ret)
> + return IRQ_HANDLED;
> + }
>
> irq_type = analogix_dp_get_irq_type(dp);
> if (!dp->hpd_gpiod && irq_type)
[Severity: High]
Can analogix_dp_irq_thread() race with pm_runtime_force_suspend() during
system sleep, or trigger an interrupt storm when pm_runtime_resume_and_get()
fails?
Both rockchip_dp_pm_ops and exynos_dp_pm_ops use DEFINE_RUNTIME_DEV_PM_OPS(),
which wires pm_runtime_force_suspend() and pm_runtime_force_resume() as the
system sleep callbacks. Previously, analogix_dp_bridge_disable() called
disable_irq(dp->irq) during drm_mode_config_helper_suspend() before
pm_runtime_force_suspend() ran. Keeping dp->irq enabled across bind/unbind
leaves the interrupt active during dpm_suspend() and dpm_resume():
CPU0 CPU1
analogix_dp_irq_thread()
pm_runtime_resume_and_get(dp->dev)
pm_runtime_force_suspend(dp->dev)
pm_runtime_disable(dp->dev)
...
analogix_dp_suspend(dp)
clk_disable_unprepare(dp->clock)
analogix_dp_get_irq_type(dp)
readl(dp->reg_base + ...) <-- unclocked MMIO access
pm_runtime_disable() waits for in-flight runtime PM transitions, not active
usage_count holders, so analogix_dp_suspend() gates the controller clocks
while analogix_dp_irq_thread() accesses registers, causing an external abort
on ARM64. In addition, when pm_runtime_need_not_resume() is false during
pm_runtime_force_suspend() (whenever usage_count > 1), the clocks are turned
off without setting the runtime status to RPM_SUSPENDED; if an interrupt
fires before suspend_device_irqs() or after resume_device_irqs(),
pm_runtime_resume_and_get() sees RPM_ACTIVE and returns 0 while the clocks
are still gated.
Separately, when dp->dev is runtime-suspended and pm_runtime_resume_and_get()
fails (for example, returning -EACCES while runtime PM is disabled by
pm_runtime_force_suspend()), returning IRQ_HANDLED without clearing the
level-triggered interrupt status causes irq_finalize_oneshot() to unmask the
still-asserted IRQ line, re-triggering analogix_dp_irq_thread() in a tight
loop while preventing the spurious IRQ detector from disabling the line.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113082305.541652-1-damon.ding@rock-chips.com?part=14
next prev parent reply other threads:[~2026-11-13 8:50 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 8:22 [PATCH v6 00/18] Add HPD support for Rockchip Analogix DP Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 01/18] drm/bridge: Select VIDEOMODE_HELPERS for DRM_OF_DISPLAY_MODE_BRIDGE Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 02/18] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 03/18] drm/bridge: analogix_dp: Restrict forced connected status to panel endpoints Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 04/18] drm/bridge: analogix_dp: Return bitmask from analogix_dp_get_irq_type() Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 05/18] drm/bridge: analogix_dp: Check all negative return values for &analogix_dp_device.irq Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 06/18] drm/bridge: analogix_dp: Add IRQF_ONESHOT and simplify IRQ handling Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:40 ` sashiko-bot
2026-11-13 8:22 ` [PATCH v6 07/18] drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ bitmask Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 08/18] drm/bridge: analogix_dp: Extend mute/unmute HPD interrupts to accept irq bitmask Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 09/18] drm/bridge: analogix_dp: Simplify analogix_dp_config_interrupt() Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 10/18] drm/bridge: analogix_dp: Use platform-specific HPD detection scheme Damon Ding
2026-11-13 8:22 ` [PATCH v6 11/18] drm/bridge: analogix_dp: Skip native HPD interrupt ops for GPIO HPD Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:22 ` [PATCH v6 12/18] drm/rockchip: analogix_dp: Unbind bridge when connector init fails Damon Ding
2026-11-13 8:22 ` Damon Ding
2026-11-13 8:36 ` sashiko-bot
2026-11-13 8:23 ` [PATCH v6 13/18] drm/exynos: exynos_dp: " Damon Ding
2026-11-13 8:23 ` Damon Ding
2026-11-13 8:48 ` sashiko-bot
2026-11-13 8:23 ` [PATCH v6 14/18] drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind Damon Ding
2026-11-13 8:23 ` Damon Ding
2026-11-13 8:50 ` sashiko-bot [this message]
2026-11-13 8:23 ` [PATCH v6 15/18] drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin detection Damon Ding
2026-11-13 8:23 ` Damon Ding
2026-11-13 8:23 ` [PATCH v6 16/18] drm/bridge: analogix_dp: Declare DRM_BRIDGE_OP_HPD for hotplug reporting Damon Ding
2026-11-13 8:23 ` Damon Ding
2026-11-13 8:44 ` sashiko-bot
2026-11-13 8:23 ` [PATCH v6 17/18] drm/bridge: analogix_dp: Handle HPD notification from downstream bridge Damon Ding
2026-11-13 8:23 ` Damon Ding
2026-11-13 8:49 ` sashiko-bot
2026-11-13 8:23 ` [PATCH v6 18/18] MAINTAINERS: Add entry for Analogix DP controller bridge Damon Ding
2026-11-13 8:23 ` Damon Ding
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-212466@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=damon.ding@rock-chips.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.