Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] Stale ALPM capability retained across hotplugs due to missing state 
cleanup
--

--- Patch [3]: [PATCH v5 03/15] drm/i915/alpm: alpm_init() for DP2.1 ---
commit aaac88b9e7cd98f5bc53a3e1137528cc3fb4f5d2
Author: Animesh Manna <[email protected]>

drm/i915/alpm: alpm_init() for DP2.1

Initialize ALPM for DP2.1 and separate out ALPM mutex-init from alpm-init.

> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index bf626a1e189b1..b63c19589cd21 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -6349,6 +6349,9 @@ intel_dp_detect(struct drm_connector *_connector,
>       if (ret == 1)
>               connector->base.epoch_counter++;
>  
> +     if (intel_alpm_source_supported(connector))
> +             intel_alpm_init_dpcd(intel_dp);
> +

[Severity: Medium]
Since this patch now initializes ALPM DPCD capabilities in the hotplug detect
path, does intel_dp->alpm_dpcd need to be cleared when a monitor is
disconnected?

Looking earlier in intel_dp_detect(), when the status is disconnected,
capabilities like DSC and panel replay are explicitly cleared:

        if (status == connector_status_disconnected) {
                intel_dp_test_reset(intel_dp);
                ...
                memset(connector->dp.dsc_dpcd, 0, 
sizeof(connector->dp.dsc_dpcd));
                memset(connector->dp.panel_replay_caps.dpcd, 0,
                       sizeof(connector->dp.panel_replay_caps.dpcd));

If an ALPM-capable monitor is replaced with one that does not support ALPM,
and the DPCD read fails (for example, if the sink NACKs the unsupported
address), intel_alpm_init_dpcd() returns early without clearing the stale
value:

drivers/gpu/drm/i915/display/intel_alpm.c:intel_alpm_init_dpcd() {
        ...
        if (drm_dp_dpcd_readb(&intel_dp->aux, DP_RECEIVER_ALPM_CAP, &dpcd) < 0)
                return;

        intel_dp->alpm_dpcd = dpcd;
}

Could this result in the driver incorrectly trying to enable ALPM on a sink
that doesn't actually support it?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=3

Reply via email to