Skip to contentSkip to conversation

drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

PATCH In review Yuan, Xiaojie 6 participants 8 messages Sep 26, 2019 6 messages not in the archive

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

PATCH 1/1 drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Fixes 767acabdac81 ("drm/amd/powerplay: add baco smu reset function for smu11")
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1 -0
index cb3f61873baa..dc2e68e019eb 100644
@@ -292,6 +292,7 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 
 	if (!adev->mman.buffer_funcs_enabled ||
 	    !adev->ib_pool_ready ||
+	    !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) ||
 	    adev->in_gpu_reset) {
 		gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB_0, 0);
 		mutex_unlock(&adev->mman.gtt_window_lock);
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi Alex,

This patch is to add the asic_type check which is missing after drm-next branch rebase.

BR,
Xiaojie
________________________________
From: Yuan, Xiaojie <[email protected]>
Sent: Thursday, September 26, 2019 4:08 PM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Fixes 767acabdac81 ("drm/amd/powerplay: add baco smu reset function for smu11")
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1 -0
index cb3f61873baa..dc2e68e019eb 100644
@@ -292,6 +292,7 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 
         if (!adev->mman.buffer_funcs_enabled ||
             !adev->ib_pool_ready ||
+           !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) ||
             adev->in_gpu_reset) {
                 gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB_0, 0);
                 mutex_unlock(&adev->mman.gtt_window_lock);

--
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN8PR12MB36027CA5662543E7F956657589860-h6+T2+wrnx1lGJ5xs4l7kQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw

This patch was already reviewed-by. I think you can land it on the branch directly.

From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> On Behalf Of Yuan, Xiaojie
Sent: Thursday, September 26, 2019 4:09 PM
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Hi Alex,

This patch is to add the asic_type check which is missing after drm-next branch rebase.

BR,
Xiaojie
________________________________
From: Yuan, Xiaojie <[email protected]<mailto:[email protected]>>
Sent: Thursday, September 26, 2019 4:08 PM
To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; Yuan, Xiaojie <[email protected]<mailto:[email protected]>>
Subject: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Fixes 767acabdac81 ("drm/amd/powerplay: add baco smu reset function for smu11")
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1 -0
index cb3f61873baa..dc2e68e019eb 100644
@@ -292,6 +292,7 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 
         if (!adev->mman.buffer_funcs_enabled ||
             !adev->ib_pool_ready ||
+           !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) ||
             adev->in_gpu_reset) {
                 gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB_0, 0);
                 mutex_unlock(&adev->mman.gtt_window_lock);

--
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by
#5 lore raw
In reply to a message not in the archive

Please add a patch description. With that fixed:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Yuan, Xiaojie <[email protected]>
Sent: Thursday, September 26, 2019 4:09 AM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Hi Alex,

This patch is to add the asic_type check which is missing after drm-next branch rebase.

BR,
Xiaojie
________________________________
From: Yuan, Xiaojie <[email protected]>
Sent: Thursday, September 26, 2019 4:08 PM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Fixes 767acabdac81 ("drm/amd/powerplay: add baco smu reset function for smu11")
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1 -0
index cb3f61873baa..dc2e68e019eb 100644
@@ -292,6 +292,7 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 
         if (!adev->mman.buffer_funcs_enabled ||
             !adev->ib_pool_ready ||
+           !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) ||
             adev->in_gpu_reset) {
                 gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB_0, 0);
                 mutex_unlock(&adev->mman.gtt_window_lock);

--
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1809591CB4102B70BEC82E93F7860-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#7 lore raw

Stop, wait a second guys!

This will disable the workaround for Navi10 and that is certainly not correct:

Quoted 1 line

!(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12)

Christian.

Am 26.09.19 um 14:26 schrieb Deucher, Alexander:

Quoted 33 lines

Please add a patch description.  With that fixed:

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Yuan, Xiaojie <[email protected]> *Sent:* Thursday, September 26, 2019 4:09 AM
*To:* [email protected] <[email protected]>
*Cc:* [email protected] <[email protected]>
*Subject:* Re: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi
Hi Alex,

This patch is to add the asic_type check which is missing after drm-next branch rebase.

BR,
Xiaojie
------------------------------------------------------------------------
*From:* Yuan, Xiaojie <[email protected]>
*Sent:* Thursday, September 26, 2019 4:08 PM
*To:* [email protected] <[email protected]>
*Cc:* [email protected] <[email protected]>; Yuan, Xiaojie <[email protected]> *Subject:* [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Fixes 767acabdac81 ("drm/amd/powerplay: add baco smu reset function for smu11")

---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 +

 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0 -0
index cb3f61873baa..dc2e68e019eb 100644
@@ -292,6 +292,7 @@ static void gmc_v10_0_flush_gpu_tlb(struct 
 amdgpu_device *adev, uint32_t vmid,
 
Quoted 15 lines

         if (!adev->mman.buffer_funcs_enabled || !adev->ib_pool_ready ||
+           !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) ||
             adev->in_gpu_reset) { gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB_0, 0); mutex_unlock(&adev->mman.gtt_window_lock);

Signature · 7 lines
2.20.1


_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 608f4e8a-ef35-6fbc-cda6-51c3803af014-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#9 lore raw
Quoted 7 lines · Christian König

Stop, wait a second guys!

This will disable the workaround for Navi10 and that is certainly not correct:

!(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12)

Actually, I think it's correct. When I merged the baco patch, I accidentally dropped the navi checks. E.g.,
@@ -245,8 +245,9 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev,

        mutex_lock(&adev->mman.gtt_window_lock);

        gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_MMHUB, 0);

- if (!adev->mman.buffer_funcs_enabled || !adev->ib_pool_ready ||
- adev->asic_type != CHIP_NAVI10) {
+ if (!adev->mman.buffer_funcs_enabled ||
+ !adev->ib_pool_ready ||

+           adev->in_gpu_reset) {
                gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB, 0);
                mutex_unlock(&adev->mman.gtt_window_lock);
                return;

I think it should have been
adev->asic_type != CHIP_NAVI10 && adev->asic_type != CHIP_NAVI14 && adev->asic_type != CHIP_NAVI12

Alex

Quoted 50 lines

Christian.

Am 26.09.19 um 14:26 schrieb Deucher, Alexander:

Please add a patch description. With that fixed:

________________________________
From: amd-gfx <[email protected]> on behalf of Yuan, Xiaojie <[email protected]>
Sent: Thursday, September 26, 2019 4:09 AM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Hi Alex,

This patch is to add the asic_type check which is missing after drm-next branch rebase.

BR,
Xiaojie
________________________________
From: Yuan, Xiaojie <[email protected]>
Sent: Thursday, September 26, 2019 4:08 PM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Fixes 767acabdac81 ("drm/amd/powerplay: add baco smu reset function for smu11")
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1 -1
index cb3f61873baa..dc2e68e019eb 100644
@@ -292,6 +292,7 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 
         if (!adev->mman.buffer_funcs_enabled ||
             !adev->ib_pool_ready ||
+           !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) ||
             adev->in_gpu_reset) {
                 gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB_0, 0);
                 mutex_unlock(&adev->mman.gtt_window_lock);
--

2.20.1

Quoted 6 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_PdWnfB1knhdi_fre1gSeE5ibMXvCrzq-id36BbR63ZfQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#11 lore raw

Am 26.09.19 um 15:40 schrieb Alex Deucher:

Quoted 23 lines
Quoted 6 lines · Christian König

Stop, wait a second guys!

This will disable the workaround for Navi10 and that is certainly not correct:

!(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12)

Actually, I think it's correct. When I merged the baco patch, I accidentally dropped the navi checks. E.g.,

(quoted diff) +3 -2
@@ -245,8 +245,9 @@ static void gmc_v10_0_flush_gpu_tlb(struct
 amdgpu_device *adev,
         mutex_lock(&adev->mman.gtt_window_lock);
 
         gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_MMHUB, 0);
-       if (!adev->mman.buffer_funcs_enabled || !adev->ib_pool_ready ||
-           adev->asic_type != CHIP_NAVI10) {
+       if (!adev->mman.buffer_funcs_enabled ||
+           !adev->ib_pool_ready ||
+           adev->in_gpu_reset) {
                 gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB, 0);
                 mutex_unlock(&adev->mman.gtt_window_lock);
                 return;
Quoted 3 lines

I think it should have been
adev->asic_type != CHIP_NAVI10 && adev->asic_type != CHIP_NAVI14 && adev->asic_type != CHIP_NAVI12

My last status is that Navi12 is not supposed to need that workaround, that's why we checked Navi10 and later Navi14 separately.

It's possible that I miss-read the !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) check here, but either way that looks to complicated to me.

We should rather mention every affected asic type separately here.

Regards,
Christian.

Quoted 52 lines

Alex

Quoted 49 lines

Christian.

Am 26.09.19 um 14:26 schrieb Deucher, Alexander:

Please add a patch description. With that fixed:

________________________________
From: amd-gfx <[email protected]> on behalf of Yuan, Xiaojie <[email protected]>
Sent: Thursday, September 26, 2019 4:09 AM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Hi Alex,

This patch is to add the asic_type check which is missing after drm-next branch rebase.

BR,
Xiaojie
________________________________
From: Yuan, Xiaojie <[email protected]>
Sent: Thursday, September 26, 2019 4:08 PM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Fixes 767acabdac81 ("drm/amd/powerplay: add baco smu reset function for smu11")
---
  drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1 -1
index cb3f61873baa..dc2e68e019eb 100644
@@ -292,6 +292,7 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 
          if (!adev->mman.buffer_funcs_enabled ||
              !adev->ib_pool_ready ||
+           !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) ||
              adev->in_gpu_reset) {
                  gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB_0, 0);
                  mutex_unlock(&adev->mman.gtt_window_lock);
--

2.20.1

Quoted 6 lines
Quoted 6 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1d7c307f-29c5-9286-636e-b06fa44ef9ae-5C7GfCeVMHo@public.gmane.org

#13 lore raw
Quoted 32 lines · Christian

Am 26.09.19 um 15:40 schrieb Alex Deucher:

Quoted 23 lines
Quoted 6 lines · Christian König

Stop, wait a second guys!

This will disable the workaround for Navi10 and that is certainly not correct:

!(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12)

Actually, I think it's correct. When I merged the baco patch, I accidentally dropped the navi checks. E.g.,

(quoted diff) +3 -2
@@ -245,8 +245,9 @@ static void gmc_v10_0_flush_gpu_tlb(struct
 amdgpu_device *adev,
         mutex_lock(&adev->mman.gtt_window_lock);
 
         gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_MMHUB, 0);
-       if (!adev->mman.buffer_funcs_enabled || !adev->ib_pool_ready ||
-           adev->asic_type != CHIP_NAVI10) {
+       if (!adev->mman.buffer_funcs_enabled ||
+           !adev->ib_pool_ready ||
+           adev->in_gpu_reset) {
                 gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB, 0);
                 mutex_unlock(&adev->mman.gtt_window_lock);
                 return;
Quoted 3 lines

I think it should have been
adev->asic_type != CHIP_NAVI10 && adev->asic_type != CHIP_NAVI14 && adev->asic_type != CHIP_NAVI12

My last status is that Navi12 is not supposed to need that workaround, that's why we checked Navi10 and later Navi14 separately.

Quoted 5 lines

It's possible that I miss-read the !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) check here, but either way that looks to complicated to me.

We should rather mention every affected asic type separately here.

Good point. navi12 should be dropped from the check. How about the following?

(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
index 241a4e57cf4a..280bbd7ca8a0 100644

drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0 -0
@@ -292,7 +292,8 @@ static void gmc_v10_0_flush_gpu_tlb(struct

amdgpu_device *adev, uint32_t vmid,

        if (!adev->mman.buffer_funcs_enabled ||
            !adev->ib_pool_ready ||
-           adev->in_gpu_reset) {
+           adev->in_gpu_reset ||
+           (adev->asic_type == CHIP_NAVI12)) {
                gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB_0, 0);
                mutex_unlock(&adev->mman.gtt_window_lock);
                return;

Alex

Quoted 56 lines

Regards,
Christian.

Quoted 52 lines

Alex

Quoted 49 lines

Christian.

Am 26.09.19 um 14:26 schrieb Deucher, Alexander:

Please add a patch description. With that fixed:

________________________________
From: amd-gfx <[email protected]> on behalf of Yuan, Xiaojie <[email protected]>
Sent: Thursday, September 26, 2019 4:09 AM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Hi Alex,

This patch is to add the asic_type check which is missing after drm-next branch rebase.

BR,
Xiaojie
________________________________
From: Yuan, Xiaojie <[email protected]>
Sent: Thursday, September 26, 2019 4:08 PM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: [PATCH] drm/amdgpu/gmc10: apply the 'invalidation from sdma' workaround for navi

Fixes 767acabdac81 ("drm/amd/powerplay: add baco smu reset function for smu11")
---
  drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1 -1
index cb3f61873baa..dc2e68e019eb 100644
@@ -292,6 +292,7 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 
          if (!adev->mman.buffer_funcs_enabled ||
              !adev->ib_pool_ready ||
+           !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) ||
              adev->in_gpu_reset) {
                  gmc_v10_0_flush_vm_hub(adev, vmid, AMDGPU_GFXHUB_0, 0);
                  mutex_unlock(&adev->mman.gtt_window_lock);
--

2.20.1

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx