[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <jlednbhsqwqc7pbnifqm64xn4cyk45roxvdjrun3a5pwq5dsfo@jez2c445jl4c>
Date: Sun, 26 Jan 2025 23:46:32 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Vitalii Mordan <mordan@...ras.ru>
Cc: Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>, Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.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>,
Jani Nikula <jani.nikula@...el.com>, Sui Jingfeng <sui.jingfeng@...ux.dev>,
Aleksandr Mishin <amishin@...rgos.ru>, Tomi Valkeinen <tomi.valkeinen@...com>,
Quentin Schulz <quentin.schulz@...e-electrons.com>, Yuti Amonkar <yamonkar@...ence.com>, Jyri Sarha <jsarha@...com>,
Swapnil Jakhade <sjakhade@...ence.com>, dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Fedor Pchelkin <pchelkin@...ras.ru>, Alexey Khoroshilov <khoroshilov@...ras.ru>,
Vadim Mutilin <mutilin@...ras.ru>, lvc-project@...uxtesting.org
Subject: Re: [PATCH] gpu: cdns-mhdp8546: fix call balance of mhdp->clk
handling routines
On Fri, Jan 24, 2025 at 08:00:09PM +0300, Vitalii Mordan wrote:
> If the clock mhdp->clk was not enabled in cdns_mhdp_probe(), it should not
> be disabled in any path.
>
> Found by Linux Verification Center (linuxtesting.org) with Klever.
>
> Fixes: fb43aa0acdfd ("drm: bridge: Add support for Cadence MHDP8546 DPI/DP bridge")
> Signed-off-by: Vitalii Mordan <mordan@...ras.ru>
> ---
> drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> index d081850e3c03..3e923bcfb0bf 100644
> --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> @@ -2504,7 +2504,11 @@ static int cdns_mhdp_probe(struct platform_device *pdev)
>
> mhdp->info = of_device_get_match_data(dev);
>
> - clk_prepare_enable(clk);
> + ret = clk_prepare_enable(clk);
> + if (ret) {
> + dev_err(dev, "Failed to enable clk\n");
> + return ret;
> + }
I think this should be switch to devm_clk_get_enabled, removing the
extra clk_prepare_enable(), error handling, etc.
>
> pm_runtime_enable(dev);
> ret = pm_runtime_resume_and_get(dev);
> --
> 2.25.1
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists