From: Dmitry Baryshkov Date: Fri, 6 Dec 2024 09:43:10 +0000 (+0200) Subject: drm/msm/dp: use eld_mutex to protect access to connector->eld X-Git-Tag: v6.14-rc1~174^2~13^2~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9aad030dc64f6994dc5de7bb81ceca55dbc555c3;p=thirdparty%2Fkernel%2Flinux.git drm/msm/dp: use eld_mutex to protect access to connector->eld 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. Reviewed-by: Maxime Ripard Acked-by: Abhinav Kumar Reviewed-by: Abhinav Kumar Link: https://patchwork.freedesktop.org/patch/msgid/20241206-drm-connector-eld-mutex-v2-7-c9bce1ee8bea@linaro.org Signed-off-by: Dmitry Baryshkov --- diff --git a/drivers/gpu/drm/msm/dp/dp_audio.c b/drivers/gpu/drm/msm/dp/dp_audio.c index 74e01a5dd4195..0fd5e0abaf078 100644 --- a/drivers/gpu/drm/msm/dp/dp_audio.c +++ b/drivers/gpu/drm/msm/dp/dp_audio.c @@ -414,8 +414,10 @@ static int msm_dp_audio_get_eld(struct device *dev, return -ENODEV; } + mutex_lock(&msm_dp_display->connector->eld_mutex); memcpy(buf, msm_dp_display->connector->eld, min(sizeof(msm_dp_display->connector->eld), len)); + mutex_unlock(&msm_dp_display->connector->eld_mutex); return 0; }