drm/amdgpu/psp: invalidate the hdp read cache before reading the psp response
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Sep 2019 20:17:41 +0000 (15:17 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Oct 2019 14:10:59 +0000 (09:10 -0500)
Otherwise we may get stale data.

Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 17af26ee5a7f0586c146ca2e459f9d03971d774a..af726bc6980df4c510b1baacfc1e0fb23a815174 100644 (file)
@@ -151,10 +151,12 @@ psp_cmd_submit_buf(struct psp_context *psp,
                return ret;
        }
 
+       amdgpu_asic_invalidate_hdp(psp->adev, NULL);
        while (*((unsigned int *)psp->fence_buf) != index) {
                if (--timeout == 0)
                        break;
                msleep(1);
+               amdgpu_asic_invalidate_hdp(psp->adev, NULL);
        }
 
        /* In some cases, psp response status is not 0 even there is no