[PATCH 06/10] drm/i915/audio: use eld_mutex to protect access to connector->eld

Jani Nikula jani.nikula at linux.intel.com
Tue Dec 3 14:56:04 UTC 2024


On Sun, 01 Dec 2024, Dmitry Baryshkov <dmitry.baryshkov at linaro.org> wrote:
> Reading access to connector->eld can happen at the same time the
> drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
> order to protect connector->eld from concurrent access.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov at linaro.org>

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

and

Acked-by: Jani Nikula <jani.nikula at intel.com>

for merging via whichever tree you find best.



> ---
>  drivers/gpu/drm/i915/display/intel_audio.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index 32aa9ec1a204d2ecde46cad36598aa768a3af671..3902ab8431139c3ff4dc17b841d94b6d3241dec3 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -699,10 +699,12 @@ bool intel_audio_compute_config(struct intel_encoder *encoder,
>  	const struct drm_display_mode *adjusted_mode =
>  		&crtc_state->hw.adjusted_mode;
>  
> +	mutex_lock(&connector->eld_mutex);
>  	if (!connector->eld[0]) {
>  		drm_dbg_kms(&i915->drm,
>  			    "Bogus ELD on [CONNECTOR:%d:%s]\n",
>  			    connector->base.id, connector->name);
> +		mutex_unlock(&connector->eld_mutex);
>  		return false;
>  	}
>  
> @@ -710,6 +712,7 @@ bool intel_audio_compute_config(struct intel_encoder *encoder,
>  	memcpy(crtc_state->eld, connector->eld, sizeof(crtc_state->eld));
>  
>  	crtc_state->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2;
> +	mutex_unlock(&connector->eld_mutex);
>  
>  	return true;
>  }

-- 
Jani Nikula, Intel


More information about the amd-gfx mailing list