Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] Unconditional DP register access in hardirq/thread handlers causes bus 
faults when using GPIO HPD with PM runtime suspended.
--

--- Patch [2]: [PATCH v1 2/7] drm/bridge: analogix_dp: Return bitmask from 
analogix_dp_get_irq_type() ---
commit 23b7b1cae6716042fa037a50c31f18ad40263d93
Author: Damon Ding <[email protected]>

drm/bridge: analogix_dp: Return bitmask from analogix_dp_get_irq_type()

This commit converts analogix_dp_get_irq_type() to return a bitmask of pending
interrupt flags instead of just the first matched flag. It also updates the
handlers to check for a non-zero return value instead of DP_IRQ_TYPE_UNKNOWN.

> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c 
> b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index 1c98f92e001d8..ccb8a374b40b7 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -708,10 +708,10 @@ static irqreturn_t analogix_dp_hardirq(int irq, void 
> *arg)
>  {
[ ... ]
>       irq_type = analogix_dp_get_irq_type(dp);
> -     if (irq_type != DP_IRQ_TYPE_UNKNOWN) {
> +     if (irq_type) {
>               analogix_dp_mute_hpd_interrupt(dp);

[Severity: High]
Could this unconditional call to analogix_dp_mute_hpd_interrupt() cause a
regression (bus fault) when using GPIO HPD while the device is PM runtime
suspended?

Since an earlier patch in this series moved enable_irq() to
analogix_dp_bind() without keeping the device PM resumed for GPIO HPD
configurations, a GPIO interrupt can fire while the DP controller is suspended.

If that happens, analogix_dp_mute_hpd_interrupt() will directly read/write
MMIO registers (like ANALOGIX_DP_COMMON_INT_MASK_4) on an unclocked or
powered-off hardware block.

>               ret = IRQ_WAKE_THREAD;
>       }
[ ... ]
> @@ -722,7 +722,7 @@ static irqreturn_t analogix_dp_hardirq(int irq, void *arg)
>  static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
>  {
[ ... ]
> -     if (irq_type != DP_IRQ_TYPE_UNKNOWN) {
> +     if (irq_type) {
>               analogix_dp_clear_hotplug_interrupts(dp);
>               analogix_dp_unmute_hpd_interrupt(dp);

[Severity: High]
Similarly, could these function calls cause a regression for the same reason
if called during a GPIO HPD event while PM runtime suspended?

>       }

-- 
Sashiko AI review · 
https://sashiko.dev/#/patchset/[email protected]?part=2

Reply via email to