All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Damon Ding" <damon.ding@rock-chips.com>
Cc: dri-devel@lists.freedesktop.org, conor+dt@kernel.org,
	robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v1 4/7] drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ bitmask
Date: Thu, 30 Jul 2026 03:38:53 +0000	[thread overview]
Message-ID: <20260730033854.7D1DC1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260730032744.381566-5-damon.ding@rock-chips.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [High] Data Race in Interrupt Mask Registers During RMW

Pre-existing issues:
- [High] Lost Hardware Hotplug Events Due to Late Status Clearing
--

--- Patch [4]: [PATCH v1 4/7] drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ bitmask ---
commit f4ba8e259db1706905ae7d04afdea18e9d5a28d6
Author: Damon Ding <damon.ding@rock-chips.com>

drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ bitmask

Update analogix_dp_clear_hotplug_interrupts() to take an irq_type
bitmask argument. Instead of clearing all hotplug interrupt bits
unconditionally, only clear the interrupt flags corresponding to the
triggered events.

> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -733,7 +733,7 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
>  	}
>  
>  	if (irq_type) {
> -		analogix_dp_clear_hotplug_interrupts(dp);
> +		analogix_dp_clear_hotplug_interrupts(dp, irq_type);

[Severity: High]
This is a pre-existing issue, but can this late clearing cause hardware
hotplug events to be silently lost?

Because the hardware interrupt status is cleared at the end of the threaded
handler, it executes after the time-consuming drm_helper_hpd_irq_event()
completes:

analogix_dp_irq_thread()
    if (hpd_detected) {
        ...
        drm_helper_hpd_irq_event(dp->drm_dev);
    }

If a fast unplug/plug cable bounce occurs exactly while
drm_helper_hpd_irq_event() is executing, the hardware sets the status bit
again. Clearing the write-1-to-clear (W1C) register after this will clear
the new event without triggering a new interrupt.

Should the W1C status registers be cleared immediately after reading their
state, before executing the event handling logic?

>  		analogix_dp_unmute_hpd_interrupt(dp, irq_type);

[Severity: High]
Does this code need a spinlock to protect the interrupt mask registers?

Since the IRQ is requested without IRQF_ONESHOT, the hardirq handler can
preempt the threaded handler. If analogix_dp_unmute_hpd_interrupt() reads
ANALOGIX_DP_COMMON_INT_MASK_4 and gets preempted by a new hardirq that
masks a new event, the resuming threaded handler might overwrite the
register with its stale read value.

Could this cause a hotplug interrupt type to become permanently masked
if the hardirq overwrites the threaded handler's unmute operation?

>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260730032744.381566-1-damon.ding@rock-chips.com?part=4

  reply	other threads:[~2026-07-30  3:38 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 [this message]
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
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=20260730033854.7D1DC1F000E9@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.