drm/amdgpu/sriov:now must reinit psp
Subsystems (2)
PATCH 1/2 drm/amdgpu/sriov:now must reinit psp
otherwise after VF FLR the KIQ cannot work
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -0
@@ -1880,6 +1880,7 @@ static int amdgpu_sriov_reinit_late(struct amdgpu_device *adev)static enum amd_ip_block_type ip_order[] = {AMD_IP_BLOCK_TYPE_SMC , +AMD_IP_BLOCK_TYPE_PSP ,AMD_IP_BLOCK_TYPE_DCE ,AMD_IP_BLOCK_TYPE_GFX ,AMD_IP_BLOCK_TYPE_SDMA ,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/2 drm/amdgpu/sriov:fix memory leak in psp_load_fw
In reply to a message not in the archivewhen doing gpu reset this routine shouldn't do anything resource allocating otherwise SRIOV gpu reset will cause memory leak
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +12 -8
@@ -334,23 +334,26 @@ static int psp_load_fw(struct amdgpu_device *adev)int ret;struct psp_context *psp = &adev->psp; +if (amdgpu_sriov_vf (adev) && adev->in_sriov_reset !=0 ) + goto skip_memalloc; + psp->cmd =kzalloc (sizeof (struct psp_gfx_cmd_resp ),GFP_KERNEL );if (!psp->cmd)return -ENOMEM ; ret =amdgpu_bo_create_kernel (adev,PSP_1_MEG ,PSP_1_MEG , -AMDGPU_GEM_DOMAIN_GTT , - &psp->fw_pri_bo, - &psp->fw_pri_mc_addr, - &psp->fw_pri_buf); +AMDGPU_GEM_DOMAIN_GTT , + &psp->fw_pri_bo, + &psp->fw_pri_mc_addr, + &psp->fw_pri_buf);if (ret) goto failed; ret =amdgpu_bo_create_kernel (adev,PSP_FENCE_BUFFER_SIZE ,PAGE_SIZE , -AMDGPU_GEM_DOMAIN_VRAM , - &psp->fence_buf_bo, - &psp->fence_buf_mc_addr, - &psp->fence_buf); +AMDGPU_GEM_DOMAIN_VRAM , + &psp->fence_buf_bo, + &psp->fence_buf_mc_addr, + &psp->fence_buf);if (ret) goto failed_mem2;
@@ -375,6 +378,7 @@ static int psp_load_fw(struct amdgpu_device *adev)if (ret) goto failed_mem; +skip_memalloc: ret =psp_hw_start (psp);if (ret) goto failed_mem;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
Reviewed-byRe: [PATCH 2/2] drm/amdgpu/sriov:fix memory leak in psp_load_fw
In reply to a message not in the archiveQuoted 6 lines · Monk Liu
when doing gpu reset this routine shouldn't do anything resource allocating otherwise SRIOV gpu reset will cause memory leak
Change-Id I25da3a5b475196c75c7e639adc40751754625968Signed-off-by Monk Liu <[email protected]>
A couple of comments below. With those fixed, series is:
Quoted 18 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3
-0@@ -334,23 +334,26 @@ static int psp_load_fw(struct amdgpu_device *adev)int ret;struct psp_context *psp = &adev->psp; +if (amdgpu_sriov_vf (adev) && adev->in_sriov_reset !=0 ) + goto skip_memalloc; + psp->cmd =kzalloc (sizeof (struct psp_gfx_cmd_resp ),GFP_KERNEL );if (!psp->cmd)return -ENOMEM ;
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_load_fw(struct amdgpu_device *adev) · line 348
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +4
-4ret =amdgpu_bo_create_kernel (adev,PSP_1_MEG ,PSP_1_MEG , -AMDGPU_GEM_DOMAIN_GTT , - &psp->fw_pri_bo, - &psp->fw_pri_mc_addr, - &psp->fw_pri_buf); +AMDGPU_GEM_DOMAIN_GTT , + &psp->fw_pri_bo, + &psp->fw_pri_mc_addr, + &psp->fw_pri_buf);
drop whitespace change.
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_load_fw(struct amdgpu_device *adev) · line 356
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +4
-4if (ret) goto failed; ret =amdgpu_bo_create_kernel (adev,PSP_FENCE_BUFFER_SIZE ,PAGE_SIZE , -AMDGPU_GEM_DOMAIN_VRAM , - &psp->fence_buf_bo, - &psp->fence_buf_mc_addr, - &psp->fence_buf); +AMDGPU_GEM_DOMAIN_VRAM , + &psp->fence_buf_bo, + &psp->fence_buf_mc_addr, + &psp->fence_buf);
Same here.
Quoted 14 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1
-1if (ret) goto failed_mem2;@@ -375,6 +378,7 @@ static int psp_load_fw(struct amdgpu_device *adev)if (ret) goto failed_mem; +skip_memalloc: ret =psp_hw_start (psp);if (ret) goto failed_mem; --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx