Skip to contentSkip to conversation

drm/amdgpu/gfx10: explicitly wait for cp idle after halt/unhalt

PATCH In review Xiaojie Yuan 2 participants 2 messages Nov 14, 2019 1 message not in the archive

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

PATCH 1/1 drm/amdgpu/gfx10: explicitly wait for cp idle after halt/unhalt

50us is not enough to wait for cp ready after gpu reset on some navi asics.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +11 -1
index 86db40717d38..7d40c73a5ab7 100644
@@ -2371,7 +2371,17 @@ static void gfx_v10_0_cp_gfx_enable(struct amdgpu_device *adev, bool enable)
 			adev->gfx.gfx_ring[i].sched.ready = false;
 	}
 	WREG32_SOC15(GC, 0, mmCP_ME_CNTL, tmp);
-	udelay(50);
+
+	for (i = 0; i < adev->usec_timeout; i++) {
+		if (RREG32_SOC15(GC, 0, mmCP_STAT) == 0)
+			break;
+		udelay(1);
+	}
+
+	if (i >= adev->usec_timeout)
+		DRM_ERROR("failed to %s cp gfx\n", enable ? "unhalt" : "halt");
+
+	return 0;
 }
 
 static int gfx_v10_0_cp_gfx_load_pfp_microcode(struct amdgpu_device *adev)
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

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Xiaojie Yuan <[email protected]>
Sent: Thursday, November 14, 2019 4:13 AM
To: [email protected] <[email protected]>
Cc: Long, Gang <[email protected]>; Xiao, Jack <[email protected]>; Yuan, Xiaojie <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu/gfx10: explicitly wait for cp idle after halt/unhalt

50us is not enough to wait for cp ready after gpu reset on some navi asics.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +11 -1
index 86db40717d38..7d40c73a5ab7 100644
@@ -2371,7 +2371,17 @@ static void gfx_v10_0_cp_gfx_enable(struct amdgpu_device *adev, bool enable)
                         adev->gfx.gfx_ring[i].sched.ready = false;
         }
         WREG32_SOC15(GC, 0, mmCP_ME_CNTL, tmp);
-       udelay(50);
+
+       for (i = 0; i < adev->usec_timeout; i++) {
+               if (RREG32_SOC15(GC, 0, mmCP_STAT) == 0)
+                       break;
+               udelay(1);
+       }
+
+       if (i >= adev->usec_timeout)
+               DRM_ERROR("failed to %s cp gfx\n", enable ? "unhalt" : "halt");
+
+       return 0;
 }
 
 static int gfx_v10_0_cp_gfx_load_pfp_microcode(struct amdgpu_device *adev)

--
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