[PATCH 07/10] drm/msm/dp: use eld_mutex to protect access to connector->eld
Dmitry Baryshkov
dmitry.baryshkov at linaro.org
Sat Nov 30 23:55:24 UTC 2024
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>
---
drivers/gpu/drm/msm/dp/dp_audio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/msm/dp/dp_audio.c b/drivers/gpu/drm/msm/dp/dp_audio.c
index a599fc5d63c524474276f5db98b05c7c512f332a..61952a0c49861efcb5e7c0884fcb85c040daf9ce 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 dp_audio_get_eld(struct device *dev,
return -ENODEV;
}
+ mutex_lock(&dp_display->connector->eld_mutex);
memcpy(buf, dp_display->connector->eld,
min(sizeof(dp_display->connector->eld), len));
+ mutex_unlock(&dp_display->connector->eld_mutex);
return 0;
}
--
2.39.5
More information about the dri-devel
mailing list