Skip to contentSkip to conversation

drm/amdgpu: read reg in each iterate of psp_wait_for loop

PATCH In review Junwei Zhang 2 participants 2 messages Jul 18, 2017

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

PATCH 1/1 drm/amdgpu: read reg in each iterate of psp_wait_for loop

From: "Zhang, Jerry" <[email protected]>

v2: fixes the SOS loading failure for PSP v3.1

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +--
 drivers/gpu/drm/amd/amdgpu/psp_v3_1.c   | 2 --
 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -2
index c919579..644941d 100644
@@ -98,9 +98,8 @@ int psp_wait_for(struct psp_context *psp, uint32_t reg_index,
 	int i;
 	struct amdgpu_device *adev = psp->adev;
 
-	val = RREG32(reg_index);
-
 	for (i = 0; i < adev->usec_timeout; i++) {
+		val = RREG32(reg_index);
 		if (check_changed) {
 			if (val != reg_val)
 				return 0;
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c +0 -2
index 2718e86..23106e3 100644
@@ -237,11 +237,9 @@ int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
 
 	/* there might be handshake issue with hardware which needs delay */
 	mdelay(20);
-#if 0
 	ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_81),
 			   RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81),
 			   0, true);
-#endif
 
 	return ret;
 }
Signature · 1 line
1.9.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines

-----Original Message-----
From: Junwei Zhang [mailto:[email protected]]
Sent: Monday, July 17, 2017 10:54 PM
To: [email protected]
Cc: Deucher, Alexander; Huang, Ray; [email protected]; Zhang, Jerry; [email protected]
Subject: [PATCH] drm/amdgpu: read reg in each iterate of psp_wait_for loop

Quoted 8 lines

From: "Zhang, Jerry" <[email protected]>

v2: fixes the SOS loading failure for PSP v3.1

Quoted 45 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +--
 drivers/gpu/drm/amd/amdgpu/psp_v3_1.c   | 2 --
 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -2
index c919579..644941d 100644
@@ -98,9 +98,8 @@ int psp_wait_for(struct psp_context *psp, uint32_t
 reg_index,
 	int i;
 	struct amdgpu_device *adev = psp->adev;
 
-	val = RREG32(reg_index);
-
 	for (i = 0; i < adev->usec_timeout; i++) {
+		val = RREG32(reg_index);
 		if (check_changed) {
 			if (val != reg_val)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -0
 				return 0;
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c +0 -3
index 2718e86..23106e3 100644
@@ -237,11 +237,9 @@ int psp_v3_1_bootloader_load_sos(struct
 psp_context *psp)
 
 	/* there might be handshake issue with hardware which needs delay
 */
 	mdelay(20);
-#if 0
 	ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0,
 mmMP0_SMN_C2PMSG_81),
 			   RREG32_SOC15(MP0, 0,
 mmMP0_SMN_C2PMSG_81),
 			   0, true);
-#endif
 
 	return ret;
 }
--

1.9.1