From patchwork Sat Nov 30 23:55:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889321 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 9AC26D7361D for ; Sat, 30 Nov 2024 23:55:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3789410E0E0; Sat, 30 Nov 2024 23:55:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="YnaZB3xG"; dkim-atps=neutral Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5782C10E0E1 for ; Sat, 30 Nov 2024 23:55:31 +0000 (UTC) Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2ffbfee94d7so25117331fa.3 for ; Sat, 30 Nov 2024 15:55:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733010929; x=1733615729; darn=lists.freedesktop.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=igdGJ+6WFp5yYbSTVfMkHAFbN2LBIGOZkBsdW6CIVmA=; b=YnaZB3xG1SkaALAmSaovCQAA9ZCHiOX2UMtHXfUK1XNZbu3K0xQGsJPJxXKUe0aKIA Ni01slDfKWMYPFOHDPkS7JFFXQQMb3Fu2GXujHZ6b80WbRiHQmI1BgGLJi68gkTMvY5u ysDEu5GqoKRU3v0Ztzl0LJu1I3aHjyRWph8BaeMAGaBOOZkupMKnQH3pXLWSYZZjdL+s MbZTuhhvL7wd8HozM9eLTmO8Ak7Bta7zkWq04nAW5rwaKwAfknXVnrK8JsOHkf2ivyzf LteX2B2xH5rmnhmXCksIc+a1VKKDcNGYzS5saOGIAamKA9unWtnOOpVBtMQqA3LCR+T3 6mdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733010929; x=1733615729; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=igdGJ+6WFp5yYbSTVfMkHAFbN2LBIGOZkBsdW6CIVmA=; b=dTdsNZGwsa9M+LQ8UtQKwkyn6dstcPKeYHIEMgjx6qS4vVBo1Qj297V6qj7BsEeonr wU2f1uwHbai6VqMm7oaS6OhRbnKRIzwR3zwfVL7q3QoZZPlGwFY2YxtluI0qS0pLfVzc bhVpKbIwXkguMATQWq+gAqDloy3ZM8/71aHFANEa08IWMMCulE9p0JsU/OZlylZMDdhO cmiM+5tpnx7XfQc0MonWKwYav3mP+zf1wVkeqVjw+HZsRy23lbZG8+P9aziW1pi68qzb 4TYfuDVlnKS62wxeGfXtwPgmC7WNBOfoUWzq0tjeaka+HSeeLPgO3177ZnWBKzLO5bZY yCpw== X-Gm-Message-State: AOJu0YxQkw6Xe2fE++y1p/ElKocsinb5MwEYmJTBGQIjK102U5vitNsC iP1H3Yu/ocINPM3tWc2LXKLoAmV8MGA2kseZbv7Eo29zTGy14zSBzTzaqg+zyAY= X-Gm-Gg: ASbGncuWsetKiHKQTIiXM+91C0HJoHCu/9nQPd53470OjYho80rEN6G0tmMSbA9rWes wFRkhi6vBy0bQQwrGdVLUpjQVAvL2T6LNQYa0tMgevZQz/it0s7+T9WmLBbK5sDiUblAyGz7pJE A+OJvY6tZUh2P6itRwuOFfejsLqSdMlZ091+305KQb0yXwsRaql7y2Y7SyrMfx5v+feQW1/AU9t OrIHi8CDf2orFuNtRopwC9N/M+HNvDqS9aA7uAoQvsuVyWOXjxA9ACvnw== X-Google-Smtp-Source: AGHT+IH/lMi82z0v/iMa3bnH3O48sOuTvGtLHugaIGP26xUYLLpIeMPo9osg0TDFc6RKyN8BchLK9A== X-Received: by 2002:a05:6512:124f:b0:53d:de48:7409 with SMTP id 2adb3069b0e04-53df001cb8amr5926461e87.0.1733010929250; Sat, 30 Nov 2024 15:55:29 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df649647dsm900706e87.195.2024.11.30.15.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2024 15:55:27 -0800 (PST) From: Dmitry Baryshkov Subject: [PATCH 00/10] drm/connector: add eld_mutex to protect connector->eld Date: Sun, 01 Dec 2024 01:55:17 +0200 Message-Id: <20241201-drm-connector-eld-mutex-v1-0-ba56a6545c03@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAOWlS2cC/x2MwQqDMBAFf0X23AUTFWx/RXoIyVMXNJGNLYL47 wYvA3OYOSlDBZk+1UmKv2RJsYh5VeRnFyewhOJka9saWxsOurJPMcLvSRlL4PW34+DeNW/XdCj oqdSbYpTjOQ/f67oB3wr3/2kAAAA= X-Change-ID: 20241201-drm-connector-eld-mutex-8a39a35e9a38 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=2285; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=h9SpCjrnoVeyG6yy+hC7dnaQqGomdEDru9YX9FtBpig=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnS6XsZ1/pqxgC30AKzvdNBVrv5HQb2dJZaZ5zn VEhrpDwtKOJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0ul7AAKCRCLPIo+Aiko 1ew4CACbQcTx0V9Sgmz8qhhsUnlM0Vh+dbbDTDz41dhDdcEgbBBokvib8Go3fPRoR2hiD5m4p3q Inrqmtu6WxnuFTZ0QoZhHX0EdGBd/UJUWQcfS5pdXJ3Xg23dIDNSEqxBkJVEmRicpeJ9ZaUAQMi YdIJpl1FT2/ANTrI2tncuw5hhWL1lQ7u+U8y6VrDr5QZjFXAAeZ0Zu3y8lTuITAxcxTLjSfCapq SK73gIYvnestQ4yiI9RsX3EIyujQ6z18dGKF1awnRjx9cXrXrBMiBVD5XtL8+PtSrfWgAuHy9qW g8v2j0eW+fy5k2eNqU4JbP7IJfm7WWm2CTjtdsikNnIqWkIv X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. The individual drivers were just compile tested. I propose to merge the drm_connector and bridge drivers through drm-misc, allowing other maintainers either to ack merging through drm-misc or merging the drm-misc into their tree and then picking up correcponding patch. Signed-off-by: Dmitry Baryshkov --- Dmitry Baryshkov (10): drm/connector: add mutex to protect ELD from concurrent access drm/bridge: anx7625: use eld_mutex to protect access to connector->eld drm/bridge: ite-it66121: use eld_mutex to protect access to connector->eld drm/amd/display: use eld_mutex to protect access to connector->eld drm/exynos: hdmi: use eld_mutex to protect access to connector->eld drm/i915/audio: use eld_mutex to protect access to connector->eld drm/msm/dp: use eld_mutex to protect access to connector->eld drm/radeon: use eld_mutex to protect access to connector->eld drm/sti: hdmi: use eld_mutex to protect access to connector->eld drm/vc4: hdmi: use eld_mutex to protect access to connector->eld drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ drivers/gpu/drm/bridge/analogix/anx7625.c | 2 ++ drivers/gpu/drm/bridge/ite-it66121.c | 2 ++ drivers/gpu/drm/drm_connector.c | 1 + drivers/gpu/drm/drm_edid.c | 4 ++++ drivers/gpu/drm/exynos/exynos_hdmi.c | 2 ++ drivers/gpu/drm/i915/display/intel_audio.c | 3 +++ drivers/gpu/drm/msm/dp/dp_audio.c | 2 ++ drivers/gpu/drm/radeon/radeon_audio.c | 2 ++ drivers/gpu/drm/sti/sti_hdmi.c | 2 ++ drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++-- include/drm/drm_connector.h | 5 ++++- 12 files changed, 28 insertions(+), 3 deletions(-) --- base-commit: 44cff6c5b0b17a78bc0b30372bcd816cf6dd282a change-id: 20241201-drm-connector-eld-mutex-8a39a35e9a38 Best regards,