Skip to contentSkip to conversation

drm/amdgpu: don't skip runtime pm get on A+A config

PATCH In review Christian König 3 participants 6 messages Dec 6, 2021 – Dec 9, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: don't skip runtime pm get on A+A config

The runtime PM get was incorrectly added after the check.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -3
index ae6ab93c868b..4896c876ffec 100644
@@ -61,9 +61,6 @@ static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf,
 	if (pci_p2pdma_distance_many(adev->pdev, &attach->dev, 1, true) < 0)
 		attach->peer2peer = false;
 
-	if (attach->dev->driver == adev->dev->driver)
-		return 0;
-
 	r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
 	if (r < 0)
 		goto out;
Signature · 1 line
2.25.1
#1 lore raw

[AMD Official Use Only]

It seems more jobs(below) other than bumping the runpm counter are performed. Are they desired also?

	r = __dma_resv_make_exclusive(bo->tbo.base.resv);
	if (r)
		goto out;

	bo->prime_shared_count++;

BR
Evan

Quoted 34 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Monday, December 6, 2021 4:46 PM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: [PATCH] drm/amdgpu: don't skip runtime pm get on A+A config

The runtime PM get was incorrectly added after the check.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -3
index ae6ab93c868b..4896c876ffec 100644
@@ -61,9 +61,6 @@ static int amdgpu_dma_buf_attach(struct dma_buf
 *dmabuf,
 	if (pci_p2pdma_distance_many(adev->pdev, &attach->dev, 1, true)
 < 0)
 		attach->peer2peer = false;
 
-	if (attach->dev->driver == adev->dev->driver)
-		return 0;
-
 	r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -1
 	if (r < 0)
 		goto out;
--

2.25.1

#2 lore raw

You are looking at outdated code, that stuff is gone by now. amd-staging-drm-next probably needs a rebase.

And this code was what the check was initially good for. Just skipping the PM stuff as well on A+A was unintentionally.

Regards,
Christian.

Am 07.12.21 um 02:58 schrieb Quan, Evan:

Quoted 47 lines

[AMD Official Use Only]

It seems more jobs(below) other than bumping the runpm counter are performed. Are they desired also?

	r = __dma_resv_make_exclusive(bo->tbo.base.resv);
	if (r)
		goto out;

	bo->prime_shared_count++;

BR
Evan

Quoted 34 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Monday, December 6, 2021 4:46 PM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: [PATCH] drm/amdgpu: don't skip runtime pm get on A+A config

The runtime PM get was incorrectly added after the check.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -3
index ae6ab93c868b..4896c876ffec 100644
@@ -61,9 +61,6 @@ static int amdgpu_dma_buf_attach(struct dma_buf
 *dmabuf,
  	if (pci_p2pdma_distance_many(adev->pdev, &attach->dev, 1, true)
 < 0)
  		attach->peer2peer = false;
 
-	if (attach->dev->driver == adev->dev->driver)
-		return 0;
-
  	r = pm_runtime_get_sync(adev_to_drm(adev)->dev);

if (r < 0)
goto out;
--
2.25.1

#3 lore raw

[AMD Official Use Only]

Quoted 10 lines

-----Original Message-----
From: Christian König <[email protected]>
Sent: Tuesday, December 7, 2021 3:03 PM
To: Quan, Evan <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: don't skip runtime pm get on A+A config

You are looking at outdated code, that stuff is gone by now. amd-staging-drm-next probably needs a rebase.

Yep, I can see it in the vanilla kernel.
The patch is acked-by: Evan Quan <[email protected]>

BR
Evan

Quoted 57 lines

And this code was what the check was initially good for. Just skipping the PM stuff as well on A+A was unintentionally.

Regards,
Christian.

Am 07.12.21 um 02:58 schrieb Quan, Evan:

Quoted 3 lines

[AMD Official Use Only]

It seems more jobs(below) other than bumping the runpm counter are

performed.

Quoted 25 lines

Are they desired also?

	r = __dma_resv_make_exclusive(bo->tbo.base.resv);
	if (r)
		goto out;

	bo->prime_shared_count++;

BR
Evan

Quoted 15 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Monday, December 6, 2021 4:46 PM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: [PATCH] drm/amdgpu: don't skip runtime pm get on A+A config

The runtime PM get was incorrectly added after the check.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 3 ---
  1 file changed, 3 deletions(-)
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c static int amdgpu_dma_buf_attach(struct dma_buf · line 62

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -0
index ae6ab93c868b..4896c876ffec 100644
@@ -61,9 +61,6 @@ static int amdgpu_dma_buf_attach(struct dma_buf
 *dmabuf,
  	if (pci_p2pdma_distance_many(adev->pdev, &attach->dev, 1, true)

<

Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -3
 0)
  		attach->peer2peer = false;
 
-	if (attach->dev->driver == adev->dev->driver)
-		return 0;
-
  	r = pm_runtime_get_sync(adev_to_drm(adev)->dev);

if (r < 0)
goto out;
--
2.25.1

#4 lore raw

Am 07.12.21 um 08:40 schrieb Quan, Evan:

Quoted 9 lines

[AMD Official Use Only]

Quoted 8 lines

-----Original Message-----
From: Christian König <[email protected]>
Sent: Tuesday, December 7, 2021 3:03 PM
To: Quan, Evan <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: don't skip runtime pm get on A+A config

Quoted 4 lines
Quoted 2 lines

You are looking at outdated code, that stuff is gone by now. amd-staging-drm-next probably needs a rebase.

Yep, I can see it in the vanilla kernel.
The patch is acked-by: Evan Quan <[email protected]>

Thanks.

Alex any objections that I push this to drm-misc-next? It was found while working on changes already upstream in that function and would conflict if we push it through amd-staging-drm-next.

Regards,
Christian.

Quoted 59 lines

BR
Evan

Quoted 56 lines

And this code was what the check was initially good for. Just skipping the PM stuff as well on A+A was unintentionally.

Regards,
Christian.

Am 07.12.21 um 02:58 schrieb Quan, Evan:

Quoted 3 lines

[AMD Official Use Only]

It seems more jobs(below) other than bumping the runpm counter are

performed.

Quoted 25 lines

Are they desired also?

	r = __dma_resv_make_exclusive(bo->tbo.base.resv);
	if (r)
		goto out;

	bo->prime_shared_count++;

BR
Evan

Quoted 15 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Monday, December 6, 2021 4:46 PM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: [PATCH] drm/amdgpu: don't skip runtime pm get on A+A config

The runtime PM get was incorrectly added after the check.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 3 ---
   1 file changed, 3 deletions(-)
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c static int amdgpu_dma_buf_attach(struct dma_buf · line 62

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -0
index ae6ab93c868b..4896c876ffec 100644
@@ -61,9 +61,6 @@ static int amdgpu_dma_buf_attach(struct dma_buf
 *dmabuf,
   	if (pci_p2pdma_distance_many(adev->pdev, &attach->dev, 1, true)

<

Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -3
 0)
   		attach->peer2peer = false;
 
-	if (attach->dev->driver == adev->dev->driver)
-		return 0;
-
   	r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
   	if (r < 0)
   		goto out;

--
2.25.1

maintainer Acked-by
#5 lore raw

[Public]

No objections from me.

________________________________
From: Christian König <[email protected]>
Sent: Thursday, December 9, 2021 10:34 AM
To: Quan, Evan <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: don't skip runtime pm get on A+A config

Am 07.12.21 um 08:40 schrieb Quan, Evan:

Quoted 9 lines

[AMD Official Use Only]

Quoted 8 lines

-----Original Message-----
From: Christian König <[email protected]>
Sent: Tuesday, December 7, 2021 3:03 PM
To: Quan, Evan <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: don't skip runtime pm get on A+A config

Quoted 4 lines
Quoted 2 lines

You are looking at outdated code, that stuff is gone by now. amd-staging-drm-next probably needs a rebase.

Yep, I can see it in the vanilla kernel.
The patch is acked-by: Evan Quan <[email protected]>

Thanks.

Alex any objections that I push this to drm-misc-next? It was found while working on changes already upstream in that function and would conflict if we push it through amd-staging-drm-next.

Regards,
Christian.

Quoted 59 lines

BR
Evan

Quoted 56 lines

And this code was what the check was initially good for. Just skipping the PM stuff as well on A+A was unintentionally.

Regards,
Christian.

Am 07.12.21 um 02:58 schrieb Quan, Evan:

Quoted 3 lines

[AMD Official Use Only]

It seems more jobs(below) other than bumping the runpm counter are

performed.

Quoted 25 lines

Are they desired also?

     r = __dma_resv_make_exclusive(bo->tbo.base.resv);
     if (r)
             goto out;

     bo->prime_shared_count++;

BR
Evan

Quoted 15 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Monday, December 6, 2021 4:46 PM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: [PATCH] drm/amdgpu: don't skip runtime pm get on A+A config

The runtime PM get was incorrectly added after the check.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 3 ---
   1 file changed, 3 deletions(-)
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c static int amdgpu_dma_buf_attach(struct dma_buf · line 62

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -0
index ae6ab93c868b..4896c876ffec 100644
@@ -61,9 +61,6 @@ static int amdgpu_dma_buf_attach(struct dma_buf
 *dmabuf,
    if (pci_p2pdma_distance_many(adev->pdev, &attach->dev, 1, true)

<

Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 -3
 0)
            attach->peer2peer = false;
 
-  if (attach->dev->driver == adev->dev->driver)
-          return 0;
-
    r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
    if (r < 0)
            goto out;

--
2.25.1