drm/amdgpu: do optimization for psp command submit
authorpengzhou <PengJu.Zhou@amd.com>
Wed, 16 Dec 2020 05:14:15 +0000 (13:14 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Jan 2021 16:33:35 +0000 (11:33 -0500)
In the psp command submit logic,
the function msleep(1) delayed too long,
Changing it to usleep_range(10, 100) to
have a better performance.

Signed-off-by: Peng Ju Zhou <PengJu.Zhou@amd.com>
Reviewed-by: Emily.Deng <Emily.Deng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 5d6fc369e32c142e141bd605ba03677d81549207..2921f881fc6660419f9cf977b37f589ea4b1cc31 100644 (file)
@@ -249,7 +249,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
 {
        int ret;
        int index;
-       int timeout = 2000;
+       int timeout = 20000;
        bool ras_intr = false;
        bool skip_unsupport = false;
 
@@ -282,7 +282,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
                ras_intr = amdgpu_ras_intr_triggered();
                if (ras_intr)
                        break;
-               msleep(1);
+               usleep_range(10, 100);
                amdgpu_asic_invalidate_hdp(psp->adev, NULL);
        }