The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Maxime Ripard <mripard@kernel.org>,
	Raphael Gallais-Pou <rgallaispou@gmail.com>,
	Sasha Levin <sashal@kernel.org>,
	alain.volmat@foss.st.com, maarten.lankhorst@linux.intel.com,
	tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
	dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.6 09/17] drm/sti: hdmi: use eld_mutex to protect access to connector->eld
Date: Sun, 26 Jan 2025 09:56:04 -0500	[thread overview]
Message-ID: <20250126145612.937679-9-sashal@kernel.org> (raw)
In-Reply-To: <20250126145612.937679-1-sashal@kernel.org>

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit e99c0b517bcd53cf61f998a3c4291333401cb391 ]

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 <mripard@kernel.org>
Acked-by: Raphael Gallais-Pou <rgallaispou@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241206-drm-connector-eld-mutex-v2-9-c9bce1ee8bea@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/sti/sti_hdmi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 500936d5743c5..90c68e0f493fb 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -1221,7 +1221,9 @@ static int hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf, size
 	struct drm_connector *connector = hdmi->drm_connector;
 
 	DRM_DEBUG_DRIVER("\n");
+	mutex_lock(&connector->eld_mutex);
 	memcpy(buf, connector->eld, min(sizeof(connector->eld), len));
+	mutex_unlock(&connector->eld_mutex);
 
 	return 0;
 }
-- 
2.39.5


  parent reply	other threads:[~2025-01-26 14:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-26 14:55 [PATCH AUTOSEL 6.6 01/17] drm/virtio: New fence for every plane update Sasha Levin
2025-01-26 14:55 ` [PATCH AUTOSEL 6.6 02/17] printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX Sasha Levin
2025-01-26 14:55 ` [PATCH AUTOSEL 6.6 03/17] drm/connector: add mutex to protect ELD from concurrent access Sasha Levin
2025-01-26 14:55 ` [PATCH AUTOSEL 6.6 04/17] drm/bridge: anx7625: use eld_mutex to protect access to connector->eld Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 05/17] drm/bridge: ite-it66121: " Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 06/17] drm/amd/display: " Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 07/17] drm/exynos: hdmi: " Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 08/17] drm/radeon: " Sasha Levin
2025-01-26 14:56 ` Sasha Levin [this message]
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 10/17] drm/vc4: hdmi: " Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 11/17] drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 12/17] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 13/17] drm/bridge: it6505: fix HDCP Bstatus check Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 14/17] drm/bridge: it6505: fix HDCP encryption when R0 ready Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 15/17] drm/bridge: it6505: fix HDCP CTS compare V matching Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 16/17] drm/bridge: it6505: fix HDCP CTS KSV list wait timer Sasha Levin
2025-01-26 14:56 ` [PATCH AUTOSEL 6.6 17/17] safesetid: check size of policy writes Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250126145612.937679-9-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=airlied@gmail.com \
    --cc=alain.volmat@foss.st.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=rgallaispou@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox