drm/amdgpu: add psp_timeout to limit PSP related operation
authorLikun Gao <Likun.Gao@amd.com>
Mon, 30 Oct 2023 02:48:20 +0000 (10:48 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Feb 2024 22:18:24 +0000 (17:18 -0500)
Add a new parameter psp_timeout to limit psp related operation
to unify the timeout limition for psp.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 2cf4fb3..9246bca 100644 (file)
@@ -1096,6 +1096,7 @@ struct amdgpu_device {
        long                            sdma_timeout;
        long                            video_timeout;
        long                            compute_timeout;
+       long                            psp_timeout;
 
        uint64_t                        unique_id;
        uint64_t        df_perfmon_config_assign_mask[AMDGPU_MAX_DF_PERFMONS];
index 1a39ea9..f0f01ea 100644 (file)
@@ -247,6 +247,8 @@ static int psp_early_init(void *handle)
 
        psp->adev = adev;
 
+       adev->psp_timeout = 20000;
+
        psp_check_pmfw_centralized_cstate_management(psp);
 
        if (amdgpu_sriov_vf(adev))
@@ -644,7 +646,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
 {
        int ret;
        int index;
-       int timeout = 20000;
+       int timeout = psp->adev->psp_timeout;
        bool ras_intr = false;
        bool skip_unsupport = false;