2019-10-23 13:18:26

by Tomeu Vizoso

[permalink] [raw]
Subject: [PATCH v2] panfrost: Properly undo pm_runtime_enable when deferring a probe

When deferring the probe because of a missing regulator, we were calling
pm_runtime_disable even if pm_runtime_enable wasn't called.

Move the call to pm_runtime_disable to the right place.

Signed-off-by: Tomeu Vizoso <[email protected]>
Reported-by: Chen-Yu Tsai <[email protected]>
Cc: Robin Murphy <[email protected]>
Fixes: f4a3c6a44b35 ("drm/panfrost: Disable PM on probe failure")
---
drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index bc2ddeb55f5d..f21bc8a7ee3a 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -556,11 +556,11 @@ static int panfrost_probe(struct platform_device *pdev)
return 0;

err_out2:
+ pm_runtime_disable(pfdev->dev);
panfrost_devfreq_fini(pfdev);
err_out1:
panfrost_device_fini(pfdev);
err_out0:
- pm_runtime_disable(pfdev->dev);
drm_dev_put(ddev);
return err;
}
--
2.20.1


2019-10-23 17:41:51

by Robin Murphy

[permalink] [raw]
Subject: Re: [PATCH v2] panfrost: Properly undo pm_runtime_enable when deferring a probe

On 2019-10-23 1:21 pm, Tomeu Vizoso wrote:
> When deferring the probe because of a missing regulator, we were calling
> pm_runtime_disable even if pm_runtime_enable wasn't called.
>
> Move the call to pm_runtime_disable to the right place.
>
> Signed-off-by: Tomeu Vizoso <[email protected]>
> Reported-by: Chen-Yu Tsai <[email protected]>
> Cc: Robin Murphy <[email protected]>
> Fixes: f4a3c6a44b35 ("drm/panfrost: Disable PM on probe failure")

I think that commit was right at the time, but actually we missed
reordering the cleanup path to match the change in 635430797d3f.
Otherwise, though,

Reviewed-by: Robin Murphy <[email protected]>

> ---
> drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index bc2ddeb55f5d..f21bc8a7ee3a 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -556,11 +556,11 @@ static int panfrost_probe(struct platform_device *pdev)
> return 0;
>
> err_out2:
> + pm_runtime_disable(pfdev->dev);
> panfrost_devfreq_fini(pfdev);
> err_out1:
> panfrost_device_fini(pfdev);
> err_out0:
> - pm_runtime_disable(pfdev->dev);
> drm_dev_put(ddev);
> return err;
> }
>

2019-10-24 06:19:48

by Steven Price

[permalink] [raw]
Subject: Re: [PATCH v2] panfrost: Properly undo pm_runtime_enable when deferring a probe

On 23/10/2019 13:21, Tomeu Vizoso wrote:
> When deferring the probe because of a missing regulator, we were calling
> pm_runtime_disable even if pm_runtime_enable wasn't called.
>
> Move the call to pm_runtime_disable to the right place.
>
> Signed-off-by: Tomeu Vizoso <[email protected]>
> Reported-by: Chen-Yu Tsai <[email protected]>
> Cc: Robin Murphy <[email protected]>
> Fixes: f4a3c6a44b35 ("drm/panfrost: Disable PM on probe failure")

As Robin pointed out this should be:

Fixes: 635430797d3f ("drm/panfrost: Rework runtime PM initialization")

But other than that,

Reviewed-by: Steven Price <[email protected]>

> ---
> drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index bc2ddeb55f5d..f21bc8a7ee3a 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -556,11 +556,11 @@ static int panfrost_probe(struct platform_device *pdev)
> return 0;
>
> err_out2:
> + pm_runtime_disable(pfdev->dev);
> panfrost_devfreq_fini(pfdev);
> err_out1:
> panfrost_device_fini(pfdev);
> err_out0:
> - pm_runtime_disable(pfdev->dev);
> drm_dev_put(ddev);
> return err;
> }
>

2019-10-24 11:52:49

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2] panfrost: Properly undo pm_runtime_enable when deferring a probe

On Wed, Oct 23, 2019 at 10:49 AM Steven Price <[email protected]> wrote:
>
> On 23/10/2019 13:21, Tomeu Vizoso wrote:
> > When deferring the probe because of a missing regulator, we were calling
> > pm_runtime_disable even if pm_runtime_enable wasn't called.
> >
> > Move the call to pm_runtime_disable to the right place.
> >
> > Signed-off-by: Tomeu Vizoso <[email protected]>
> > Reported-by: Chen-Yu Tsai <[email protected]>
> > Cc: Robin Murphy <[email protected]>
> > Fixes: f4a3c6a44b35 ("drm/panfrost: Disable PM on probe failure")
>
> As Robin pointed out this should be:
>
> Fixes: 635430797d3f ("drm/panfrost: Rework runtime PM initialization")
>
> But other than that,
>
> Reviewed-by: Steven Price <[email protected]>

Applied with Fixes fixed. Looks like we just missed this weeks fixes...

Rob

2019-10-24 19:54:39

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v2] panfrost: Properly undo pm_runtime_enable when deferring a probe

On Wed, Oct 23, 2019 at 8:22 PM Tomeu Vizoso <[email protected]> wrote:
>
> When deferring the probe because of a missing regulator, we were calling
> pm_runtime_disable even if pm_runtime_enable wasn't called.
>
> Move the call to pm_runtime_disable to the right place.
>
> Signed-off-by: Tomeu Vizoso <[email protected]>
> Reported-by: Chen-Yu Tsai <[email protected]>
> Cc: Robin Murphy <[email protected]>
> Fixes: f4a3c6a44b35 ("drm/panfrost: Disable PM on probe failure")

Tested-by: Chen-Yu Tsai <[email protected]>