drm amdgpu: Skip tmr load for SRIOV
Subsystems (2)
PATCH 1/2 drm amdgpu: Skip tmr load for SRIOV
1. For Navi12, CHIP_SIENNA_CICHLID, skip tmr load operation;
2. Check pointer before release firmware.
v2: use CHIP_SIENNA_CICHLID instead
v3: remove local "bool ret"; fix grammer issue
v4: use my name instead of "root"
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 35 ++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +29 -6
@@ -193,12 +193,18 @@ static int psp_sw_fini(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle;psp_memory_training_fini (&adev->psp); -release_firmware (adev->psp.sos_fw); - adev->psp.sos_fw =NULL ; -release_firmware (adev->psp.asd_fw); - adev->psp.asd_fw =NULL ; -release_firmware (adev->psp.ta_fw); - adev->psp.ta_fw =NULL ; +if (adev->psp.sos_fw) { +release_firmware (adev->psp.sos_fw); + adev->psp.sos_fw =NULL ; + } +if (adev->psp.asd_fw) { +release_firmware (adev->psp.asd_fw); + adev->psp.asd_fw =NULL ; + } +if (adev->psp.ta_fw) { +release_firmware (adev->psp.ta_fw); + adev->psp.ta_fw =NULL ; + }if (adev->asic_type ==CHIP_NAVI10 )psp_sysfs_fini (adev);
@@ -409,11 +415,28 @@ static int psp_clear_vf_fw(struct psp_context *psp)return ret; } +static bool psp_skip_tmr (struct psp_context *psp) +{ +switch (psp->adev->asic_type) { +case CHIP_NAVI12 : +case CHIP_SIENNA_CICHLID : +return true; +default : +return false; + } +} +static int psp_tmr_load (struct psp_context *psp) {int ret;struct psp_gfx_cmd_resp *cmd; +/* for Navi12 and CHIP_SIENNA_CICHLID SRIOV, do not set up TMR +* (already setup by host driver) +*/ +if (amdgpu_sriov_vf (psp->adev) &&psp_skip_tmr (psp)) +return 0 ; + cmd =kzalloc (sizeof (struct psp_gfx_cmd_resp ),GFP_KERNEL );if (!cmd)return -ENOMEM ;
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 7 lines · Liu ChengZhe
1. For Navi12,
CHIP_SIENNA_CICHLID, skip tmr load operation;
2. Check pointer before release firmware.v2: use
CHIP_SIENNA_CICHLIDinstead
v3: remove local "bool ret"; fix grammer issue
v4: use my name instead of "root"
Don't indent any lines.
Quoted 38 lines
Signed-off-by Liu ChengZhe <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 35 ++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +12
-6@@ -193,12 +193,18 @@ static int psp_sw_fini(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle;psp_memory_training_fini (&adev->psp); -release_firmware (adev->psp.sos_fw); - adev->psp.sos_fw =NULL ; -release_firmware (adev->psp.asd_fw); - adev->psp.asd_fw =NULL ; -release_firmware (adev->psp.ta_fw); - adev->psp.ta_fw =NULL ; +if (adev->psp.sos_fw) { +release_firmware (adev->psp.sos_fw); + adev->psp.sos_fw =NULL ; + } +if (adev->psp.asd_fw) { +release_firmware (adev->psp.asd_fw); + adev->psp.asd_fw =NULL ; + } +if (adev->psp.ta_fw) { +release_firmware (adev->psp.ta_fw); + adev->psp.ta_fw =NULL ; + }if (adev->asic_type ==CHIP_NAVI10 )psp_sysfs_fini (adev);@@ -409,11 +415,28 @@ static int psp_clear_vf_fw(struct psp_context *psp)return ret; }
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_clear_vf_fw(struct psp_context *psp) · line 427
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +10
-0+static bool psp_skip_tmr (struct psp_context *psp) +{ +switch (psp->adev->asic_type) { +case CHIP_NAVI12 : +case CHIP_SIENNA_CICHLID : +return true; +default : +return false; + } +}
Yeah, that's very nice now.
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_clear_vf_fw(struct psp_context *psp) · line 433
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1
-0+static int psp_tmr_load (struct psp_context *psp) {int ret;struct psp_gfx_cmd_resp *cmd;
Fix this:
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_clear_vf_fw(struct psp_context *psp) · line 435
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2
-0+/* (F)for Navi12 and CHIP_SIENNA_CICHLID SRIOV, do not set up TMR(.) +* (A)already set( )up by host driver(.)
Thanks,
Luben
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_clear_vf_fw(struct psp_context *psp) · line 442
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +4
-0+*/ +if (amdgpu_sriov_vf (psp->adev) &&psp_skip_tmr (psp)) +return 0 ; + cmd =kzalloc (sizeof (struct psp_gfx_cmd_resp ),GFP_KERNEL );if (!cmd)return -ENOMEM ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx