All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/etnaviv: Add missing pm_runtime_put
@ 2022-01-18 14:16 ` Yongzhi Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Yongzhi Liu @ 2022-01-18 14:16 UTC (permalink / raw)
  To: l.stach, linux+etnaviv, christian.gmeiner, airlied, daniel, etnaviv
  Cc: dri-devel, linux-kernel, Yongzhi Liu

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code, thus a matching decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 242a5fd..5e81a98 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1714,6 +1714,9 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
 	return 0;
 
 out_sched:
+#ifdef CONFIG_PM
+	pm_runtime_put_autosuspend(gpu->dev);
+#endif
 	etnaviv_sched_fini(gpu);
 
 out_workqueue:
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm/etnaviv: Add missing pm_runtime_put
@ 2022-01-18 14:16 ` Yongzhi Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Yongzhi Liu @ 2022-01-18 14:16 UTC (permalink / raw)
  To: l.stach, linux+etnaviv, christian.gmeiner, airlied, daniel, etnaviv
  Cc: Yongzhi Liu, linux-kernel, dri-devel

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code, thus a matching decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 242a5fd..5e81a98 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1714,6 +1714,9 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
 	return 0;
 
 out_sched:
+#ifdef CONFIG_PM
+	pm_runtime_put_autosuspend(gpu->dev);
+#endif
 	etnaviv_sched_fini(gpu);
 
 out_workqueue:
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/etnaviv: Add missing pm_runtime_put
  2022-01-18 14:16 ` Yongzhi Liu
@ 2022-01-19 10:51   ` Lucas Stach
  -1 siblings, 0 replies; 6+ messages in thread
From: Lucas Stach @ 2022-01-19 10:51 UTC (permalink / raw)
  To: Yongzhi Liu, linux+etnaviv, christian.gmeiner, airlied, daniel, etnaviv
  Cc: dri-devel, linux-kernel

Am Dienstag, dem 18.01.2022 um 06:16 -0800 schrieb Yongzhi Liu:
> pm_runtime_get_sync() increments the runtime PM usage counter even
> when it returns an error code, thus a matching decrement is needed
> on the error handling path to keep the counter balanced.
> 
Instead of adding more error handling code here, I would prefer to
convert this to pm_runtime_resume_and_get to avoid this issue.

Regards,
Lucas

> Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index 242a5fd..5e81a98 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -1714,6 +1714,9 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
>  	return 0;
>  
>  out_sched:
> +#ifdef CONFIG_PM
> +	pm_runtime_put_autosuspend(gpu->dev);
> +#endif
>  	etnaviv_sched_fini(gpu);
>  
>  out_workqueue:



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/etnaviv: Add missing pm_runtime_put
@ 2022-01-19 10:51   ` Lucas Stach
  0 siblings, 0 replies; 6+ messages in thread
From: Lucas Stach @ 2022-01-19 10:51 UTC (permalink / raw)
  To: Yongzhi Liu, linux+etnaviv, christian.gmeiner, airlied, daniel, etnaviv
  Cc: linux-kernel, dri-devel

Am Dienstag, dem 18.01.2022 um 06:16 -0800 schrieb Yongzhi Liu:
> pm_runtime_get_sync() increments the runtime PM usage counter even
> when it returns an error code, thus a matching decrement is needed
> on the error handling path to keep the counter balanced.
> 
Instead of adding more error handling code here, I would prefer to
convert this to pm_runtime_resume_and_get to avoid this issue.

Regards,
Lucas

> Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index 242a5fd..5e81a98 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -1714,6 +1714,9 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
>  	return 0;
>  
>  out_sched:
> +#ifdef CONFIG_PM
> +	pm_runtime_put_autosuspend(gpu->dev);
> +#endif
>  	etnaviv_sched_fini(gpu);
>  
>  out_workqueue:



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] drm/etnaviv: Add missing pm_runtime_put
  2022-01-19 10:51   ` Lucas Stach
@ 2022-01-19 11:36     ` 刘永志
  -1 siblings, 0 replies; 6+ messages in thread
From: 刘永志 @ 2022-01-19 11:36 UTC (permalink / raw)
  To: lucas stach
  Cc: linux+etnaviv, christian.gmeiner, airlied, daniel, etnaviv,
	dri-devel, linux-kernel

> -----原始邮件-----
> 发件人: "Lucas Stach" <l.stach@pengutronix.de>
> 发送时间: 2022-01-19 18:51:20 (星期三)
> 收件人: "Yongzhi Liu" <lyz_cs@pku.edu.cn>, linux+etnaviv@armlinux.org.uk, christian.gmeiner@gmail.com, airlied@linux.ie, daniel@ffwll.ch, etnaviv@lists.freedesktop.org
> 抄送: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
> 主题: Re: [PATCH] drm/etnaviv: Add missing pm_runtime_put
> 
> Am Dienstag, dem 18.01.2022 um 06:16 -0800 schrieb Yongzhi Liu:
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > when it returns an error code, thus a matching decrement is needed
> > on the error handling path to keep the counter balanced.
> > 
> Instead of adding more error handling code here, I would prefer to
> convert this to pm_runtime_resume_and_get to avoid this issue.
> 
> Regards,
> Lucas
> 

I will resend my modified patch. Thanks for your reply.

> > Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
> > ---
> >  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > index 242a5fd..5e81a98 100644
> > --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > @@ -1714,6 +1714,9 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
> >  	return 0;
> >  
> >  out_sched:
> > +#ifdef CONFIG_PM
> > +	pm_runtime_put_autosuspend(gpu->dev);
> > +#endif
> >  	etnaviv_sched_fini(gpu);
> >  
> >  out_workqueue:
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] drm/etnaviv: Add missing pm_runtime_put
@ 2022-01-19 11:36     ` 刘永志
  0 siblings, 0 replies; 6+ messages in thread
From: 刘永志 @ 2022-01-19 11:36 UTC (permalink / raw)
  To: lucas stach; +Cc: airlied, etnaviv, dri-devel, linux-kernel, linux+etnaviv

> -----原始邮件-----
> 发件人: "Lucas Stach" <l.stach@pengutronix.de>
> 发送时间: 2022-01-19 18:51:20 (星期三)
> 收件人: "Yongzhi Liu" <lyz_cs@pku.edu.cn>, linux+etnaviv@armlinux.org.uk, christian.gmeiner@gmail.com, airlied@linux.ie, daniel@ffwll.ch, etnaviv@lists.freedesktop.org
> 抄送: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
> 主题: Re: [PATCH] drm/etnaviv: Add missing pm_runtime_put
> 
> Am Dienstag, dem 18.01.2022 um 06:16 -0800 schrieb Yongzhi Liu:
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > when it returns an error code, thus a matching decrement is needed
> > on the error handling path to keep the counter balanced.
> > 
> Instead of adding more error handling code here, I would prefer to
> convert this to pm_runtime_resume_and_get to avoid this issue.
> 
> Regards,
> Lucas
> 

I will resend my modified patch. Thanks for your reply.

> > Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
> > ---
> >  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > index 242a5fd..5e81a98 100644
> > --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > @@ -1714,6 +1714,9 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
> >  	return 0;
> >  
> >  out_sched:
> > +#ifdef CONFIG_PM
> > +	pm_runtime_put_autosuspend(gpu->dev);
> > +#endif
> >  	etnaviv_sched_fini(gpu);
> >  
> >  out_workqueue:
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-19 11:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 14:16 [PATCH] drm/etnaviv: Add missing pm_runtime_put Yongzhi Liu
2022-01-18 14:16 ` Yongzhi Liu
2022-01-19 10:51 ` Lucas Stach
2022-01-19 10:51   ` Lucas Stach
2022-01-19 11:36   ` 刘永志
2022-01-19 11:36     ` 刘永志

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.