Skip to contentSkip to conversation

drm/amdgpu: Fix RLC safe mode test in gfx_v9_0_enter_rlc_safe_mode

PATCH In review Michel Dänzer 4 participants 5 messages Jul 20, 2018 – Jul 24, 2018 2 messages not in the archive

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

PATCH 1/1 drm/amdgpu: Fix RLC safe mode test in gfx_v9_0_enter_rlc_safe_mode

From: Michel Dänzer <[email protected]>

We were testing the register offset, instead of the value stored in the register, therefore always timing out the loop.

This reduces suspend time of the system in the bug report below by ~600 ms.

Bugzilla: https://bugs.freedesktop.org/107277

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
index 9ab39117cc4e..ef00d14f8645 100644
@@ -3490,7 +3490,7 @@ static void gfx_v9_0_enter_rlc_safe_mode(struct amdgpu_device *adev)
 
 		/* wait for RLC_SAFE_MODE */
 		for (i = 0; i < adev->usec_timeout; i++) {
-			if (!REG_GET_FIELD(SOC15_REG_OFFSET(GC, 0, mmRLC_SAFE_MODE), RLC_SAFE_MODE, CMD))
+			if (!REG_GET_FIELD(RREG32_SOC15(GC, 0, mmRLC_SAFE_MODE), RLC_SAFE_MODE, CMD))
 				break;
 			udelay(1);
 		}
Signature · 6 lines
2.18.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Alex Deucher
#2 lore raw
In reply to a message not in the archive
Quoted 13 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Friday, July 20, 2018 12:33 PM
To: [email protected]
Subject: [PATCH] drm/amdgpu: Fix RLC safe mode test in gfx_v9_0_enter_rlc_safe_mode

From: Michel Dänzer <[email protected]>

We were testing the register offset, instead of the value stored in the register, therefore always timing out the loop.

Quoted 6 lines

This reduces suspend time of the system in the bug report below by ~600 ms.

Bugzilla: https://bugs.freedesktop.org/107277

Quoted 25 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
index 9ab39117cc4e..ef00d14f8645 100644
@@ -3490,7 +3490,7 @@ static void gfx_v9_0_enter_rlc_safe_mode(struct
 amdgpu_device *adev)
 
 		/* wait for RLC_SAFE_MODE */
 		for (i = 0; i < adev->usec_timeout; i++) {
-			if (!REG_GET_FIELD(SOC15_REG_OFFSET(GC, 0,
 mmRLC_SAFE_MODE), RLC_SAFE_MODE, CMD))
+			if (!REG_GET_FIELD(RREG32_SOC15(GC, 0,
 mmRLC_SAFE_MODE),
+RLC_SAFE_MODE, CMD))
 				break;
 			udelay(1);
 		}
--

2.18.0

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

Reviewed-by Junwei Zhang
#3 lore raw
In reply to a message not in the archive
Quoted 11 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

We were testing the register offset, instead of the value stored in the register, therefore always timing out the loop.

This reduces suspend time of the system in the bug report below by ~600 ms.

Bugzilla: https://bugs.freedesktop.org/107277

Good catch.

Quoted 10 lines
---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
index 9ab39117cc4e..ef00d14f8645 100644

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_enter_rlc_safe_mode(struct amdgpu_device *adev) · line 3496

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
@@ -3490,7 +3490,7 @@ static void gfx_v9_0_enter_rlc_safe_mode(struct amdgpu_device *adev)
 
  		/* wait for RLC_SAFE_MODE */
  		for (i = 0; i < adev->usec_timeout; i++) {
-			if (!REG_GET_FIELD(SOC15_REG_OFFSET(GC, 0, mmRLC_SAFE_MODE), RLC_SAFE_MODE, CMD))
+			if (!REG_GET_FIELD(RREG32_SOC15(GC, 0, mmRLC_SAFE_MODE), RLC_SAFE_MODE, CMD))
  				break;
  			udelay(1);
  		}

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

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

Dear Michel,

Quoted 11 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

We were testing the register offset, instead of the value stored in the register, therefore always timing out the loop.

This reduces suspend time of the system in the bug report below by ~600 ms.

Bugzilla: https://bugs.freedesktop.org/107277

[…]

As this line is present since v4.12-rc1, could you please tag this to be picked up for the stable series (4.14.x)?

Kind regards,

Paul

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

#6 lore raw
In reply to a message not in the archive
Quoted 9 lines · Paul Menzel
Quoted 8 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

We were testing the register offset, instead of the value stored in the register, therefore always timing out the loop.

This reduces suspend time of the system in the bug report below by ~600 ms.

Quoted 8 lines
Quoted 3 lines

Bugzilla: https://bugs.freedesktop.org/107277

[…]

As this line is present since v4.12-rc1, could you please tag this to be picked up for the stable series (4.14.x)?

I added the Cc: stable tag before pushing to the internal amd-staging-drm-next branch.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx