]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
drm/amdgpu: read reg in each iterator of psp_wait_for loop
authorZhang, Jerry <Jerry.Zhang@amd.com>
Fri, 14 Jul 2017 10:20:17 +0000 (18:20 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 28 Sep 2017 14:30:58 +0000 (10:30 -0400)
BugLink: http://bugs.launchpad.net/bugs/1720154
commit 2890decfd9969cac21067ca0c734fbccaf74d634 upstream.

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

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Acked-by: Huang Rui <ray.huang@amd.com> (v1)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c

index 4083be61b328fb56f1832fa95496074e8c84cef7..6417febe18b99e55aca788a254dd97a666dd7da7 100644 (file)
@@ -95,9 +95,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;
index c98d77d0c8f84a064fa16d82ed1f57fedb9723be..6f80ad8f588b0cdabd8237b1cb46e7895b56b7ce 100644 (file)
@@ -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;
 }