From: Zhang, Jerry Date: Fri, 14 Jul 2017 10:20:17 +0000 (+0800) Subject: drm/amdgpu: read reg in each iterator of psp_wait_for loop X-Git-Tag: v4.14-rc1~8^2~44^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2890decfd9969cac21067ca0c734fbccaf74d634;p=platform%2Fkernel%2Flinux-rpi3.git drm/amdgpu: read reg in each iterator of psp_wait_for loop v2: fix the SOS loading failure for PSP v3.1 Signed-off-by: Junwei Zhang Cc: stable@vger.kernel.org Acked-by: Alex Deucher (v1) Acked-by: Huang Rui (v1) Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 9f83264..68def10 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -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; diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c index 48f69fe6..2a535a4 100644 --- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c +++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c @@ -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; }