[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241112052754.GB21062@pendragon.ideasonboard.com>
Date: Tue, 12 Nov 2024 07:27:54 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Sean Anderson <sean.anderson@...ux.dev>,
Tomi Valkeinen <tomi.valkeinen@...asonboard.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Michal Simek <michal.simek@....com>,
dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH next] drm: zynqmp_dp: Unlock on error in
zynqmp_dp_bridge_atomic_enable()
Hi Dan,
Thank you for the patch.
On Mon, Nov 11, 2024 at 12:06:10PM +0300, Dan Carpenter wrote:
> 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 <dan.carpenter@...aro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Sean, how about replacing all the mutex_lock()/mutex_unlock() calls
you've added in a7d5eeaa57d7 with guards ?
> ---
> 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,
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists