Skip to contentSkip to conversation

drm/amdgpu: fix an UMC hw arbitrator bug

PATCH In review Monk Liu 2 participants 4 messages Sep 24, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix an UMC hw arbitrator bug

issue:
the UMC h/w bug is that when MCLK is doing the switch in the middle of a page access being preempted by high priority client (e.g. DISPLAY) then UMC and the mclk switch would stuck there due to deadlock

how:
fixed by disabling auto PreChg for UMC to avoid high priority client preempting other client's access on the same page, thus the deadlock could be avoided

Change-Id Iaf6eb2a20a4785ec8440e64d5e0cae67aa0603da
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +18 -0
index 6102dea..8271b0c 100644
@@ -1306,6 +1306,24 @@ static int gmc_v9_0_gart_enable(struct amdgpu_device *adev)
 		 (unsigned)(adev->gmc.gart_size >> 20),
 		 (unsigned long long)amdgpu_bo_gpu_offset(adev->gart.bo));
 	adev->gart.ready = true;
+
+	/* disable auto Pchg is a w/a for the vega10 UMC hardware bug */
+	WREG32(0x5010c/4, 0x1002);
+	WREG32(0x5210c/4, 0x1002);
+	WREG32(0x5410c/4, 0x1002);
+	WREG32(0x5610c/4, 0x1002);
+	WREG32(0x15010c/4, 0x1002);
+	WREG32(0x15210c/4, 0x1002);
+	WREG32(0x15410c/4, 0x1002);
+	WREG32(0x15610c/4, 0x1002);
+	WREG32(0x25010c/4, 0x1002);
+	WREG32(0x25210c/4, 0x1002);
+	WREG32(0x25410c/4, 0x1002);
+	WREG32(0x25610c/4, 0x1002);
+	WREG32(0x35010c/4, 0x1002);
+	WREG32(0x35210c/4, 0x1002);
+	WREG32(0x35410c/4, 0x1002);
+	WREG32(0x35610c/4, 0x1002);
 	return 0;
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
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): 1569296333-5386-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

#2 lore raw

The patch is in high risk to break other VG series and MI series. Any confidence this is a common hw bug across all UMC 6.x generations?

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: 2019年9月24日 11:39
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: fix an UMC hw arbitrator bug

issue:
the UMC h/w bug is that when MCLK is doing the switch in the middle of a page access being preempted by high priority client (e.g. DISPLAY) then UMC and the mclk switch would stuck there due to deadlock

how:
fixed by disabling auto PreChg for UMC to avoid high priority client preempting other client's access on the same page, thus the deadlock could be avoided

Change-Id Iaf6eb2a20a4785ec8440e64d5e0cae67aa0603da
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +18 -0
index 6102dea..8271b0c 100644
@@ -1306,6 +1306,24 @@ static int gmc_v9_0_gart_enable(struct amdgpu_device *adev)
 		 (unsigned)(adev->gmc.gart_size >> 20),
 		 (unsigned long long)amdgpu_bo_gpu_offset(adev->gart.bo));
 	adev->gart.ready = true;
+
+	/* disable auto Pchg is a w/a for the vega10 UMC hardware bug */
+	WREG32(0x5010c/4, 0x1002);
+	WREG32(0x5210c/4, 0x1002);
+	WREG32(0x5410c/4, 0x1002);
+	WREG32(0x5610c/4, 0x1002);
+	WREG32(0x15010c/4, 0x1002);
+	WREG32(0x15210c/4, 0x1002);
+	WREG32(0x15410c/4, 0x1002);
+	WREG32(0x15610c/4, 0x1002);
+	WREG32(0x25010c/4, 0x1002);
+	WREG32(0x25210c/4, 0x1002);
+	WREG32(0x25410c/4, 0x1002);
+	WREG32(0x25610c/4, 0x1002);
+	WREG32(0x35010c/4, 0x1002);
+	WREG32(0x35210c/4, 0x1002);
+	WREG32(0x35410c/4, 0x1002);
+	WREG32(0x35610c/4, 0x1002);
 	return 0;
 }
 

--
2.7.4

_______________________________________________
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): DM5PR12MB1418A62797503948F23937BAFC840-2J9CzHegvk81aAVlcVN8UQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw

I'd suggest you create umc function to apply these workaround to VG10 only if we are not sure this is a common hw bugs. You can refer to amdgpu_umc_funcs for creating umc callback functions.

In addition, normally umc per channel registers will have constant offset, like 0x200 for vg10. You can leverage this to simplify the logic in the umc callback function.

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: 2019年9月24日 13:44
To: Liu, Monk <[email protected]>; [email protected]
Cc: Liu, Monk <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: fix an UMC hw arbitrator bug

The patch is in high risk to break other VG series and MI series. Any confidence this is a common hw bug across all UMC 6.x generations?

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: 2019年9月24日 11:39
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: fix an UMC hw arbitrator bug

issue:
the UMC h/w bug is that when MCLK is doing the switch in the middle of a page access being preempted by high priority client (e.g. DISPLAY) then UMC and the mclk switch would stuck there due to deadlock

how:
fixed by disabling auto PreChg for UMC to avoid high priority client preempting other client's access on the same page, thus the deadlock could be avoided

Change-Id Iaf6eb2a20a4785ec8440e64d5e0cae67aa0603da
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +18 -0
index 6102dea..8271b0c 100644
@@ -1306,6 +1306,24 @@ static int gmc_v9_0_gart_enable(struct amdgpu_device *adev)
 		 (unsigned)(adev->gmc.gart_size >> 20),
 		 (unsigned long long)amdgpu_bo_gpu_offset(adev->gart.bo));
 	adev->gart.ready = true;
+
+	/* disable auto Pchg is a w/a for the vega10 UMC hardware bug */
+	WREG32(0x5010c/4, 0x1002);
+	WREG32(0x5210c/4, 0x1002);
+	WREG32(0x5410c/4, 0x1002);
+	WREG32(0x5610c/4, 0x1002);
+	WREG32(0x15010c/4, 0x1002);
+	WREG32(0x15210c/4, 0x1002);
+	WREG32(0x15410c/4, 0x1002);
+	WREG32(0x15610c/4, 0x1002);
+	WREG32(0x25010c/4, 0x1002);
+	WREG32(0x25210c/4, 0x1002);
+	WREG32(0x25410c/4, 0x1002);
+	WREG32(0x25610c/4, 0x1002);
+	WREG32(0x35010c/4, 0x1002);
+	WREG32(0x35210c/4, 0x1002);
+	WREG32(0x35410c/4, 0x1002);
+	WREG32(0x35610c/4, 0x1002);
 	return 0;
 }
 

--
2.7.4

_______________________________________________
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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#5 lore raw
In reply to a message not in the archive

Okay, I can limit it only for vega10 adapter

_____________________________________
Monk Liu|GPU Virtualization Team |AMD

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Tuesday, September 24, 2019 1:44 PM
To: Liu, Monk <[email protected]>; [email protected]
Cc: Liu, Monk <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: fix an UMC hw arbitrator bug

The patch is in high risk to break other VG series and MI series. Any confidence this is a common hw bug across all UMC 6.x generations?

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: 2019年9月24日 11:39
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: fix an UMC hw arbitrator bug

issue:
the UMC h/w bug is that when MCLK is doing the switch in the middle of a page access being preempted by high priority client (e.g. DISPLAY) then UMC and the mclk switch would stuck there due to deadlock

how:
fixed by disabling auto PreChg for UMC to avoid high priority client preempting other client's access on the same page, thus the deadlock could be avoided

Change-Id Iaf6eb2a20a4785ec8440e64d5e0cae67aa0603da
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +18 -0
index 6102dea..8271b0c 100644
@@ -1306,6 +1306,24 @@ static int gmc_v9_0_gart_enable(struct amdgpu_device *adev)
 		 (unsigned)(adev->gmc.gart_size >> 20),
 		 (unsigned long long)amdgpu_bo_gpu_offset(adev->gart.bo));
 	adev->gart.ready = true;
+
+	/* disable auto Pchg is a w/a for the vega10 UMC hardware bug */
+	WREG32(0x5010c/4, 0x1002);
+	WREG32(0x5210c/4, 0x1002);
+	WREG32(0x5410c/4, 0x1002);
+	WREG32(0x5610c/4, 0x1002);
+	WREG32(0x15010c/4, 0x1002);
+	WREG32(0x15210c/4, 0x1002);
+	WREG32(0x15410c/4, 0x1002);
+	WREG32(0x15610c/4, 0x1002);
+	WREG32(0x25010c/4, 0x1002);
+	WREG32(0x25210c/4, 0x1002);
+	WREG32(0x25410c/4, 0x1002);
+	WREG32(0x25610c/4, 0x1002);
+	WREG32(0x35010c/4, 0x1002);
+	WREG32(0x35210c/4, 0x1002);
+	WREG32(0x35410c/4, 0x1002);
+	WREG32(0x35610c/4, 0x1002);
 	return 0;
 }
 

--
2.7.4

_______________________________________________
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