From patchwork Sat Nov 30 23:55:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13889362 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D0C68D73619 for ; Sun, 1 Dec 2024 00:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uB5LaU5I1hAwk5eHmDH3lOZn5FvnrCwCeIdoknlGoqs=; b=C2pKn5hwDVi8fD90d+BT9rweGb 7kUbtk89RufQ9riyX5CdSRzrJ5/sVG4thCIAGR6b+HApoequFBEZB/0/mYOhD4Ma82MB7imOEhupw TlKAexXkOmXnz6bDSiuCH2iX0x/0QLXGxlUA2PgN0O+RW7BLs357x1kCh3+bRYoBULK5zw8+7f9ya 9iI+qpgrDmGZQ1WqP91rMehbygmImg9rcS3OFIURRtP587u3var8PLKbI9D2rZwd2/yKd5ZDg/CB7 U7oIrPYZB2KYc6NAtL/lb7Df6pstURlqcubjW8vshSKL/pzu9xsDNYHFQ5/5QvpBvO0DEETeTU3Ye jXJVWQbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tHXQt-00000002mFo-3yeu; Sun, 01 Dec 2024 00:03:27 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tHXJU-00000002kxi-2gXc for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2024 23:55:49 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-53de92be287so4395894e87.1 for ; Sat, 30 Nov 2024 15:55:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733010947; x=1733615747; darn=lists.infradead.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=uB5LaU5I1hAwk5eHmDH3lOZn5FvnrCwCeIdoknlGoqs=; b=azCxqqVt/PKrsLwhH6dnbfG26UItcqV2EuZ73HwERAtJmUKNKljSii3wsnuCkubPnE l62oJs4U1R3tkxlgC2MKR+YFk587a/GqS3UF7irH5+/PugCwev3QHuzMRZIr+d2uhb1c +DShgOef2hzpvFZQ1I5iM4fluESb2liXaP1tFy5mIn80+zgSuwsfL3WrxCclyxlTagjK 9zaqFAeIaSxYJ1cRotYdEpg+DyA6X8g/F6usl2Fq+lISNksRAB5uMi/LbJQ1w0KPJvfb N3bLyJ1gNgfccNv0NlLnXppko0N5IhmnmNuiKpryGfx04AAi8QQDO8DBEDD2U1dOPUU7 eDAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733010947; x=1733615747; 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=uB5LaU5I1hAwk5eHmDH3lOZn5FvnrCwCeIdoknlGoqs=; b=eNtai/G+Tiqq2GAOWtjIoC8Hkc4FQ1HszLM1GcfSNzdTp4+MCdqNjvcgsCKjuUAHFX zRFdI1mCf4/hNFatndfHiCjeCY8VQnKKcDVonvbsOG16F1zcwtfrrReNTR7twBNM7AJZ QqaLfE9lfnh5Janm3HZmkGfqZQaBty1ZQPrNmkcY0zZWYLpVZYyJ+EUXhpm32VuQ8+3u VHrk31KL9yiyeHSDH2ccSItZfPAaanIVQXg4hA6lisJ8/Pre0Rj4k7j7Jcib2RK4HeDT nOjmVsmE2Qg7c1+IuuB0kTN8Gk89g98cArJKUHroLfSeZrIrHJL1gvaW1sB43kn7X/hd pnSA== X-Forwarded-Encrypted: i=1; AJvYcCXD2ENBxS59CDm+3aoXwslLQ0oYfrQ7iVbWQTOIAE7vwHjULu5lgcTVxpAPhZPnVKal5CbSlrbU8AsjsQhl22gl@lists.infradead.org X-Gm-Message-State: AOJu0YxLtIGtxFCRUNVvfNU4RUCzbjIp2+eOF4xERy1/TN7xJg+xWJ1j 23CMzCorUS8PkdHXw4GA2O9ZJyioJADAJrlt5WuDHuyuz1GaY6jGy9MXGYQ0+lA= X-Gm-Gg: ASbGncuhE9rGLB1X/EAt0HA8v74UGBBbLwqT4H3eKVFnVv+eLmgM6XQLudb/iclciuL f3PPcEFkcZrrKqTUN0fTEWqpA+JJ3jRDuP2ZAdk0Dif7X+Ximv/m++mTEkuvZkidewdC1fSOd7/ dKcnTqfWxIvQ6RleBCYkEKlKn2a98MxpeTo9kjs8GwuyBDmXCxR1K6Oa8Q0eaO6N9b3oddJvJjU OqL9Mc7/Ssk6inL89NPQdyBs2TT8IDsvRxsOmy/0v+I3ONwoi/tYy24NQ== X-Google-Smtp-Source: AGHT+IEnSvktg0pFWgXq/l2+bx5WK3xZBCs4AgqZphc3ydAvUjOE+sdIjebGqlor4oQyehHElEBbzg== X-Received: by 2002:a05:6512:3c99:b0:53d:effe:591a with SMTP id 2adb3069b0e04-53df00a91e3mr15018922e87.3.1733010947102; Sat, 30 Nov 2024 15:55:47 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2024 15:55:45 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 01 Dec 2024 01:55:24 +0200 Subject: [PATCH 07/10] drm/msm/dp: use eld_mutex to protect access to connector->eld MIME-Version: 1.0 Message-Id: <20241201-drm-connector-eld-mutex-v1-7-ba56a6545c03@linaro.org> References: <20241201-drm-connector-eld-mutex-v1-0-ba56a6545c03@linaro.org> In-Reply-To: <20241201-drm-connector-eld-mutex-v1-0-ba56a6545c03@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=935; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=k/sdBeuIX6ZzNNN1qtwuMpr5v3fWj5pwQ/L03Dq+sDw=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnS6Xu0rcXOn0b4oPtwTlM+q76z8lrV6nasm4mB qYwkSdVllSJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0ul7gAKCRCLPIo+Aiko 1b8QB/9U7VqcSXJZcqnwzL14LI1Wm8fa0Vof9aggdEKIguYFSF6mBJxkKrcGEguEcmRWj1g76O4 hIPh6905NyRZ68dga7ppIwiH6+nuI3at8WHRyunXXScVm9yF0PsQ8bUDpPggd+hf5CS2nij612U DTBvf4gwViH4u5cxRfe0AoiK1SATjJXbJnm/r609EbOJDGSVy+bbt4lHoU054mBGEovBV0eVHbj 4VVam6isr2QpQJrTR4xtpKiiwUpVeFWoLxtsqui/lAqHwHNlRcqkZSMaeHh66xeCZH4wQ38Jo1O fdJOPzrGvySmqm3sGjUZSaZeFAPrET/XsBL1IOzrdkLgxrMq X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241130_155548_680003_7BC1159F X-CRM114-Status: GOOD ( 12.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. 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 a599fc5d63c524474276f5db98b05c7c512f332a..61952a0c49861efcb5e7c0884fcb85c040daf9ce 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 dp_audio_get_eld(struct device *dev, return -ENODEV; } + mutex_lock(&dp_display->connector->eld_mutex); memcpy(buf, dp_display->connector->eld, min(sizeof(dp_display->connector->eld), len)); + mutex_unlock(&dp_display->connector->eld_mutex); return 0; }