From: sashiko-bot@kernel.org
To: "Damon Ding" <damon.ding@rock-chips.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v1 6/7] drm/bridge: analogix_dp: Use platform-specific HPD detection scheme
Date: Thu, 30 Jul 2026 03:41:44 +0000 [thread overview]
Message-ID: <20260730034144.873BB1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260730032744.381566-7-damon.ding@rock-chips.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] DisplayPort short HPD pulses are completely filtered out by the 2ms hardware deglitch filter, breaking link loss detection and PSR.
- [High] Hotplug interrupt unmasking logic unintentionally re-enables PLUG and HPD_LOST interrupts on Rockchip platforms, defeating the patch's purpose.
--
--- Patch [6]: [PATCH v1 6/7] drm/bridge: analogix_dp: Use platform-specific HPD detection scheme ---
commit af35433f355c1427bbfdea612a689613337f11ab
Author: Damon Ding <damon.ding@rock-chips.com>
Date: Thu Jul 30 03:27:43 2026 +0000
drm/bridge: analogix_dp: Use platform-specific HPD detection scheme
This commit configures the HPD deglitch filter to 2ms on Rockchip platforms
and updates the interrupt handling to rely exclusively on the HOTPLUG_CHG
interrupt instead of the PLUG and HPD_LOST combination. The threaded IRQ
handler is also adjusted to evaluate platform-specific interrupt flags.
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index 9f6ecaa1aeb5e..b7aa10daae2f2 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -723,10 +723,15 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
> {
> struct analogix_dp_device *dp = arg;
> u32 irq_type;
> + bool hpd_detected;
>
> irq_type = analogix_dp_get_irq_type(dp);
> - if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
> - irq_type & DP_IRQ_TYPE_HP_CABLE_OUT) {
> + if (!dp->hpd_gpiod && analogix_dp_is_rockchip(dp->plat_data->dev_type))
> + hpd_detected = irq_type & DP_IRQ_TYPE_HP_CHANGE;
> + else
> + hpd_detected = (irq_type & DP_IRQ_TYPE_HP_CABLE_IN) ||
> + (irq_type & DP_IRQ_TYPE_HP_CABLE_OUT);
> + if (hpd_detected) {
[Severity: High]
Could this logic inadvertently re-enable the PLUG and HPD_LOST interrupts
that were intentionally masked during initialization?
When analogix_dp_get_irq_type() is called, it reads the raw interrupt
status register without checking against the active mask:
analogix_dp_get_irq_type() {
...
reg = readl(dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
if (reg & PLUG)
irq_type |= DP_IRQ_TYPE_HP_CABLE_IN;
if (reg & HPD_LOST)
irq_type |= DP_IRQ_TYPE_HP_CABLE_OUT;
...
}
If the hardware continues to set the PLUG and HPD_LOST status bits on cable
events even while they are masked, analogix_dp_get_irq_type() will still
return them in irq_type.
Later in analogix_dp_irq_thread(), this irq_type mask is passed to
analogix_dp_unmute_hpd_interrupt():
if (!dp->hpd_gpiod && irq_type) {
analogix_dp_clear_hotplug_interrupts(dp, irq_type);
analogix_dp_unmute_hpd_interrupt(dp, irq_type);
}
Would passing the unintentionally detected PLUG and HPD_LOST bits into
analogix_dp_unmute_hpd_interrupt() permanently unmask those interrupts,
defeating the platform-specific interrupt scheme on the very first event?
Additionally, because DP_IRQ_TYPE_IRQ_HPD is no longer included in the
hpd_detected calculation for Rockchip, will this prevent
drm_helper_hpd_irq_event() from being called to process link retraining
and Panel Self Refresh (PSR) events?
> dev_dbg(dp->dev, "Detected cable status changed!\n");
> if (dp->drm_dev)
> drm_helper_hpd_irq_event(dp->drm_dev);
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> index 42463e18f392c..981ce3810e90d 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
[ ... ]
> @@ -177,7 +177,21 @@ void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
> writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
> writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
>
> - analogix_dp_unmute_hpd_interrupt(dp, HPD_IRQ);
> + if (analogix_dp_is_rockchip(dp->plat_data->dev_type)) {
> + /*
> + * Either HOTPLUG_CHG interrupt or PLUG + HPD_LOST interrupt
> + * pair can be used to implement hotplug detection.
> + *
> + * On Rockchip platforms, configuring HPD deglitch to 2ms and
> + * using HOTPLUG_CHG interrupt for hotplug detection is proven
> + * as a better solution via engineering verification.
> + */
> + writel(0x80, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_L);
> + writel(0xbb, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_H);
[Severity: High]
Does configuring the deglitch filter to 2ms risk filtering out valid
DisplayPort short HPD pulses?
The DP specification defines short HPD pulses (which are used for sink
events like PSR and link retraining) as a low pulse lasting between 0.5ms
and 1.0ms.
Because the new 2ms filter configuration exceeds the maximum short pulse
duration of 1.0ms, will the hardware treat all valid DP short pulses as
noise and silently drop them before they can trigger an interrupt?
> + analogix_dp_unmute_hpd_interrupt(dp, DP_IRQ_TYPE_HP_CHANGE);
> + } else {
> + analogix_dp_unmute_hpd_interrupt(dp, HPD_IRQ);
> + }
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260730032744.381566-1-damon.ding@rock-chips.com?part=6
next prev parent reply other threads:[~2026-07-30 3:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 3:27 [PATCH v1 0/7] Add HPD support for Rockchip Analogix DP Damon Ding
2026-07-30 3:27 ` Damon Ding
2026-07-30 3:27 ` [PATCH v1 1/7] drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin detection Damon Ding
2026-07-30 3:27 ` Damon Ding
2026-07-30 3:39 ` sashiko-bot
2026-07-30 3:27 ` [PATCH v1 2/7] drm/bridge: analogix_dp: Return bitmask from analogix_dp_get_irq_type() Damon Ding
2026-07-30 3:27 ` Damon Ding
2026-07-30 3:41 ` sashiko-bot
2026-07-30 3:27 ` [PATCH v1 3/7] drm/bridge: analogix_dp: Extend mute/unmute HPD interrupts to accept irq bitmask Damon Ding
2026-07-30 3:27 ` Damon Ding
2026-07-30 3:41 ` sashiko-bot
2026-07-30 3:27 ` [PATCH v1 4/7] drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ bitmask Damon Ding
2026-07-30 3:27 ` Damon Ding
2026-07-30 3:38 ` sashiko-bot
2026-07-30 3:27 ` [PATCH v1 5/7] drm/bridge: analogix_dp: Simplify analogix_dp_config_interrupt() Damon Ding
2026-07-30 3:27 ` Damon Ding
2026-07-30 3:27 ` [PATCH v1 6/7] drm/bridge: analogix_dp: Use platform-specific HPD detection scheme Damon Ding
2026-07-30 3:27 ` Damon Ding
2026-07-30 3:41 ` sashiko-bot [this message]
2026-07-30 3:27 ` [PATCH v1 7/7] drm/bridge: analogix_dp: Skip native HPD interrupt ops for GPIO HPD Damon Ding
2026-07-30 3:27 ` 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=20260730034144.873BB1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=damon.ding@rock-chips.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=robh@kernel.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.