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 17af26e..af726bc 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