From patchwork Fri Dec 6 09:43:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896764 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3FF7AE7717E for ; Fri, 6 Dec 2024 09:43:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 14D1710F086; Fri, 6 Dec 2024 09:43:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="vo6rDmNv"; dkim-atps=neutral Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6373710F07E for ; Fri, 6 Dec 2024 09:43:25 +0000 (UTC) Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-30037784fceso2191511fa.2 for ; Fri, 06 Dec 2024 01:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478203; x=1734083003; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DR5UNfjajRu4P0t/KAHkaq8u/GtT1QuQGweWq5XMJM8=; b=vo6rDmNvjITc8fVZXYMA6MeRqgjQ9f+4D1nxqvGtpRUuXpuU6kit4JDGAFF2CVwR0t wSHnHE2ytEYLuHm9jTRJNgyb+1IzHJYisTBz0/SmOvXmh4vBXDi47fi9m/LjxSWz4RjS DUi8xyHq1f+M3Ppi1NEdxcIrp2bQ5AIuOb2NYgGRDOyRlqSutshebPVNVow/YIVQWWAi 5nCKt7OpQERw3W+o6jTJN37XB8YCjhZXDtPPsJTQyuyfzzlZTmPKg/XNC+imnRLrt9Lx EVenYe9ew//xpj8rlHDtPPppGrshKWiCSGgJxNaS9pwFWq3q9gI0YwYSbIFShOBxbr6z eZDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478203; x=1734083003; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DR5UNfjajRu4P0t/KAHkaq8u/GtT1QuQGweWq5XMJM8=; b=KRPTpFUSHN58vVEOaQqNTlqT7CUPwSOT8+gXn1+Au2tmi5WxuYWb8EMH4CwwwDnwwl nLCZjuQrRoafwUu2vqX7JufnqWzfY+PHcKtE1JCcsRQsHnreHsA6bT2Bta8V6QhpD+jh ptrmW78cO6KElXFPSMTAZsMHH8inXlguZO6v5gMtUS9Gy2qTdnI0bTb392bcvikKYSCa K0gHxnqJC9ME7on2p0XYxk82cXjL1pdoVxefBlqxwDh3EtOP2J6/0FMZP+vnG/PMx2sd WZ61NSGZUk6lPWOprbPnGQPhfukMAGIGObOF+Jvncaxio0rgkQ1+TK8js5Kxwsz1fStA UNuQ== X-Forwarded-Encrypted: i=1; AJvYcCWLOHRfHgSrf4fnUIse41KVM3Ez4TnemWNyU2LDKBW3A6uM8uJdJvRW365VbOKLH04gPHIqTcYBrr4=@lists.freedesktop.org X-Gm-Message-State: AOJu0YwXrL7GyhRNNx+XeJ6pqpbyux5Am9hTD+mNCpXSTKHwsEq1W5/f xe0I5a4Zi1i7/KeKfeE0Y0fFtFI1hZBmV5r0U6q3kpcfAkoVFuA87pGnakaj8NA= X-Gm-Gg: ASbGncsM2q42oukG1XY8sWxv63Sb+P7h86uOgybHirjnrIC2KMqnd0f2S6puDIP1jni XWZT/P6gzc0Y73H3bc8QOXGkN+a1hhOi7SZUWc5LHbrakAWwB2EQ66KhqHTnygfsKh6oProNXqT 2/yqvmROQs8a47f8qzZ05/3Sx99a5M1cWUtSapCvXPbOZbsoYrZDfR2iy+LR0ItX6fyzx7/E8IX cdfRq+1C6E9v5gzp1jzLH6o82xrgq/tF+4CnKqygzfE9b1dBLZbV8wXkg== X-Google-Smtp-Source: AGHT+IGCjsHeF9S3xd5zx/P4eEcmZ95qD374mHfeNE0TcJsafXsKauKXde2wl439IjRQlzjjyxvauA== X-Received: by 2002:a05:651c:19a5:b0:300:eb1:a4f3 with SMTP id 38308e7fff4ca-3002f8df262mr10870581fa.14.1733478203466; Fri, 06 Dec 2024 01:43:23 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30020db3805sm4128441fa.50.2024.12.06.01.43.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:23 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:08 +0200 Subject: [PATCH v2 05/10] drm/exynos: hdmi: use eld_mutex to protect access to connector->eld MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-5-c9bce1ee8bea@linaro.org> References: <20241206-drm-connector-eld-mutex-v2-0-c9bce1ee8bea@linaro.org> In-Reply-To: <20241206-drm-connector-eld-mutex-v2-0-c9bce1ee8bea@linaro.org> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Phong LE , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar , Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Alain Volmat , Raphael Gallais-Pou , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1061; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=I1wH9N5enlUiSVwdDRB0wmAdGhFse9ySIo7WNjanmNE=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnUscuTpR0+HiR38S1fTr4ertYoyhKL7gh5Neki QVFnX1dWgWJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ1LHLgAKCRCLPIo+Aiko 1cP5B/4t0Yy2pHo0bHZjNzf9FSu/qDR8IpkFFhM98PVBn8EV3bNlLhb3/FOwaAYFawC0R7RFsei 6gC0/YzWxhmMGYPjsOa/37GrWtmPrdHhBZ+KBT63EfOBOW+V3p8zsoWg67YBwUdMuuGRt0u0auc DgeeGk8WkE3xEW+/kPD2P0j0s/FWIYP6HpthpzIzXnTLkTKofLtovXgVO4JA7XKTloel9mAL6hd YV3thOkL+KoTiLV5O4nnCwLlrkMriaWauaCc/+rcxPaFF/ZnLJwVFuHb04GMj7WXisEfuKJ47PX zmzNh+qUndFSRAODqbBfgIEe9P0WLax3l98lRYUC73tWfPVy X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index c9d4b9146df95bb46cb6bea4849c331616c2b463..6fc537c9048f5c8e57e30f083121c9aea6b99a5f 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1648,7 +1648,9 @@ static int hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf, struct hdmi_context *hdata = dev_get_drvdata(dev); struct drm_connector *connector = &hdata->connector; + mutex_lock(&connector->eld_mutex); memcpy(buf, connector->eld, min(sizeof(connector->eld), len)); + mutex_unlock(&connector->eld_mutex); return 0; }