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: 13896762 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 1BA8BE7717B for ; Fri, 6 Dec 2024 09:43:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6401B10F07D; Fri, 6 Dec 2024 09:43:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="tXZXrFUD"; dkim-atps=neutral Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0AA1410F07E for ; Fri, 6 Dec 2024 09:43:21 +0000 (UTC) Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2ffd6b7d77aso22750681fa.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=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=Wh7X6NiXjO0ZK0icbu5RRSIlyMlU/s3VBkgppSRGnTc=; b=tXZXrFUDq2zcVSLsBEQt0b7ZczZDF/K1IkZE5+A25SNxDKGynWzqEqOPSzWpXqPbPl x34DnAgEHpjzR9fFlWkt0DvwWfrjSC+88lXlLfws2L5zEF0K/rQj0ixwqIDfvQW1x1oA k8Jz/wGT3vYi/D28NU5B4QcUYqKRhxBS3nP3IMKkpdbBIRpLfRB8wqEwCZgmqlQU0WrT sqmxee/W6ciFmwrM/vHY8tIrIgt0nUejUAUjAOIKH+0fF0SJOL4CHGltB4FHHhlagmqY BucvmZ6q+ZfFyIcqVIhBFp80RY2K6I1EnN2jKS+/81q5Cm43VmDM5b5BEVtceMHmTM5e H8Ww== 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=QKFHIo6Cxrc63BtpvgK2Pn3t6HpuaBzuA/z/YDZh+dqzReL3IJHWVnuqHz6QiCeg9b nI2ahCEyVh542qpSPl2G/djUwJAbrDSGtWNTJlBBlKg//lyxtJzFwJJDZlWr/M6dhboi nAyS/ErbsaAJISHgnEGz5X5RJvKfxI7o0clzCUH+zvapeyp5UD/U19/C4cFfuYF/vwCU dS0OQoKDJaEyMxYAVFOTGRQwwrdECB8DQwXIlzZTNi2l57cWbiZ+dBrL7Nf/8P/U0UG8 mfd955HFei3v6zOC2NyIGwSL3s3veNbFCfUWlsVPoVxxAG+ky2oBXXeMcWmRpk2L9GfC P6AA== X-Forwarded-Encrypted: i=1; AJvYcCV/ADsGm0p7x+eqTms9VJcSAugdGUSUSbpEvs+cOW4jM4qh2c+dEeqgKrzc82sVFLA7X4IFOpbBLeM=@lists.freedesktop.org X-Gm-Message-State: AOJu0YyLegAWCN6HUscNa1kV0Gm9b76RmU6/hrSRsKuRX4v8wNKxCI5R mc6X2+uinfIWfYqZzpj3Ygg0KgolJW7Lvxbd2jZoVuUFnllSSdUFqeOOI4JI1pA= X-Gm-Gg: ASbGnctus2pWP+4CgWnrQH6pUXmoywzltBBulYL2cgxf3egjLCK0QIRsqmTyMpnIPly gTuK1U2uLMMOER/f0chqnGI51/BltcLRLl1UWxFFybcHodfJbHeODwC4VCA1pY73ph2KMDt+1un dVGhKvk3E2L+H7Pj+I7BZS3Sr6HsqcrLVsZ90rX1bvxf1Y7dITmlgogyefW91w2rRLaZobWCFW5 8f3pvlBJA9CoICFbRnmgFj8GKOBKlmFa1LLrXqRolZjcdWex2PZExswJg== 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 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 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/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);