drm/amdgpu: fix gmc init fail in sriov mode
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix gmc init fail in sriov mode
"adev->gfx.rlc.rlcg_reg_access_supported = true;"
the above varible were set too late during driver initialization. it will cause the driver to fail to write/read register successfully during GMC hw init in sriov mode.
move gfx_xxx_init_rlcg_reg_access_ctrl() function to gfx early init stage to avoid this issue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 +++- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -1
@@ -4343,7 +4343,6 @@ static int gfx_v10_0_rlc_init(struct amdgpu_device *adev)if (adev->gfx.rlc.funcs->update_spm_vmid) adev->gfx.rlc.funcs->update_spm_vmid (adev,0xf ); -gfx_v10_0_init_rlcg_reg_access_ctrl (adev);return 0 ; }
@@ -7682,6 +7681,9 @@ static int gfx_v10_0_early_init(void *handle)gfx_v10_0_set_gds_init (adev);gfx_v10_0_set_rlc_funcs (adev); +/* init rlcg reg access ctrl */ +gfx_v10_0_init_rlcg_reg_access_ctrl (adev); +return 0 ; }
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -3
@@ -1934,9 +1934,6 @@ static int gfx_v9_0_rlc_init(struct amdgpu_device *adev)if (adev->gfx.rlc.funcs->update_spm_vmid) adev->gfx.rlc.funcs->update_spm_vmid (adev,0xf ); -/* init rlcg reg access ctrl */ -gfx_v9_0_init_rlcg_reg_access_ctrl (adev); -return 0 ; }
@@ -4755,6 +4752,9 @@ static int gfx_v9_0_early_init(void *handle)gfx_v9_0_set_gds_init (adev);gfx_v9_0_set_rlc_funcs (adev); +/* init rlcg reg access ctrl */ +gfx_v9_0_init_rlcg_reg_access_ctrl (adev); +return 0 ; }
Signature · 1 line
2.25.1
[AMD Official Use Only]
Regards,
Hawking
-----Original Message-----
From: Wang, Yang(Kevin) <[email protected]>
Sent: Wednesday, February 9, 2022 22:30
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Min, Frank <[email protected]>; Wang, Yang(Kevin) <[email protected]>
Subject: [PATCH] drm/amdgpu: fix gmc init fail in sriov mode
"adev->gfx.rlc.rlcg_reg_access_supported = true;"
the above varible were set too late during driver initialization.
it will cause the driver to fail to write/read register successfully during GMC hw init in sriov mode.
move gfx_xxx_init_rlcg_reg_access_ctrl() function to gfx early init stage to avoid this issue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 +++- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -1
@@ -4343,7 +4343,6 @@ static int gfx_v10_0_rlc_init(struct amdgpu_device *adev)if (adev->gfx.rlc.funcs->update_spm_vmid) adev->gfx.rlc.funcs->update_spm_vmid (adev,0xf ); -gfx_v10_0_init_rlcg_reg_access_ctrl (adev);return 0 ; }
@@ -7682,6 +7681,9 @@ static int gfx_v10_0_early_init(void *handle)gfx_v10_0_set_gds_init (adev);gfx_v10_0_set_rlc_funcs (adev); +/* init rlcg reg access ctrl */ +gfx_v10_0_init_rlcg_reg_access_ctrl (adev); +return 0 ; }
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -3
@@ -1934,9 +1934,6 @@ static int gfx_v9_0_rlc_init(struct amdgpu_device *adev)if (adev->gfx.rlc.funcs->update_spm_vmid) adev->gfx.rlc.funcs->update_spm_vmid (adev,0xf ); -/* init rlcg reg access ctrl */ -gfx_v9_0_init_rlcg_reg_access_ctrl (adev); -return 0 ; }
@@ -4755,6 +4752,9 @@ static int gfx_v9_0_early_init(void *handle)gfx_v9_0_set_gds_init (adev);gfx_v9_0_set_rlc_funcs (adev); +/* init rlcg reg access ctrl */ +gfx_v9_0_init_rlcg_reg_access_ctrl (adev); +return 0 ; }
--
2.25.1
[AMD Official Use Only]
Hi Kevin,
This patch looks good to me
Reviewed by: Frank Min <[email protected]>
Best Regards,
Frank
-----Original Message-----
From: Wang, Yang(Kevin) <[email protected]>
Sent: Wednesday, February 9, 2022 10:30 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Min, Frank <[email protected]>; Wang, Yang(Kevin) <[email protected]>
Subject: [PATCH] drm/amdgpu: fix gmc init fail in sriov mode
"adev->gfx.rlc.rlcg_reg_access_supported = true;"
the above varible were set too late during driver initialization.
it will cause the driver to fail to write/read register successfully during GMC hw init in sriov mode.
move gfx_xxx_init_rlcg_reg_access_ctrl() function to gfx early init stage to avoid this issue.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 +++- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -1
@@ -4343,7 +4343,6 @@ static int gfx_v10_0_rlc_init(struct amdgpu_device *adev)if (adev->gfx.rlc.funcs->update_spm_vmid) adev->gfx.rlc.funcs->update_spm_vmid (adev,0xf ); -gfx_v10_0_init_rlcg_reg_access_ctrl (adev);return 0 ; }
@@ -7682,6 +7681,9 @@ static int gfx_v10_0_early_init(void *handle)gfx_v10_0_set_gds_init (adev);gfx_v10_0_set_rlc_funcs (adev); +/* init rlcg reg access ctrl */ +gfx_v10_0_init_rlcg_reg_access_ctrl (adev); +return 0 ; }
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -3
@@ -1934,9 +1934,6 @@ static int gfx_v9_0_rlc_init(struct amdgpu_device *adev)if (adev->gfx.rlc.funcs->update_spm_vmid) adev->gfx.rlc.funcs->update_spm_vmid (adev,0xf ); -/* init rlcg reg access ctrl */ -gfx_v9_0_init_rlcg_reg_access_ctrl (adev); -return 0 ; }
@@ -4755,6 +4752,9 @@ static int gfx_v9_0_early_init(void *handle)gfx_v9_0_set_gds_init (adev);gfx_v9_0_set_rlc_funcs (adev); +/* init rlcg reg access ctrl */ +gfx_v9_0_init_rlcg_reg_access_ctrl (adev); +return 0 ; }
--
2.25.1