From patchwork Fri Dec 6 09:43:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896738 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B18041F03F6 for ; Fri, 6 Dec 2024 09:43:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478199; cv=none; b=EnjGNoWyB4HAtl4WNyt+9b8nT5Tynrai8fD4CegBTAfA/uWHa/3Vc/jmBH+xN3KvuMrf7GeeLoy7HUb6ON6M+MNf+RP2dHkhKiMSDkoZsPdcFPOdLDA3NTCUC/5c37XvmEv5ps8CtgSyMDmmO0EA5BC/cAagX64/vHV1dvydOcE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478199; c=relaxed/simple; bh=3Q5pbMu5lborNDPG00HVqHDspCjjhjGT9968qr3bz9k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hqtDkXc+N8qYIwCjWmI0CovvQYD+5T0fI+bnuTiKOrqnWj5ZXbXtPoZ27khDAXS5I6ARaxEf/0jJp1GhdZKYj02EYISQFk+r7boKyGGuD0dR2bf2ubrLB5a4EAlHbHDdn0OsQJs2+5U2uXdTBj5P04lZXtrEGZ0FlfhBgVTZaVs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rJnGXru4; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rJnGXru4" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2ffc76368c6so17257591fa.0 for ; Fri, 06 Dec 2024 01:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478195; x=1734082995; darn=vger.kernel.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=VnGo6ZNwboubgG4PK3zPxjFnyRb2ICdQLCcJ6lGvxCQ=; b=rJnGXru4Xt6zVYnMSteFC3ArKlwnoFlT2IQXXToym4nLhZw5lKKq1nbp/zAJhM7Ll0 CbpPcRQrdP7fzdUQtdZITBW0NcsLkOFUdMcG/RdOjkU1lzmkm8yb0Sr6//KDsFPwhi9U SYfXClWUTMjc6+bHPbKEtTbVRJsBuAo5UkXY02zampKStFBf5XasV0hRGS8s3ZjuLgfv etVzTW1tpytyLsPH9iklXPcD5IrlJiDqJc+8OKSszEtJchJQERtLmXykAd6wOuw+D2hC b47Jjo9l+ee8C/4rDyto5i2QwYtMdfmiZfXOW3EHs2zQsplxBV6zebByVMiNuzI9BTOp 1c9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478195; x=1734082995; 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=VnGo6ZNwboubgG4PK3zPxjFnyRb2ICdQLCcJ6lGvxCQ=; b=Qgtump0oDsrxrAmGnzWgpbPUasmJBecRca8M9LCbBC6xjg8qgD0vQ80tLoJtcI9lP0 VlnF126JWU+00bT/SoS44Sa2S6zA8vy++dvITcvMuKuZ8oF7yHzzTs1t0A4WTds/D0kr i30T0YA9nVK7Qsn9THB5o7BGnWT5DnckH3tG6zzPfJvsAi4F1dxe0Tnbrc1/evVJ+hKI qo4ZnZyfSAA7So2KYapDe5v1J3oHpR4c7P8XZnJOoyIi7vGdmKl8u1y0n9U9JfOaZuyd px0YVToHCHipN8VZR5c/enF8DPZwt/FVxKFKUKx3a1oCtXkA8gRYfbFbqB3dSdpOAdWG 0axQ== X-Forwarded-Encrypted: i=1; AJvYcCUsBIUEZdBucsX1hQFrHUyNKfiK9+i7aQpyu6fmMatziV9jgUuj+gadmZ3UIoAutcD+KaiACIkWo4iLchpd@vger.kernel.org X-Gm-Message-State: AOJu0YyhS8x2TF7KjraSwSD0aNDGgy8b6pAKEjPeLd+2mn7gqLA3uCBC 9fxBgKl1Wy/sn8xmzeT2AkpFFJ0wtJMqXZoGQnG4AYlyNpABkJdpx3aB9zWUzco= X-Gm-Gg: ASbGncsNJDdNT4ufffFCqKQv+XwayyYVGp5ia/OGsL/g9qcMxGIOmBdlusLakt6go29 ml2+0KGHcpArR1ILF2IRcwJUY3o+Gc8LKl4EHI+NBYEMnye7wEMEf+eFcNr5betk86DTe69oyB4 7Y/iNmNkOzGybVodsGdCTPsc5S1WezcMW4iq/haPVJxMIkKD+oRgFh3At2JXBg2i+FXGXxchWcj yBHWfxu8rsEXpPbL08xbSGiCgydvhFbx7yv4qLeNLaTJmKx2lEaASPkIg== X-Google-Smtp-Source: AGHT+IHOfIBmoyEolZXZdyLfUjfRu7LK9x/y6e2NRNb0G1IfVvxWYDXdxw9kGPS8sm9OVNX+a5FRXQ== X-Received: by 2002:a2e:bea8:0:b0:2ff:df01:2b43 with SMTP id 38308e7fff4ca-3002f8aaef2mr6873121fa.18.1733478194869; Fri, 06 Dec 2024 01:43:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:13 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:04 +0200 Subject: [PATCH v2 01/10] drm/connector: add mutex to protect ELD from concurrent access Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-1-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=3318; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=3Q5pbMu5lborNDPG00HVqHDspCjjhjGT9968qr3bz9k=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnUsctUfPifOTQ8tgTrVr4NDA9HQHo4lV6wGZ/x 802YkRE+OKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ1LHLQAKCRCLPIo+Aiko 1YTBB/4+LnnhEaD+gppGgLjgyd7DzGULNQMgJ2hoRulbF1tCZiqhH2JwwQgaiFxKaCK13GN72v/ +MlHzrTYbtF24x6wcNLxIFk87u2wdjCt5dO8xqKiiFF4My86VJebVFFgPQmUXcFvMWkWUS3PByj f9McLONHSWPtO0XRW3DbeQ8zzl5cChJhSN8/mkvwrNqq0BkWWOEDxxROis0bi2KSFK0/SBEJ2rN X+RhP/l08plhS1bGyEvzzOyAMvtpjSEsEYXf5mCZGGnypfY+YKJQ1VDkpPcX3/Si3R6D3pZ0Vpw Wfr3vj5voa6Xeg3e/NqY4k/PPQjahgFQwpQeJMdgalo1w5Zq X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The connector->eld is accessed by the .get_eld() callback. This access can collide with the drm_edid_to_eld() updating the data at the same time. Add drm_connector.eld_mutex to protect the data from concurrenct access. Individual drivers are not updated (to reduce possible issues while applying the patch), maintainers are to find a best suitable way to lock that mutex while accessing the ELD data. Reviewed-by: Maxime Ripard Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_connector.c | 1 + drivers/gpu/drm/drm_edid.c | 6 ++++++ include/drm/drm_connector.h | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index fc35f47e2849ed6786d6223ac9c69e1c359fc648..bbdaaf7022b62d84594a29f1b60144920903a99a 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -277,6 +277,7 @@ static int __drm_connector_init(struct drm_device *dev, INIT_LIST_HEAD(&connector->probed_modes); INIT_LIST_HEAD(&connector->modes); mutex_init(&connector->mutex); + mutex_init(&connector->eld_mutex); mutex_init(&connector->edid_override_mutex); mutex_init(&connector->hdmi.infoframes.lock); connector->edid_blob_ptr = NULL; diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 855beafb76ffbecf5c08d58e2f54bfb76f30b930..13bc4c290b17d556d654b7cdd8c48c24a32aba9c 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5605,7 +5605,9 @@ EXPORT_SYMBOL(drm_edid_get_monitor_name); static void clear_eld(struct drm_connector *connector) { + mutex_lock(&connector->eld_mutex); memset(connector->eld, 0, sizeof(connector->eld)); + mutex_unlock(&connector->eld_mutex); connector->latency_present[0] = false; connector->latency_present[1] = false; @@ -5657,6 +5659,8 @@ static void drm_edid_to_eld(struct drm_connector *connector, if (!drm_edid) return; + mutex_lock(&connector->eld_mutex); + mnl = get_monitor_name(drm_edid, &eld[DRM_ELD_MONITOR_NAME_STRING]); drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] ELD monitor %s\n", connector->base.id, connector->name, @@ -5717,6 +5721,8 @@ static void drm_edid_to_eld(struct drm_connector *connector, drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] ELD size %d, SAD count %d\n", connector->base.id, connector->name, drm_eld_size(eld), total_sad_count); + + mutex_unlock(&connector->eld_mutex); } static int _drm_edid_to_sad(const struct drm_edid *drm_edid, diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index e3fa43291f449d70f3b92a00985336c4f2237bc6..1e2b25e204cb523d61d30f5409faa059bf2b86eb 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -2001,8 +2001,11 @@ struct drm_connector { struct drm_encoder *encoder; #define MAX_ELD_BYTES 128 - /** @eld: EDID-like data, if present */ + /** @eld: EDID-like data, if present, protected by @eld_mutex */ uint8_t eld[MAX_ELD_BYTES]; + /** @eld_mutex: protection for concurrenct access to @eld */ + struct mutex eld_mutex; + /** @latency_present: AV delay info from ELD, if found */ bool latency_present[2]; /** From patchwork Fri Dec 6 09:43:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896739 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 755BC1F6665 for ; Fri, 6 Dec 2024 09:43:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478201; cv=none; b=CpbxtQoknvJfe7AcFBqFZHzqs+sISUlVzTcYRTYWgv59Sa734UNPOjSZXUhZajR1eyBLWAeuOk84p16fyh5QX8l7xAKWtwb03SbzXknDKcuNG0GwHmKYk9OLYxOdE6yIFBVQtVvgUFxh3h9tYCfDms37dRVhYiz4FAyeLaBOFBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478201; c=relaxed/simple; bh=zYvAEMAKJI/pMjPuMCGmB4bmJnIIZvQ3OxFQhHsqYJE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EKbim/1na2nrpBHetmFtnnC8TSPJorc3PNyiy5KFG0dX/rytejx0Ws4rLnfzVKgOceHOphxG2X1A+9FOyVKcLMcdtJnc1VJZxKkSRnVCDBT4bxSaHMPKnIm4sRAxPbpEPN/qVu8yFKnMeOKkTv+ljIuDLzbEaWaoQXwkXBNbUSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=I4CIDWrh; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="I4CIDWrh" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2ffdbc0c103so16744211fa.3 for ; Fri, 06 Dec 2024 01:43:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478197; x=1734082997; darn=vger.kernel.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=BXd2OzHxXLbpmSJUeio7TPXwyPaZHSalM8FhliMGDmw=; b=I4CIDWrhvKO5AWKXxQ7OxMFlE2m208pgGQOgIjc2Y6oMvBhkSnarTVKWkDtf+23kMe nbV73FlBjZ9N89JW+elnxYc3Tvo0S4CKKgwadS4QLgG2o97ld5Wya0vmOxZuZdisap/k oOKlBPnajOYDJJUYoWie0OcPo1D10B/TQGQNXBwnAX4yfj4t7NMpyvjAfs44YN8oGCso C9qbAdNtXjd1MP5U8Dic99KYdMrllRL+v2Oyx1aPjkpUf97FMbwGwwXOEAbyT8VT9pY+ i8k1/HU7aBXNEh/9drXAAYI3hSUfXB4+R004UYEehJmuvSSHsUqStzPvRQTbwakPBMQV 7Egw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478197; x=1734082997; 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=BXd2OzHxXLbpmSJUeio7TPXwyPaZHSalM8FhliMGDmw=; b=P4Se5ECDtkRAnJNpFgs19gWf24gJImVY5YebYtV2g9TzYAVe8BTVD/AKzP93x7DTj2 Q1BNbXIY5AE4BCkNeEHFOdWif73hBU0o3VI/GwBPH6gv7F2AZ5fTlPPLgh7Y42/p6AfD m/GqEeCL011RoaDL3CsbOLlDGvqGFpZrBKs8gtaDxi771FRqvBpnwdtEJab4ghWqTyCB pR1UgyyTz6y2gJu7sgBSM48qCEy1lecanKnqkaaQkAZvHe6lLHJ20Wowe96FyN8GXQlj 3/JGAbd7rnUZxCjcYn+sIZIzrx3hb/ApIIYTSzKpi7azNrRj00tpuHtrW7MwdIQqBsN2 iC4g== X-Forwarded-Encrypted: i=1; AJvYcCWecrNaFJSV1jIiLV+d0DDwpqbi0ch6xmAxjIhK7V8i2uDnNnZBfK57pbGzpLkOZDHunmWe5mfT9f8NV9m8@vger.kernel.org X-Gm-Message-State: AOJu0YztuSu3lYQtB2skub0R9eASOH2uu5f8tZVEcuDp15rsmuQSZz+E /nNL76bf4lxtrH1Nk7P/5LWHXiqFWY8zvn98m6+k8JmUeWhrD7gnd2cIt733v0M= X-Gm-Gg: ASbGncsPwGTOPWeij0xUGjHlYhUeViu01XtZVey94YI3IwQGjpEjPCsTrquMoa1qJzZ bWf1u7TxfIaAYCq1fe85UoCvQCZSwlg5KiuMohLAWK9Nw38JqyghilSpizP/towxo9EXyt6ZYAT Pzs8Bvnf/xwtqWWeYhoYVPwm2WHaD0ONfJ5zgJqKCfJlq4NDVmVytMsJQ+ZQIAjz4yNI08bo4nB sPKumtEbtIHj/XHM7ZwrU3VfyURcMB9h5UNcqkLo7xvzy231MyI2tJe+w== X-Google-Smtp-Source: AGHT+IHOzYvZJj8Vkykxd2x0JSD+NBvzpXfm6jlvPobPhv2vFXWDLmCYeuoQOdT69cvmzqWGVgvY9Q== X-Received: by 2002:a2e:a9ab:0:b0:2ff:d0aa:11b with SMTP id 38308e7fff4ca-3002f79b514mr6682241fa.16.1733478197396; Fri, 06 Dec 2024 01:43:17 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:16 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:05 +0200 Subject: [PATCH v2 02/10] drm/bridge: anx7625: use eld_mutex to protect access to connector->eld Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-2-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=1073; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=zYvAEMAKJI/pMjPuMCGmB4bmJnIIZvQ3OxFQhHsqYJE=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnUscuOWsnWIy+09WL6ZmIga61MhuoPN14wFRyc CTUUhM7PIGJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ1LHLgAKCRCLPIo+Aiko 1QuCB/9GVQCw++i7vtbIm18C0qWy2CcrBgiveGKyYFt0iSpolRcgaG6RbcwjW5qst9mjy3Q6fyT wfoOatec5nsxe7H0nq3z0RdLACzVly4qvlxnotelWRdH/BQ6ujFXyFerWcmtX3JM/VBGIQ2IBAc cy6kBFVrFFfY0hrjJEvNHpO8Jw7wJ8KQT4IzkIw7DCzBnKyhq7QShr5O2I++bdw+2PCmYR+Ig4l AKpe8UolsbHTV1DesMVMTPNQMXDw/veYJp5B5GOVzXYZoSXeg0/Wp4HONWYO6yhjuqBKn4BL1Kz Qv9O5BOb777DITYj54ixLYloqlzSi9P0cRUdPa0UewnOGLrp X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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/bridge/analogix/anx7625.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index a2675b121fe44b96945f34215fd900f35bfde43a..c036bbc92ba96ec4663c55cca091cd5da9f6d271 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -2002,8 +2002,10 @@ static int anx7625_audio_get_eld(struct device *dev, void *data, memset(buf, 0, len); } else { dev_dbg(dev, "audio copy eld\n"); + mutex_lock(&ctx->connector->eld_mutex); memcpy(buf, ctx->connector->eld, min(sizeof(ctx->connector->eld), len)); + mutex_unlock(&ctx->connector->eld_mutex); } return 0; From patchwork Fri Dec 6 09:43:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896740 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D24501F9A9D for ; Fri, 6 Dec 2024 09:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478203; cv=none; b=OLZjVTSCOwD6tQBpXiUcp/xL8kc0V7EnIWVL4GojGx2Xdkb2BK1flBk+AGXoPut/MrS/IX6fzyYCUFW9x4WAnruDnDbcpj/zF0vSUxBn77Cr5OXKLKtLLp/ZBJULaPsyAQb1rkPqGheoJik0ptYZbAnDmejPUytgOeTCr0faG9M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478203; c=relaxed/simple; bh=S2LNy/QG/Pvu7jaLQRzV8x9aVeJiuTJJixaJAknwzOI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fyqKq5G+udecVQeIHRGMeo81xq2euLqyJ0qQdfIo4/VpPQ45RSjZwRUCDgDtUMbK5BYyYFBlqS85JI4YreooHgwKGlI5aPAlrV5RsjVbB53J0u5LJZQG+Brcmr5PlilVzG40RJBNB7+PvUwWMlzKt5VQ3qPPRnKyrTws03xai9U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BicLqy1G; arc=none smtp.client-ip=209.85.208.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BicLqy1G" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2ffd6b7d77aso22750641fa.0 for ; Fri, 06 Dec 2024 01:43:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478200; x=1734083000; darn=vger.kernel.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=Wh7X6NiXjO0ZK0icbu5RRSIlyMlU/s3VBkgppSRGnTc=; b=BicLqy1GHsDtul6M54FTDxmspEV8KLfCzEGux/KaZ8lSkyzZ8qT8NGwwk8JQEIiRd2 LGKTaLL8d+mBCb6w3o8ylAvr41d5S/9cNPzrwcOdf7BNBYXgwGRfQNTJfh/1OlfxHsH3 qmbu5vuRobTkYq61rod7hkDh9zrHspfJPWqpE2QqGiFekonmD4fD9rqceGGfnfRxb2pL Q/CZQkfG7EmsRVfWotClBndg3BnE5H5OOgNL8J0LexKdfthFpUq4/jxM/Sc+YDk54bjZ RsLldkeWtG21eBatalhGjBJ9XtrIdo6Rn+3sZepjq26sP4Qv3u66Xn64fido74OdJf/f 4xLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478200; x=1734083000; 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=Wh7X6NiXjO0ZK0icbu5RRSIlyMlU/s3VBkgppSRGnTc=; b=c5bJYHb7OA1f/IY92gGme+NyioKl+4ajHKqR/Q/dogwjSBV21Tg0ew4T3ahch+qiM4 t5ibvVzvqtNyB1rWKJQVHu3lccjym11szdtyCwLanSzvGM+xNvgAskTGgVh6znpuTAYC Oab39ZsV7LNBeFSaRXEmYdSY/ENTeBtsMQTdNen0NVgoUzikuj6UUd/iLMcfQsWMO3Y2 BirnyagDf8+AA8e9imfp46E+ra3cJosq1Fwmf+LJP25pgIHWJ8kZGCYcH3xgUkMfiIOb g/55u3p5+uT+AuAQ3dHUpdx3wH+la1pf9OjZC8k18aOQ6R4t0QTCX82zlFIVJeLY/vwe Ghsg== X-Forwarded-Encrypted: i=1; AJvYcCUuYwXU9uAZUapgFjGK85cUYf75PqhqasJucv+HPFk/s2xrq4YUReC9CJHVVMs3dpNawjSdBaCwdsTJfveY@vger.kernel.org X-Gm-Message-State: AOJu0YwxnLN2Z9G5fJiDhmPf6DEjJYDUbnOOUO0XiNB4mo17dJBfEdYM xcXiriKCs2jnY9pc1Uogw7XpBiSvD8gKK7kgtTJqBj+5W249nKBfp4BIm6DL0pU= X-Gm-Gg: ASbGnct1U15Ht1a4EzUIByz74pyRSWkoYX4hvxkhvMfa0TrT0pxxyjMHj677NwhJtcE sjDD504Bk+/9PwrMrmDlPOihJFAOua0URk2vcAz/ZGrBe47n0Auleat4BnfqoRZaxQ7CgYRXUM6 +us1xs5pxG3Yy2rty+H98XTasU0S+xK8G6T2Piyj+n2pulDkfj/f7O4xLYrH2cEnhKei3cUG9zZ h97yabNwvCkSR/9RfRrLk8SuWvNcvbhNklqq2LSwb05IPrwvWYiMm1EaA== X-Google-Smtp-Source: AGHT+IFBxT03pxchsuAow8zXPe44X5vXMeN6+pzw5XgO7yRZwFTl4DSSqXqmQN/nIOwdAf9XNhMk0g== X-Received: by 2002:a2e:a90f:0:b0:2fa:cc86:f217 with SMTP id 38308e7fff4ca-3002fcc6314mr10909661fa.35.1733478199996; Fri, 06 Dec 2024 01:43:19 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:18 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:06 +0200 Subject: [PATCH v2 03/10] drm/bridge: ite-it66121: use eld_mutex to protect access to connector->eld Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-3-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=1093; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=S2LNy/QG/Pvu7jaLQRzV8x9aVeJiuTJJixaJAknwzOI=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ3rQcT0D+fWrdf7eTuO7miErYRRq/uGdQ1bilxVd2j16Z z/vrJ/SyWjMwsDIxSArpsjiU9AyNWZTctiHHVPrYQaxMoFMYeDiFICJpAtzMKxmXrAmIf3sx79J n5x5p8lbc0yOj9hTUFTN17jvemrJ5y/aGWJsN90qs3j2HCpJO3d947HLoiufHO66EK487WcPu11 nm12ex98Nfkt75Zb+CJdfGT4lNHqmtrDVbxVb710nCjUmbrr9djMbP9vtiRfb/tVodHA/9zbjTp F0UW+v3VO2sZRl3zl7tlRnDkUX0/ud0U8Cn1rduKSQ9zDX7POhM+sniP9cXR1c0TOtPPZAG7NQc 23p9xmHks64efKmbr0dkTlrP/cz+ZmZz6Y5SZ2ZxRdyk8vljuq/sP1L23tFZb+4PNSt8KvLEfbi rq6MWdlq8X/xgh4O6wU1LBPiahwNfFNvHJtbsfeP697ZAA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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/bridge/ite-it66121.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c index 35ae3f0e8f51f768229e055a086b53a419ffcd9f..940083e5d2ddbfc56f14e2bdc6ddd0b9dd50b1f8 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -1450,8 +1450,10 @@ static int it66121_audio_get_eld(struct device *dev, void *data, dev_dbg(dev, "No connector present, passing empty EDID data"); memset(buf, 0, len); } else { + mutex_lock(&ctx->connector->eld_mutex); memcpy(buf, ctx->connector->eld, min(sizeof(ctx->connector->eld), len)); + mutex_unlock(&ctx->connector->eld_mutex); } mutex_unlock(&ctx->lock); From patchwork Fri Dec 6 09:43:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896741 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2D001FA24F for ; Fri, 6 Dec 2024 09:43:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478205; cv=none; b=gc2Q35gPu6pbnvBZM4ffV17IgzW/+e09QH9j9B00wfiTCY6izDDD8M2lzKmnpkWHm9Ch0J+tAQeQqiS7iMdTBn3kGkFIT0ORkEYB0CuJHCg6peY40YIjyMvavcoprQgYxtJdFJmdfdXGrq2yx0QJgcmVIBe56krFqubzTWcaM7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478205; c=relaxed/simple; bh=xBnYTDnWSnfj2+gm2t5bxnQqQ5FnybkVoMOlzhUTQDQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VPNDrbVLmWyjud8mAXgcjnhZU6hTsok+VnpC+ANWG+ovl/PDEga5P4sMIwJZKBnBKlko5fgFMkFjvc4cPj7X6liCZb0IkGgI1grS9609euY5td3iIpO/fSRuVtJmEKqOXilLaXh8Xtihd+WaPekRKaOIUKqueOgpfoK4wGqkpUY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=quko07NC; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="quko07NC" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-30033e07ef3so2922791fa.0 for ; Fri, 06 Dec 2024 01:43:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478202; x=1734083002; darn=vger.kernel.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=AlZ85fU7bMEdCr3Ivk/JPNhlYCX1et1nGUUrgQd3Dz8=; b=quko07NCXqWS0Xgi6LIRAYHEReu+9w+oFREWo2Bq2kwuku59n9Ebs8f04BkQVCxbES +kl5x4SUW4SFTGp4aolUqwQFhBZbwCd4XCMMk8kACEoK6fWt+4lHlWtBxuBTOIlItbHK MW52XBr57yk1UXihvM0hu3rlkiJBnAzA2s6pfWTJCxUex8MvP/uHBuMN7kYubKX9rKp3 LRXuhnzsMvIbvVljSugrcvc9ILQiKn7L/zy73NO4g1+jNxu21UYn2RPLGQ3v5S9GnJNP E2AYeLdeun+MOjrFRKMIQdlsimDVC26AP4MIGQwJ6i3iE92pZMOgtuJiGYn01VRKJxsI IMFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478202; x=1734083002; 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=AlZ85fU7bMEdCr3Ivk/JPNhlYCX1et1nGUUrgQd3Dz8=; b=Z5BT7/ZCHh82a5k7ZFUuzfDRk2iLI2HAsDG5Eqgko5YuY1JMvfasepZ8LNvjkcC9k1 ZIElGlL0rKhkDQ6UybZpmr9TaVoKZOrfhfrNDDIoZ+Ls0muMVe1Fp5doON58WGyFgRvV 2c1sbegvjc1g+tJdzRD8Xw8Z4GHkIn6lyFNp36qED0ueKeyUdG5tFHZqgfQfkEVy1MoM mEeeihLZyPEC9JLYpM+LotBk6gNYhhc/jWHDp3QDC1sC5n+cQmvXQ3kQ/yWEHJcaKZng 2pJK6SIcXLdCVlg7F9K8Q1P16N3F9WijoJMbnyl1SV3B9gpwA1ZQ++X/KwtxcM3QRrQw 6Dsg== X-Forwarded-Encrypted: i=1; AJvYcCUH/qTKX7EtjgGv/9lis1o2hPx1zlsvCizrnNoF1O0XomIzG0dBda3WVjvxX3t9pUQUk/I8iOrDqUnQ3dPF@vger.kernel.org X-Gm-Message-State: AOJu0YyF3e5/lefJvNU2KnWsmSBagp7ofG9u7Q26QzLiu36Rc2JQwgD1 +tsd/r3I52XEWeLkiwsJDGMxTmaOjymnYeLEyPiY7XEGks4ib3k2hW6xqkBuX2w= X-Gm-Gg: ASbGncuh5OCj9lQWWzo6wNZeRNDi7CGQhtsuO+vvuwYg/PcgIVFnpXdmGo4eVDbp/P2 gpEQw4rdI5tXDs3D+BPWLybguO/p+xsvfJXLhCbsNOw5frH/iZgH9Rs1gBniRcp0uPgRxeyGKvt pkPXVz97FlJzbUKa6uvYg8riRvRGWSjCr1YEXzy/pINdqdBONPQ7QtwYL0upeQY13VBlR0IOl7l 2IV4bdACLKqmSRcJ0US7v9HR3DgCwCUZoJRYWc5oV3npKc7MeURspfMng== X-Google-Smtp-Source: AGHT+IGE6b4F5G8fB5UzCy612X2zS/z9Gws1TIKohedsOmxkKxomXTuE6wjdB8eKM7SaKj4xHi2otw== X-Received: by 2002:a2e:a9a6:0:b0:2ff:bf0a:2226 with SMTP id 38308e7fff4ca-3001eb8e67dmr19885601fa.17.1733478201781; Fri, 06 Dec 2024 01:43:21 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:21 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:07 +0200 Subject: [PATCH v2 04/10] drm/amd/display: use eld_mutex to protect access to connector->eld Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-4-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=1082; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=xBnYTDnWSnfj2+gm2t5bxnQqQ5FnybkVoMOlzhUTQDQ=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnUscueDleWgUKJKAcLnM9AVfyZmdn0HpKF5uCT kBmRHGm9H6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ1LHLgAKCRCLPIo+Aiko 1eleB/9rtsqyEXNmADXNUhLtuCtrT54s5AaOypZT19JWbxxkqIS98oj7wNLlcf7TA1rOQTNS5RC dvsjFVOL4cizIF20+Xp8TdJpnBVVRKORmoXxY/g+sGQsD+EyOh+b04CJUaXVrWxd8DJsAwzaO8w 75HquG2asaq4K33OkBPkZ85wATKlXdb9yjA+34HEfbGr4Dd71VsgTtQ3Ozs0zJ7lDxU778quIl/ b+/N+ADy5pyhsVGIAgmAr74L8TzRGdbpMnzmSPT2IwV7qsqdNr+KY8fyDGlhRaj2FA4wIhoLac1 9tx5/gz16qNpAiJ9A8ijUf1L2Ck59EMtUlTVlC/at/0sY+sa X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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 Reviewed-by: Harry Wentland --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 19a58630e774029767bf2a27eb4ddf17e3c21129..04c68c320252b5ce9647f0606fb86fe57f347639 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1037,8 +1037,10 @@ static int amdgpu_dm_audio_component_get_eld(struct device *kdev, int port, continue; *enabled = true; + mutex_lock(&connector->eld_mutex); ret = drm_eld_size(connector->eld); memcpy(buf, connector->eld, min(max_bytes, ret)); + mutex_unlock(&connector->eld_mutex); break; } 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: 13896742 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AD9F1FBC95 for ; Fri, 6 Dec 2024 09:43:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478207; cv=none; b=Tc8Lx4IfjFjMyO987/NfDAB7hkrcGpecMDRgjnyy9XuiLARAQBooPQ+SgyI2cXoaQuJeoDzNj3SGLoDHh8M9C9LwDppLIXiMPWOo/KV47QggPBAcPu8q5BklY/tWkO6IBZOaUOmexbOab+9TbIngF44mhrOOVBrDyaUn/lrvIts= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478207; c=relaxed/simple; bh=I1wH9N5enlUiSVwdDRB0wmAdGhFse9ySIo7WNjanmNE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y99N04jWO1Mx5HgiP0ceDqTvO95XT3p0O6+9vojhkRAvFhlQz4wuDpu3Ycn8UJiGtIM2bXVzsp4djn6MA3ucthdqI/jYFwIFWfDHqsM354CeKWTZ49Ru33S1U7jECz6k0fV88wEucWAarf4pVA0aokY29wMe8kIvwDwrzeJRzl8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=zMTifyCZ; arc=none smtp.client-ip=209.85.208.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zMTifyCZ" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2ffd6b7d77aso22751271fa.0 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=vger.kernel.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=zMTifyCZgNtKN3aR21By3nPi/D2irO8K4vuxD0UBeYLWeFFFana11lOWMgnoUeaySf j3RK6V3qR4EvdazHgY2402LnuPeHaoM2pxExEi9GkZiHuSCgSFnC8CxXcWzBJXxxBK2F 2Dlkc6fRxzTXGrwUf3+31o7DucopTradayayEvjfjQ3uH8i/r+LAkJOUzhAddJrPGqdq c0Mk28/cGzZWkW8pnewbaSSGQoVrx1DceypxgBBb0ptE3OMVocprmSjQ+BJQCiPmP62H ifJmcvCwf9zVRJ2P9PGrgo126Xzs8qwtk+PWsqHjiYJEzMbuVWQwSNp4xCx5qO3seBTY vGmQ== 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=hc+ltUo9mQEBFMBnjvdbg/8s/FHXuHyYRWSXkfeQ99QrQ3gGu1ntWGqANrMYBBxRZB zfxlj7Epto/QS4RBekfT87MRzStRD5vneQ8NUNSWVndF/QakO/jDBuwtfdwFcM+zaLJc sgkqvXta5xTm3LDYeBEfsts5ZwRVLLd+X42AkoqecZ4QxgsmJ0I2RDev4Bv8AS0LIvc5 3a6xbxWNrPVLQBgLyxaWzQAU+dv4C1fIMBaTg78no81Enoo4XjnuqRSgY3VD3LxoT19M dd72DHy24tXdv7XRtV5w2i8QR4T8CG//AbF8A1ZPnBiWwHCpyzxmm1MlwvLjdlyTTKVI rnBA== X-Forwarded-Encrypted: i=1; AJvYcCVz2rEkwomw/S3mutXY726fDXjDBFd33xbhgL8bGAQ1eaJYS1YIBfpt7JAt9NInT/M2VDJLQWtc63b3YRkg@vger.kernel.org X-Gm-Message-State: AOJu0YwbMzcDLk9MwDkSgAQMX1Os/L7eC9Bz4ONeEQjxwjizgOpcRD+V KRCfSysmMVHUVh1T0juCuehYMMB6TrQ28rlh3OaQk8KdPH21/H0P25Bgq8NOrc8= X-Gm-Gg: ASbGnctkExZFf3ismczcjBnk6K5HJ2/aMN/WEkZd7ZcYYqq6/eN68ZYB/0+GtQhNezW P6fzGzSzjHB9vV4KsuRUmi50J8oH1d7j16PskiDA8PpTHj6u01EI0pajJdgAGsHQH1MRXJuvI+n xdvqAPL7/JV/cQjmg+jvU8EaSRTaYVvq43Nkj/WzUmF23lmaadVCfCqJBZz1F8Yj9LVkYQxb2V1 8vhxiYgBKBExz14EGqY9QraOVhUIpG2cG09RTgI+uiKMI2UB+DCb3hyhw== 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 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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; } From patchwork Fri Dec 6 09:43:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896743 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D04B1F4727 for ; Fri, 6 Dec 2024 09:43:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478211; cv=none; b=JboNbb8xHRt2FB6hOJvQ4DKausk2js11EiycRjvXd3e28A02xwtccehazm6en2KdjNcoEEbnchmzP3+N0AeOGo72p2h7XZ1fDv4nFgsygSWJVJp1ooTNT6D9M7h3T+5SmFRK+flSp8WGJJjIATpCRj/by62mzEpjP6i3LK+h+8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478211; c=relaxed/simple; bh=tgOWbzXmlfNkUNlgKabtbqj34BDfcm3kqO9iU9YutCA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FaSNk/YBamRwuGoZzSG1KMCuOnWQ6U2cSwYQ2dmX2rTs6hANpj3znu0xvLWckRe8WKTAuZS/EsfR4alz0pMFY9aLOA53igv/t9kT0vKAat4dSnWje9l2oT8Gx2foQ3c3IXENMT8EGaVrludHb1pusp6nfIsqX9LuxUCDMJijAq0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=eM2Y5oD8; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eM2Y5oD8" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2ffc80318c9so16088841fa.2 for ; Fri, 06 Dec 2024 01:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478206; x=1734083006; darn=vger.kernel.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=gezQjvgIcYxaejQ8BDd64CZD9/Ck9vNVcEKNgvbZ4wE=; b=eM2Y5oD8FlK36+aM0ekPBXwYUzbNAZIYfrmLPaHp/glmF8CzoJpXwoFppi+vP5Okjp gUd9Tf97pVGnc4sXScOZ7z0K5AwgCCkNvVqdgMuvO1XIM7wHshe0+rE3rzcftByEL1Vo YjQdhEdZCTlQZ0Tx37Bo6tUMyX9b0XXrQeN+oRmI1Ul30Mp30q2n/tqDvddwmkNPwvxO pBmduRGm9zlvk6XAq+q53TM/LD9FUyzhRc7lJUw7Ynu4SezM4ESU873GFXmEkl8nIuNF opA9EFK7Id4NJKG2/wA8GD+yMMq/zfM+myGOB6EZO8YNBVffT/dCpxcKivLIvqneqskW sPlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478206; x=1734083006; 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=gezQjvgIcYxaejQ8BDd64CZD9/Ck9vNVcEKNgvbZ4wE=; b=Z/s3g/zZpgXBD7NGRl+k06NV9FX/7s4sou3hbKUhuFKxpi39PYwmCw0SKnaBygeu+R BDogaVApKblr4REtGstFx8mK9h/5Xzb8MHQN1PiuRj3iv+C+p1LsGbMQWkmMUWfOmdGl zJJ43FX7H5mkIvG7SrHuMfuu26s9RTrFwjzZVREwbn3OWGv5Ogkcp83r3ilPqw22mToE fTrj6eZJMsd/vNaR9LLEniIUTD1J8XnbzFey8shtYtFvO3Yh1+ukdxRUkleIJRpboADj MZtlTs09Fe+WKkUI/gFyeU44NZ6DivRzCqEtdhoYt0o+5Dp/PAzy0OU+JC87blRxy4uJ M3xA== X-Forwarded-Encrypted: i=1; AJvYcCWJxvPf3bFMn44y2/Ufj2q2UZ7t6UlMfof4sCGUGbCWfy7XYnbsFr0VqkdM2bc2GH+ByIXq9oo1SH2xiFSH@vger.kernel.org X-Gm-Message-State: AOJu0YxcbawQA1Q+jY8WZwWLmgC2hy7b25AQesHUkSJIVxIacf4vcu8t OQb1p9YEQa9lNuQBP2Zmx5PV4LmDL4DiEooOAO6YC7TUqWFpV+iIHoV4TVXG7RA= X-Gm-Gg: ASbGnctZz18pnXB1+0jTUpZH2g/8BJpZwjAzQ6c4KA9ZfVK3nr8x4oeXYlIbLh2quNw yuTteCjp1qLUu6hhQKVfoO/fM3UJDw4/daFhKKaeK4JJPgYCTLhZeOlLmFQRA0kZNK/k3M8WkV4 hkzgF9WpBLP+lvDAmLXqbszEdhqqRkKs0UNyXOT2mrNoozU0qoBLWiqwPa0g8vSnGDXuBIkEvcJ 09Sww5cocCP4nr0VfD1gP1RcIG5uWhIZfVZruwN8tboT7HLHT2pcRa8Bg== X-Google-Smtp-Source: AGHT+IFIxMP3XivqZCXghDCnZTnDDHCeTBksUkUbx72OhyJC9NMw97gxwKXoTkYomD8vLYGmPlA77w== X-Received: by 2002:a05:651c:150b:b0:2ff:c69c:db0f with SMTP id 38308e7fff4ca-3002fd14d81mr7610671fa.34.1733478206004; Fri, 06 Dec 2024 01:43:26 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:24 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:09 +0200 Subject: [PATCH v2 06/10] drm/i915/audio: use eld_mutex to protect access to connector->eld Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-6-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, Jani Nikula X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1533; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=tgOWbzXmlfNkUNlgKabtbqj34BDfcm3kqO9iU9YutCA=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnUscuyv5W8v1YTELbuHmMKcJNbiEngJDs2MHEM hFooEYTmIOJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ1LHLgAKCRCLPIo+Aiko 1axkB/99cecYxR+X5C1zAyfkKFkvE75Us55r2gVNp2BPRSD08mYQThqr5+QEsx38SPihPleo366 eaLD1hT6L2kyK6wdMq+Lkkj0kbXEPPTe9pj1Aad/UleIfoTG7Ps/uhFSFLdKRs0DnQaSZQME+VQ M2v8AFXHFAYJgM+8WPJgC0HTtuPSWfqBz+0JZQvtJgjoKRndMOmhlxr4vbN5xbJVZBgEPSDBujk kmWs3fgGh1o3Yx1/EyUv6Zz4X6sBrwrTlNvZNOSrOmgizBJLo+cBQyXqidSxYnZIp1DqJdxMFo4 Qq7ORf/cwV/dZd0e+mmP5jB0ifPb0a3lavlzcLRDNPRaca3O X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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 Reviewed-by: Jani Nikula Acked-by: Jani Nikula Signed-off-by: Dmitry Baryshkov --- 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; } From patchwork Fri Dec 6 09:43:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896744 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6455D1FCF7E for ; Fri, 6 Dec 2024 09:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478212; cv=none; b=OngK1DtE6W8WK7xGjEcBg1w0QF1jcf1dBID1xLkNHQIWvYB99/Yi8kQGebJuLnZRPCCutFWDcZYjIoGZ5NpNUtdu94m3PVqlqE5DOLdn2MDfCeccSgen8K+D9sweJx9jNqqg76Nu9CVobuRxjrFDn8+09DrqJNU/u0MS1/srVWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478212; c=relaxed/simple; bh=g8XDt4tMHXpR+O+C6P49zaXUZ1QAJx0+8PEn0RE7Eo4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I4lazFwuHEZD7F2Vkpx5uD0xEwKZ7Fx5IVccCt/VVh9HXzjAbMLgZ+YpXoSjeSZFVixZEt7iW+V1nuFctEG4GquJZ+ITAQJR5Ktbq33qTuS/eKbE2jEKRu1/uCvwW9NojKTGgdmQA6IUOZ8VCU16t5x3ed40xs/VqVGW9JZ9zd0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aIQtlsmF; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aIQtlsmF" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2f7657f9f62so17821381fa.3 for ; Fri, 06 Dec 2024 01:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478208; x=1734083008; darn=vger.kernel.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=MGq6aED53P5HelbsA7MK6wW8IBVofd/BuTMfX8bnHpY=; b=aIQtlsmF0EIv8fgE/9/WRbNLkzOcLHQGrH6Cv3kgecoQs5vqQfb0Cmp23Z1SufwMGL LdaHNVhYVD+edfnJU2hfnsAzt+6DVYUJzf5Uzlqyao5EUxrB9BrOaCSLzp79TEZIVyjV XMkZ3MGHI0THIS+xru43J1m++ZSRh/pmtPoia8rzKEEbJFzV1EDMGChxtBD5+rBeBcnb ITsNj8b61tUwxuIk1t3MZNjhWPuB6Lwm7elPhiEvX57ZFFVhnXCQ1E3up1c8Mm/fiZ9i pUai6jCd4HPx/jv0gE7jIVM+pCWFu6PmZ1GZzrVLJbqzxndBjzQbvDpwJbIUEZNUf4UU FJzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478208; x=1734083008; 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=MGq6aED53P5HelbsA7MK6wW8IBVofd/BuTMfX8bnHpY=; b=bN9IjjAYimKkyb2igcaIaB/z369CgOSP1eNQ9pCGXfGhvxLDqlYOdTJ9wtIH/CK7Zs Jgq5W2UnWEviz3qSrgXJmh2G7b1Vk7DQIqravtobFhiNlsM+mcA4/EyGwkX31H2bpOeS 5sv5sGeiIqXmY5trH34nEeMH1uM71lJRjfgcvvpuSgtHDOslHIGi8NY1GvkSDZ++54Tp KgNFC7g/r/hVf7YOuh11RzxO3HS3ebxF/QWtcZcWuS/MzbPsrouWFjH0cKjkok9NhySv 4OW3uNp+mQmwUAeAKdnkDKOhtL4cxX4ggNwvKBvnfsOngLqki4LZVATl/Uh1z5K6n2sx R0jA== X-Forwarded-Encrypted: i=1; AJvYcCUHk/LNgXftFpd1NGsmE96f2ttWr9Z4tzVINtDjni4AmYSOjW7AutzOjUIgN9XoQ8FX6XZlc9QumisxqBVj@vger.kernel.org X-Gm-Message-State: AOJu0YxoSU73oJU6MzRdibv8r3IMlCx/dBlwNPadF/uktoFvxmUfUuOT +htoBuEj7JZjeKCR2sU6TpQCedd8Ifpyv0u8F1yNSkj/WznpIY4TzXda8qbXRH0= X-Gm-Gg: ASbGncsdr+FXZfO/Yr6+fheapGABK/xJIgSh3uqFpHQB/mOCZFPNK2/utRPKfIsVs8A gz0v8DTvUjBqO7fsakGkizAauRsKUFyzcb52Ee9HFlCi9jeiP3E4cCF4opiXhBXUMSU/Hg9r/je EKt7dpUpDmN5OboYeNVkiSUKMn5W4xNnY1Ztrn2EHAebj16rfRI2PncR9V+vAhn49rElakORMhW /ktynb6z2qOuh938iYPXd5N8Y8hAR0A6Ye25YBtfV6kKOOym/CL0tTzUg== X-Google-Smtp-Source: AGHT+IE/NYxmjluRmONb1EoU7KbKKPH87buJ0IjBEcYtxmwcZQlKK0G0iiNZoTWvmIko49pJuOa6eQ== X-Received: by 2002:a05:651c:b29:b0:2fb:5f9d:c284 with SMTP id 38308e7fff4ca-3002f8e7df4mr10594341fa.16.1733478208528; Fri, 06 Dec 2024 01:43:28 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:27 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:10 +0200 Subject: [PATCH v2 07/10] drm/msm/dp: use eld_mutex to protect access to connector->eld Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-7-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=1113; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=g8XDt4tMHXpR+O+C6P49zaXUZ1QAJx0+8PEn0RE7Eo4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnUscuHK4m+of5M0K58J1Ue7FnC+JgeJ7oM6NSu bFPedJdqXmJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ1LHLgAKCRCLPIo+Aiko 1bfrCACW5hMSxLBb5or6qGH5D5AVPGJIvY9BGjNY1WTyi2PUHO7TE/oo3Ggc7rv7l860G7eGzQ8 uVT1bon1fazOdXW+lYbtHJWim9TYibboTYhb22pQ3YrpWEiuV1UbYdHBB8vzbzO9jXkq/bJmQ1m +E4FMSQ4cvduHdnEWi/8FNjp7zOIShlJYI1KIxungwjDjpEKEtea0kLBR1PRGwCG8/yZZUFfQxI QckeAW77aJDzAZbPOuHWb2f1rJKPg5flOLCaaqtxskOhiUml7r060zILPXNfrxMo4DMSMj+jYwz 1HVsVa0f3CLU5a7ZBeGqVsa/7rnSuUMsfCkuJrb6r9MQM91w X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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 Signed-off-by: Dmitry Baryshkov --- 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 74e01a5dd4195d5e0e04250663886f1116f25711..0fd5e0abaf07828157085bd680bfd3c7d32deb61 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; } From patchwork Fri Dec 6 09:43:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896745 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19D2E1FCFE1 for ; Fri, 6 Dec 2024 09:43:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478213; cv=none; b=Ax7aeVaZCc0rLsraxf3bXdOuwAda+B1IY4DdHl3EIi9qiLZqbxQ75i9XOlvqZw7DgxQE44hmoeSVRULhQTrWOIBMYqVAkU19Iln06222rOSH/cVNdfm3DVnWj8nOGSPBnnqzln7RUfIX1PSZeNAH+UIcp5uglkGirS1JlleJM9Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478213; c=relaxed/simple; bh=AjWhuCZJu09L0XJl9lmri3iZkU99jRBF7lQVFbOa47M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G1EwV62LYvtfifSKbd/ATGva/jICzwqDxHM4+mG1Ldz/f4Lcjf5JgnuIs8CwLVgqZpS8NJmDM4ZOtcCINz5FLlfLr1X2cnR6xgCaoVmowCzcL8VgRbGXwFyoPvSg5wyooLC9yErrGkvCAJPWbolK+7cULs75EOzuSFZvHNU9MiA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=CCAJvUX5; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CCAJvUX5" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-30020d33d05so15707511fa.0 for ; Fri, 06 Dec 2024 01:43:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478210; x=1734083010; darn=vger.kernel.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=AjfS6UDkVSnKuZTI4p5OY7qDfSEHNtP2btpHCtUSsMw=; b=CCAJvUX56CFYhOlbMhPZ+4P8UkO2TLATNbO9w+T4d6GP6Zq/ZCcqv6yEbtOX1qo717 p628w7u/4Ew00961aC9Jsdz5em0S3P0+KB9N/+An6CGSWfJPO+BMCKMDbt+Fhuviwi0P aOp2pIwx6NPYDpAW5f2SqY+fC4M6oKszKHCikKz64jys7jkA5jxxADOQYkwlPag3giDx CcjjtL5Z9SntcKqzg1h5uy1gtyyQa8uoM6Z7HDgzMaBfwlvs0LX12BBsmlFeMuKQkMuy gw8PbK12/WY9hIT1HuuOIhX55KWhRMUNDCUUerGUim8L2VfbhvEVz2dVBAmbS0XSeeLm /eGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478210; x=1734083010; 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=AjfS6UDkVSnKuZTI4p5OY7qDfSEHNtP2btpHCtUSsMw=; b=D1VOL+b+x9v8guI1yMIVW/H/VUnDx9hQ1g35o2h7NophBoK4ZpJavChloB5PapQoQh Wn/ywM3Esqw8Voi/i+rL+7FKMbK2P4LuuGRRUQ1uzjx2m5JSfcHNrqbgNjFaSnzxEc/R fIrhdVsJcax2qjOhigHSTFK65qRqUDlJ+ZbnEr47Z9xchYinK7rQlBkxmGI/m710PCYC IT1EGwidVgDdgClVJby9XpwRSKBkqa7kN5FfpB1PpYLIstaaC8LjdKlXMuwDt9cwVHa+ 5pZqcF25cfcYDixPKrZL2VhfvsYpFQ16kX6pxkp8UbcfVYXd490tjr/cIxZSVt0fAnYP rH1Q== X-Forwarded-Encrypted: i=1; AJvYcCUfEXPz3T7rdZeKCntXl64Wp0ZoT7PDrRGdWw+p7MAYKu03lE0BohwUQa4UufojyC4uzjrdCfO8tLGv+Eav@vger.kernel.org X-Gm-Message-State: AOJu0YxqgFVXF6zTeohmahmfAOPJdwO9x4YxPvSl69dmQmS2tnZscr50 dsr2aB9RW2qZW0yS/kUspsyAJpB8IK5+dRlQ9NfyTRjvNcAp57cXrFJm/VcX4x0= X-Gm-Gg: ASbGnculxfc7IknVyiTROdpnQhpj3XPBWKUY9+rqkiS1Hp5MA2gnGvaNFLWX2vc/L9o 4r3vxUEjTaT+lxVPkq0GJ1Vf5FxGLXxqe3nU4xdTmhZHWiAaGFKfFoEohv654lMxExfSBq+Tc0N deIMoASVCkmkQ8CuDsYRcPeZxcmdmVm17ZEtlxW+M9U6XiPuaLfZKjRCd6Bcgeg7TURdOxvg8k0 WVHGWPO/V1Lur9YTXcYf+JNjkPp/dhSMZ4x048nYS3BMUII2kg1fyLKkQ== X-Google-Smtp-Source: AGHT+IGlcn6F3j2D0eEiigVRHmv//hcsZLDTDwaSW1v+B5KM/LuoTROXlD1yn9Re0AjNw0cch3o94w== X-Received: by 2002:a2e:bc20:0:b0:300:ea4:4e24 with SMTP id 38308e7fff4ca-3001eac5caemr19445861fa.7.1733478210244; Fri, 06 Dec 2024 01:43:30 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:29 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:11 +0200 Subject: [PATCH v2 08/10] drm/radeon: use eld_mutex to protect access to connector->eld Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-8-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=1057; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=AjWhuCZJu09L0XJl9lmri3iZkU99jRBF7lQVFbOa47M=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnUscv8mrxYpdnQrN5t7MGxWbI8gUEf4HV9oqdH /GygnY/E/+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ1LHLwAKCRCLPIo+Aiko 1eNuCACvtbdy2xfHWggRb/DI8ZumCyXC4iUXD9iziSzFcEDO8vqI/2fCDKjMpxlhsveDfytOBQZ oRdOPeOkoLL3uO62vDV5V2VYiUsdsxy4In6Ro6X3P/aCKb6E/3bVJBjfF1e+BpO4HzEDq5bshin Q8sislvKTDt/zFBM9TzroMIyWvYqMXzAusI5WH25he5flEL1wFwcBCMNr+2XOZ0+scdlLKi33FI Oi2na5oqsLdlqihifCjf1U3GXLKvDL4fvq79UN3+5aL4Wj6ChZbQ3Kt5ArimSGb7uZURbdsOMGp mVjDJQsRZ9XvpdnrqBt0x2sTm0oevUE5ykOyS/V7haBZ9PQf X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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/radeon/radeon_audio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c index 5b69cc8011b42b4686c02f97a2b451a63d6c346d..8d64ba18572ec4bb6f6985be3a5edf581c47d7a3 100644 --- a/drivers/gpu/drm/radeon/radeon_audio.c +++ b/drivers/gpu/drm/radeon/radeon_audio.c @@ -775,8 +775,10 @@ static int radeon_audio_component_get_eld(struct device *kdev, int port, if (!dig->pin || dig->pin->id != port) continue; *enabled = true; + mutex_lock(&connector->eld_mutex); ret = drm_eld_size(connector->eld); memcpy(buf, connector->eld, min(max_bytes, ret)); + mutex_unlock(&connector->eld_mutex); break; } From patchwork Fri Dec 6 09:43:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896746 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C92A1FF618 for ; Fri, 6 Dec 2024 09:43:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478217; cv=none; b=i1njMsEcVEpsnI76m6S9DaSta/mkJie8fxdjCaIcGIkuLYtuydUD7hckneRfaSj+vB8zssVSuKlJ8Dt1mSrcD4buoPK7hMxPb+YS1mNjRekZF8xLcSHoLox5Yxb75kG2fYhZtRMBxlutTonauteQfU6A6OlbPoTG4N1aLX4OWWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478217; c=relaxed/simple; bh=T6JPeyhrynxKGaIZwOdTxaj7xNpnpZ0LTNopG/6n9Zs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=abrx1F8KkpO6QpRSxtGZ1CQaHyWBeuSbmgYlMLuP8vjnClogU6aanvvkAM41nnU03GfW2Vy0kh8HO39vkltEKEi6vLWRKhS0uRo/SD3FI4GT8oGpcDnNhcdhplZNBVJDSiBA2oaYxn2gCoTdm+5VEy0Tf0ZZNOEKWT2Tn7qvPsM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Rbsh7qLN; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Rbsh7qLN" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2ffc81cee68so14845111fa.0 for ; Fri, 06 Dec 2024 01:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478213; x=1734083013; darn=vger.kernel.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=ZkigUKob5Mc9L+QSG9Cb+AQa6odUVvq9Ya0HTSeW6cY=; b=Rbsh7qLNujyPUFQKinxIN0Ng2skvZKA+NxG5JdezxXKgpGWF8BBpIGILxoMe7V7b4h wAjBLdAdrLprXb2yr0Bm2t8ix8bBIwj46kT7PPzcS6FPNeWOC8ZPLpVymvwhS7/wJ3xr EClxmZt1FdA10TkQh0jb0o+Xh2WonncuqEORr8EtaLVCgM5HTPCp3wlPiewU1F6v7cS/ RIe+UNy4HZ40pYmafo44uTIeG37lqmY8KkDya8UsOJpq+jNP/MRo4FuBa9A5KRfYP8om v8c9xFcEbWEPPjHtB60RXoN1/7E46r0O4oGzc3PWOn4/oX9VLMqmi2iNorBlkm7IRjE7 Su8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478213; x=1734083013; 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=ZkigUKob5Mc9L+QSG9Cb+AQa6odUVvq9Ya0HTSeW6cY=; b=OaEqS1R2mRjxbh/+veqTh7iE+xx3CGs+6OEbRor+h5e6na1BXt9YVd9WxgXXZ+z641 3bUcN6pgimB4ojw+SRB8qSxjWbPE2+eg8mkwZDtRMG3SSsMZ6iL1eGv6uYZpE54RTz5/ 3tDNCAnxy3WnE8Hp6yQyBrmjwKHOEcV+czxgfk7gI8wxZgzsmGYUREqJaIawhwXrxn44 JMSTTUd/49HoBqbdcrm/eZaaBkVTHePwAmUfSsf4mX8pOX+RiWnZxYIX4X4BzHUiq/UU xTn1Sed1LyeLlTGeeKVufcR+sQJM4L1FAKJoSGK8fAKwU2klt27i9uTHP64dqpYsrgDk MxFA== X-Forwarded-Encrypted: i=1; AJvYcCXt0miw1GZHF1Wv6FJNNvA5A/F4Spt6DrqkPlIlV5uv4Xj2ZZL3HJEB5TCCUDdyUIc9YKEbOciA2fxs+QD1@vger.kernel.org X-Gm-Message-State: AOJu0YwJRQNJxSwPsq4oq3xsTqErwZGeXvLDYdG+yomGIaIf5k7HGZCc amOm9UZmoa57S5hx+AOtDpqDcKzUGabNOX3+o4U+T3NdbHz3avBZsI1O05FDXTE= X-Gm-Gg: ASbGncsegKEdUVCbmXQq7kP8pu2ouAlWfdykK6Tcrgd97/uCppxay8FgLAVDf6Jtlv3 YkwBVI+gwPSqVnMnQv7ZqnjlCmz1vd8WSZTer1DCkaKiskquB0vrXTU/GPvTCG7j3PeFA1bb6E1 ZUwUd58qmEdlR66fJW7ixOoB82AsEVj7GzVhdWg0C0g5PjC2n0InBhf16lwm4BGZTlaR/csEsZ9 ilfB51nbmK8xK99GTsL4avcUXN4qWrf/AKu8sfpvQEAdFlNvtxDvfEEAQ== X-Google-Smtp-Source: AGHT+IFnWgDd0LQiOOyqxao9HQ2SRRt2EDypVuazWQgG9g3xYWmvYLAFADof0/JzzA41KcgjmV4COA== X-Received: by 2002:a2e:bc12:0:b0:2ff:d81f:2d34 with SMTP id 38308e7fff4ca-3002f89e73amr8312691fa.8.1733478212768; Fri, 06 Dec 2024 01:43:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:31 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:12 +0200 Subject: [PATCH v2 09/10] drm/sti: hdmi: use eld_mutex to protect access to connector->eld Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-9-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=1066; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=T6JPeyhrynxKGaIZwOdTxaj7xNpnpZ0LTNopG/6n9Zs=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ3rQcX25kP/6099+Y3hx23Dzne8aLO9XzJFZb9z4/HOYm bH+tPU/OxmNWRgYuRhkxRRZfApapsZsSg77sGNqPcwgViaQKQxcnAIwkYJV7P8sEtsYGnS1fHZY N6v4y56cu637YlyXwKadV03zMlc4ttxq3Crwz6qYV7CtsrDo9MHlXvvuuuT7v7hov3+iOGuw84P eOuPsuE9iV7LLFxUsPR5gYsiefjVFO1nyt2usyI6ibhPhj7UMf39E749suNgw22P/LxFtziC+Tn WRtWELrrEc5tq9toNNREI5uXeBpOlzlubMi7bXX1sfPDcrdsf/x9liHJvac29p84ZL8z2dq1QgM 7WlwLDhy4Qy7cfXWq0FX/w0s3kRpWmncvTdkXlJk4OKo1obHuSqT/3/T0mjdGMFO+vbmWI5eW1f jWc/nph+IGb3ku4TXWv7Lms/8ba/PcPz0OyqzlDRlRoPAQ== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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: Raphael Gallais-Pou Signed-off-by: Dmitry Baryshkov --- 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 847470f747c0efad61c2ebdc3fb3746a7a13a863..3c8f3532c79723e7b1a720c855c90e40584cc6ca 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -1225,7 +1225,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; } From patchwork Fri Dec 6 09:43:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13896747 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 427E41FF7D1 for ; Fri, 6 Dec 2024 09:43:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478220; cv=none; b=WmuzmY/PVF3bZXUW4lCJhF5FWpFS6Yv8cK6+nsPvnNG4WNGmHMwkshWLCnUCT+BezF4Gyrh2jBGJA1CUK09FbxVZFDVdxzQleK3kERb3DCJ0rhe+hgJsxYUsk+58R3nzgslBHyT2tS5h9Cy2vgTDXAK/v51GQ38LmuroyD4l9Cg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733478220; c=relaxed/simple; bh=MWBHkdOEPsNn+qx18lkyYR76WN4/LOkeB2bs8gaz3L8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JsQl9x6subkYX5skNnOjMwPnuWVrJn/LENk7+XSzYb1oe13td1B6ulxAY1y9e6KInXMi9UrpRoAPT0SZSHDmOdbaApKWYxS5TgDkiX29pW5ylXR0QRNZzKkxm+U+RAycRwWuaLudvOxwhVM8l5MymqaayhH9wfSZnmmv9YNzlbQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gPtXq5ar; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gPtXq5ar" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-300392cc4caso1124901fa.3 for ; Fri, 06 Dec 2024 01:43:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733478215; x=1734083015; darn=vger.kernel.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=IK1o74pdns8MHUCAUXuevFOWZGOyLWsbPpjGiW0nUAA=; b=gPtXq5ar0qpPdnJUGscli3UI9uaPnKiu04suBW0uHlTvnxJAz3tWNYF+XLXnan6F40 h0Xd6SE244ZzOfv2OVRJ3aNm3sSxIBfNigDvpmPNyydxVUcDBnSe6qWIuI9ln6dOCL7+ QvDDK/k21g4mKkl3qxnKtknCllMkHvF3XziJ1J6Cd+Hi0NAKSgM/aSqVCipZXCcBlFDI DkHEBbzQWAdi92S0C+beFEmBD75NzyRt4yVw/BoIkdAtZCQPArf4tVPeLUbIVhBQyx7F 39cl4M+tMgnwod97BhSBt3aq9vb7KM0AH/Qq44EZScre9O998K+Wzw6euv+5YbxDLsnK XhrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733478215; x=1734083015; 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=IK1o74pdns8MHUCAUXuevFOWZGOyLWsbPpjGiW0nUAA=; b=ZgDUoNArTpyjDFy2JsaewBmwSS1o2OJmQhv3+RkhAEgNEKa6QfbCDVFQwondiqj9De puPheZva3sAJrgL8z7wLVvFACU0Gk7F7Th7KOqxKUfKULqrMhyT6nfnYyDr/+XSO3YKN t14ckU5ZifcT4LreY9JWiC935brILZvOW/jJnSgME17la1ExSo7D8VG0VrRF/RH4XpnR 9yuLW8amdZ/GZW5LnX1Gh6A8KDIkWjTX0QsY4KvZwNJJzAsO3jpvEtF8ednIO87ywCeG AZnKkIV0+DqSfARdTqJCOyPPfjTC29OLPbzYbPTr/lUvJ6o914bWERQHYvu9Iva3J2Lf Z6xA== X-Forwarded-Encrypted: i=1; AJvYcCUJr1vly1Uc2eBSYpkzMIgFbi4J6PpJKqALSvCrWzKjrjdNBDaQHC1cCt11bgsUozr4Fjpkenuq9qnNHLe3@vger.kernel.org X-Gm-Message-State: AOJu0Yy9tpkWGLwlxH0iTkjcmdTFfHwTFLtfnH10F/Eer1MlnAGLqMyO t/GVZKAQuRGq3R5HfcVvd2zTR7Eyou6ThWxifeWaPZ8ksDu3a9+qW9ct7JPZGtI= X-Gm-Gg: ASbGncuyt9zBtcAcZgQEyXUNJP8p2ieZvGCzYU/jjNNyHwak5L5YNW1yNqR5doCcfCP TpPNzDmxRX1TC9D70JjwNj0l1jShSU6wLgQG1Tce9AOzTQzQX2nNz685lXKYQN8kNNU1GsVorjm ym8Ro2nQIUJOyRz/416Ez2/TfJM0ZvciNferpaiO4t6JPrpNtakDcMyQHrDhu8mJkc6aThhbkvl OFKl+ueHzCNbkpMK45DfK+cawKqsqVXy4zPT3/KMATzRnNdy6/09qqjjg== X-Google-Smtp-Source: AGHT+IE1jgPInMsiwRYU6/dysOt31sV51cEwkXMndrxO+i86Jp4v1LOQAej8bchTiqXotmvpJS013A== X-Received: by 2002:a2e:9a0e:0:b0:300:1dbd:b252 with SMTP id 38308e7fff4ca-3002f688872mr6560751fa.7.1733478215436; Fri, 06 Dec 2024 01:43:35 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 01:43:34 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Dec 2024 11:43:13 +0200 Subject: [PATCH v2 10/10] drm/vc4: hdmi: use eld_mutex to protect access to connector->eld Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241206-drm-connector-eld-mutex-v2-10-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=1109; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=MWBHkdOEPsNn+qx18lkyYR76WN4/LOkeB2bs8gaz3L8=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnUscvPX017OK5vH3lmiCwL7kaJ0UcI+IYa3uXe 18ffiiI2Q6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ1LHLwAKCRCLPIo+Aiko 1TqVB/4m/VFWpZc/Kltqn587dwO8poPOaD02T82hJ5yhbMgXNJJ4xBgopTLH+t6y1qLkjWvPRa3 +noOhRXSMbmizw9O0yVwv6gxNAM+4g7LDPk06MwmatH6VGTF1E94wSnAXNKaI8qC1bl2SrnJ/BM KYHiVVScK35O/os2/qE4pWE0LXnnmku3xyIW8Ls6WMe1qmZtWPFHDfeYDOFCvmSz25/s1Mwwfwd KFZzI9qf+sRjDaObOOZkPq6Ckv7STP7qIOBBfScm5e7oF+CtiP6mBXMg9HuQFUocZsKI9nsQmsq 6UTE1LwnESZWvUAQ4ZC1j4eA/WqUA5QdWk1RE6h3yZLXYzYt X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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/vc4/vc4_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 297afd89036ba8fba571379f5b6d63227eadb66e..f98617b8bf6cf9d92a806e35584e8f8ab0ac9f96 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2220,9 +2220,9 @@ static int vc4_hdmi_audio_get_eld(struct device *dev, void *data, struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); struct drm_connector *connector = &vc4_hdmi->connector; - mutex_lock(&vc4_hdmi->mutex); + mutex_lock(&connector->eld_mutex); memcpy(buf, connector->eld, min(sizeof(connector->eld), len)); - mutex_unlock(&vc4_hdmi->mutex); + mutex_unlock(&connector->eld_mutex); return 0; }