From patchwork Mon Nov 11 09:06:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13870426 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 8F95CD2E9C4 for ; Mon, 11 Nov 2024 09:06:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7A9F10E43B; Mon, 11 Nov 2024 09:06:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="LERJ32NG"; dkim-atps=neutral Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C25A10E43B for ; Mon, 11 Nov 2024 09:06:16 +0000 (UTC) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a9a850270e2so799716466b.0 for ; Mon, 11 Nov 2024 01:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731315974; x=1731920774; darn=lists.freedesktop.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=apRs0DAdhKBkD9Qp2XtvGYAHxYv4VCBNiG5LEbw4AZU=; b=LERJ32NG2dbYAzoShAIZBcFBEquTt8/aCiTQsa5fKETrH2b6HlgnMKE5WwZABuZ9me qHbJvSEwiWbVW6XD/Qo/gbo4sfNPREKrRBj6rqz1x/jMquXo+af1LM2X+G6PPeoI7VGK aUXHsmROH06FsZMOT+gjn3mA42QYzOQ+r8jbTderR757ZIYETRpegqeH9b3NtT3JXHpH 6mwwrp7gb3ZkI8dJJB8bTO1D9Gei0a5Ohn8FqVlswJpDUuR6nsQqDjVCjzCDdePQbcbM u2FVHVpYKiLTi1y/oa1hp1uqQHa5SKhI5Rn+wyBtDhWewU1OlrpblaJCMeoyurxMXOFE /fyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731315974; x=1731920774; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=apRs0DAdhKBkD9Qp2XtvGYAHxYv4VCBNiG5LEbw4AZU=; b=ZTSawRN1ZUCOq8ifa2G+1rDyJ5TtNx9+VUtZcIDOxqV/7SXzAm+AXficZc0TMeAyyv WqowEEXYEMNMPRKVCXbNFUo0DbMm3KLVLV8IQNBund3OHQ34NXqJ4pSIoN5pYcmRsALH UO2XgkO/4GmejN+IXGa6pxt5L+Gj9ocyWlqZWZpq2pvAngC2QUaYYiG9oeFxktclGz2c T1C/UbYbIfCaqOJ7YwBIqrnFD4uXKVHiSdgZoWW+P35sDMy06Ex5xsrljD73mECv0xLJ EGUenGaTrlL+Pjw51Wz0iapvZKmIkNfmyAV/ZfKI5uNZQWdsmySKiOQLL5t4217qjyxM 3bLg== X-Forwarded-Encrypted: i=1; AJvYcCWhmiOQY0t1Va/FvFDtY/Q0TxSml9cZrhEiKSFpSFs9OA0PH6NNfqkDM9AdVqnnc3V80hAf/k9SHBk=@lists.freedesktop.org X-Gm-Message-State: AOJu0YwJIGisi1TiXjAgu4J4cj9qGUUAbUdmGH1I+XDou6pPP+zAlC8y b7mPTpv9a24U5+l/R5NQNASkQIWgv80fpA51xP3ntokUVVWw3zRyxDjPyx9QfhE= X-Google-Smtp-Source: AGHT+IG01DvV4fVYHey4p2gLJdP8gIwgetBzZShx8jJbLbuJv9DbED9jmrm294gcWaav324B9xGGuw== X-Received: by 2002:a17:907:c15:b0:a99:8a0e:8710 with SMTP id a640c23a62f3a-a9eefee6682mr1056624666b.14.1731315974411; Mon, 11 Nov 2024 01:06:14 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0a4b82csm579023566b.67.2024.11.11.01.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 01:06:14 -0800 (PST) Date: Mon, 11 Nov 2024 12:06:10 +0300 From: Dan Carpenter To: Sean Anderson Cc: Laurent Pinchart , Tomi Valkeinen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Michal Simek , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH next] drm: zynqmp_dp: Unlock on error in zynqmp_dp_bridge_atomic_enable() Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding 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" We added some locking to this function, but accidentally forgot to unlock if zynqmp_dp_mode_configure() failed. Use a guard lock to fix it. Fixes: a7d5eeaa57d7 ("drm: zynqmp_dp: Add locking") Signed-off-by: Dan Carpenter Reviewed-by: Sean Anderson Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index 25c5dc61ee88..0bea908b281e 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1537,7 +1537,7 @@ static void zynqmp_dp_bridge_atomic_enable(struct drm_bridge *bridge, pm_runtime_get_sync(dp->dev); - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); zynqmp_dp_disp_enable(dp, old_bridge_state); /* @@ -1598,7 +1598,6 @@ static void zynqmp_dp_bridge_atomic_enable(struct drm_bridge *bridge, zynqmp_dp_write(dp, ZYNQMP_DP_SOFTWARE_RESET, ZYNQMP_DP_SOFTWARE_RESET_ALL); zynqmp_dp_write(dp, ZYNQMP_DP_MAIN_STREAM_ENABLE, 1); - mutex_unlock(&dp->lock); } static void zynqmp_dp_bridge_atomic_disable(struct drm_bridge *bridge,