[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ab17bfc-8949-0be6-d4a4-1f17d812ef57@collabora.com>
Date: Tue, 30 Nov 2021 11:26:02 +0100
From: Andrzej Pietrasiewicz <andrzej.p@...labora.com>
To: Jernej Skrabec <jernej.skrabec@...il.com>,
linux-media@...r.kernel.org
Cc: ezequiel@...guardiasur.com.ar, nicolas.dufresne@...labora.com,
mchehab@...nel.org, robh+dt@...nel.org, mripard@...nel.org,
wens@...e.org, p.zabel@...gutronix.de, gregkh@...uxfoundation.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-sunxi@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-staging@...ts.linux.dev
Subject: Re: [PATCH v2 1/9] media: hantro: Fix probe func error path
Hi Jernej,
W dniu 29.11.2021 o 19:26, Jernej Skrabec pisze:
> If clocks for some reason couldn't be enabled, probe function returns
> immediately, without disabling PM. This obviously leaves PM ref counters
> unbalanced.
>
> Fix that by jumping to appropriate error path, so effects of PM functions
> are reversed.
>
> Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver")
> Signed-off-by: Jernej Skrabec <jernej.skrabec@...il.com>
Acked-by: Andrzej Pietrasiewicz <andrzej.p@...labora.com>
> ---
> drivers/staging/media/hantro/hantro_drv.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
> index ab2467998d29..3d3107a39dae 100644
> --- a/drivers/staging/media/hantro/hantro_drv.c
> +++ b/drivers/staging/media/hantro/hantro_drv.c
> @@ -981,7 +981,7 @@ static int hantro_probe(struct platform_device *pdev)
> ret = clk_bulk_prepare(vpu->variant->num_clocks, vpu->clocks);
> if (ret) {
> dev_err(&pdev->dev, "Failed to prepare clocks\n");
> - return ret;
> + goto err_pm_disable;
> }
>
> ret = v4l2_device_register(&pdev->dev, &vpu->v4l2_dev);
> @@ -1037,6 +1037,7 @@ static int hantro_probe(struct platform_device *pdev)
> v4l2_device_unregister(&vpu->v4l2_dev);
> err_clk_unprepare:
> clk_bulk_unprepare(vpu->variant->num_clocks, vpu->clocks);
> +err_pm_disable:
> pm_runtime_dont_use_autosuspend(vpu->dev);
> pm_runtime_disable(vpu->dev);
> return ret;
>
Powered by blists - more mailing lists