All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Add missing pm_runtime_put_autosuspend
@ 2022-01-18 12:01 ` Yongzhi Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Yongzhi Liu @ 2022-01-18 12:01 UTC (permalink / raw)
  To: airlied, daniel, nirmoy.das, lijo.lazar, Jingwen.Chen2,
	evan.quan, Jack.Zhang1, kevin1.wang, tom.stdenis
  Cc: amd-gfx, 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/amd/amdgpu/amdgpu_debugfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 9aea1cc..4b950de 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1120,8 +1120,10 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
 		return -EINVAL;
 
 	r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
-	if (r < 0)
+	if (r < 0) {
+		pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 		return r;
+	}
 
 	while (size) {
 		uint32_t value;
-- 
2.7.4


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

* [PATCH] drm/amdgpu: Add missing pm_runtime_put_autosuspend
@ 2022-01-18 12:01 ` Yongzhi Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Yongzhi Liu @ 2022-01-18 12:01 UTC (permalink / raw)
  To: airlied, daniel, nirmoy.das, lijo.lazar, Jingwen.Chen2,
	evan.quan, Jack.Zhang1, kevin1.wang, tom.stdenis
  Cc: Yongzhi Liu, dri-devel, amd-gfx, linux-kernel

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/amd/amdgpu/amdgpu_debugfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 9aea1cc..4b950de 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1120,8 +1120,10 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
 		return -EINVAL;
 
 	r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
-	if (r < 0)
+	if (r < 0) {
+		pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 		return r;
+	}
 
 	while (size) {
 		uint32_t value;
-- 
2.7.4


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

* Re: [PATCH] drm/amdgpu: Add missing pm_runtime_put_autosuspend
  2022-01-18 12:01 ` Yongzhi Liu
@ 2022-01-18 14:03   ` Lazar, Lijo
  -1 siblings, 0 replies; 7+ messages in thread
From: Lazar, Lijo @ 2022-01-18 14:03 UTC (permalink / raw)
  To: Yongzhi Liu, airlied, daniel, nirmoy.das, Jingwen.Chen2,
	evan.quan, Jack.Zhang1, kevin1.wang, tom.stdenis
  Cc: amd-gfx, dri-devel, linux-kernel



On 1/18/2022 5:31 PM, Yongzhi Liu wrote:
> 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>

Thanks!

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> index 9aea1cc..4b950de 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> @@ -1120,8 +1120,10 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
>   		return -EINVAL;
>   
>   	r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
> -	if (r < 0)
> +	if (r < 0) {
> +		pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
>   		return r;
> +	}
>   
>   	while (size) {
>   		uint32_t value;
> 

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

* Re: [PATCH] drm/amdgpu: Add missing pm_runtime_put_autosuspend
@ 2022-01-18 14:03   ` Lazar, Lijo
  0 siblings, 0 replies; 7+ messages in thread
From: Lazar, Lijo @ 2022-01-18 14:03 UTC (permalink / raw)
  To: Yongzhi Liu, airlied, daniel, nirmoy.das, Jingwen.Chen2,
	evan.quan, Jack.Zhang1, kevin1.wang, tom.stdenis
  Cc: dri-devel, amd-gfx, linux-kernel



On 1/18/2022 5:31 PM, Yongzhi Liu wrote:
> 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>

Thanks!

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> index 9aea1cc..4b950de 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> @@ -1120,8 +1120,10 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
>   		return -EINVAL;
>   
>   	r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
> -	if (r < 0)
> +	if (r < 0) {
> +		pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
>   		return r;
> +	}
>   
>   	while (size) {
>   		uint32_t value;
> 

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

* Re: [PATCH] drm/amdgpu: Add missing pm_runtime_put_autosuspend
  2022-01-18 14:03   ` Lazar, Lijo
  (?)
@ 2022-01-18 20:13     ` Alex Deucher
  -1 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2022-01-18 20:13 UTC (permalink / raw)
  To: Lazar, Lijo
  Cc: Yongzhi Liu, Dave Airlie, Daniel Vetter, Nirmoy Das,
	Jingwen Chen, Quan, Evan, Jack Zhang, Kevin Wang, Tom St Denis,
	Maling list - DRI developers, amd-gfx list, LKML

Applied.  Strangely I can't seem to find this patch in my inbox or in
the dri-devel or amd-gfx archives.

Alex

On Tue, Jan 18, 2022 at 9:03 AM Lazar, Lijo <lijo.lazar@amd.com> wrote:
>
>
>
> On 1/18/2022 5:31 PM, Yongzhi Liu wrote:
> > 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>
>
> Thanks!
>
> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> > index 9aea1cc..4b950de 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> > @@ -1120,8 +1120,10 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
> >               return -EINVAL;
> >
> >       r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
> > -     if (r < 0)
> > +     if (r < 0) {
> > +             pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
> >               return r;
> > +     }
> >
> >       while (size) {
> >               uint32_t value;
> >

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

* Re: [PATCH] drm/amdgpu: Add missing pm_runtime_put_autosuspend
@ 2022-01-18 20:13     ` Alex Deucher
  0 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2022-01-18 20:13 UTC (permalink / raw)
  To: Lazar, Lijo
  Cc: Tom St Denis, Jack Zhang, Yongzhi Liu, Jingwen Chen, Kevin Wang,
	LKML, Maling list - DRI developers, Dave Airlie, Nirmoy Das,
	amd-gfx list, Quan, Evan

Applied.  Strangely I can't seem to find this patch in my inbox or in
the dri-devel or amd-gfx archives.

Alex

On Tue, Jan 18, 2022 at 9:03 AM Lazar, Lijo <lijo.lazar@amd.com> wrote:
>
>
>
> On 1/18/2022 5:31 PM, Yongzhi Liu wrote:
> > 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>
>
> Thanks!
>
> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> > index 9aea1cc..4b950de 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> > @@ -1120,8 +1120,10 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
> >               return -EINVAL;
> >
> >       r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
> > -     if (r < 0)
> > +     if (r < 0) {
> > +             pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
> >               return r;
> > +     }
> >
> >       while (size) {
> >               uint32_t value;
> >

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

* Re: [PATCH] drm/amdgpu: Add missing pm_runtime_put_autosuspend
@ 2022-01-18 20:13     ` Alex Deucher
  0 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2022-01-18 20:13 UTC (permalink / raw)
  To: Lazar, Lijo
  Cc: Tom St Denis, Jack Zhang, Yongzhi Liu, Jingwen Chen, Kevin Wang,
	LKML, Maling list - DRI developers, Dave Airlie, Nirmoy Das,
	amd-gfx list, Daniel Vetter, Quan, Evan

Applied.  Strangely I can't seem to find this patch in my inbox or in
the dri-devel or amd-gfx archives.

Alex

On Tue, Jan 18, 2022 at 9:03 AM Lazar, Lijo <lijo.lazar@amd.com> wrote:
>
>
>
> On 1/18/2022 5:31 PM, Yongzhi Liu wrote:
> > 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>
>
> Thanks!
>
> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> > index 9aea1cc..4b950de 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> > @@ -1120,8 +1120,10 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
> >               return -EINVAL;
> >
> >       r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
> > -     if (r < 0)
> > +     if (r < 0) {
> > +             pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
> >               return r;
> > +     }
> >
> >       while (size) {
> >               uint32_t value;
> >

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

end of thread, other threads:[~2022-01-18 23:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 12:01 [PATCH] drm/amdgpu: Add missing pm_runtime_put_autosuspend Yongzhi Liu
2022-01-18 12:01 ` Yongzhi Liu
2022-01-18 14:03 ` Lazar, Lijo
2022-01-18 14:03   ` Lazar, Lijo
2022-01-18 20:13   ` Alex Deucher
2022-01-18 20:13     ` Alex Deucher
2022-01-18 20:13     ` Alex Deucher

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.