When pdb0 enabled, the cached gpu addr is not compatible with SMU and PSP. It always need to be updated. Remove the cached gpu addr and use local variable instead.
Signed-off-by: Samuel Zhang <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 12 ++++++------ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 153c0c868546..3b71ff298f21 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -287,7 +287,7 @@ static void psp_free_shared_bufs(struct psp_context *psp) /* free TMR memory buffer */ pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL; - amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, pptr); + amdgpu_bo_free_kernel(&psp->tmr_bo, NULL, pptr); psp->tmr_bo = NULL; /* free xgmi shared memory */ @@ -867,11 +867,9 @@ static int psp_tmr_init(struct psp_context *psp) AMDGPU_HAS_VRAM(psp->adev) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT, - &psp->tmr_bo, &psp->tmr_mc_addr, + &psp->tmr_bo, NULL, pptr); } - if (psp->tmr_bo) - psp->tmr_mc_addr = amdgpu_bo_fb_aper_addr(psp->tmr_bo); return ret; } @@ -896,6 +894,7 @@ static int psp_tmr_load(struct psp_context *psp) { int ret; struct psp_gfx_cmd_resp *cmd; + uint64_t tmr_mc_addr; /* For Navi12 and CHIP_SIENNA_CICHLID SRIOV, do not set up TMR. * Already set up by host driver. @@ -905,10 +904,11 @@ static int psp_tmr_load(struct psp_context *psp) cmd = acquire_psp_cmd_buf(psp); - psp_prep_tmr_cmd_buf(psp, cmd, psp->tmr_mc_addr, psp->tmr_bo); + tmr_mc_addr = amdgpu_bo_fb_aper_addr(psp->tmr_bo); + psp_prep_tmr_cmd_buf(psp, cmd, tmr_mc_addr, psp->tmr_bo); if (psp->tmr_bo) dev_info(psp->adev->dev, "reserve 0x%lx from 0x%llx for PSP TMR\n", - amdgpu_bo_size(psp->tmr_bo), psp->tmr_mc_addr); + amdgpu_bo_size(psp->tmr_bo), tmr_mc_addr); ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h index 106d07aaf8e1..d3f5c17ead7e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h @@ -348,7 +348,6 @@ struct psp_context { /* tmr buffer */ struct amdgpu_bo *tmr_bo; - uint64_t tmr_mc_addr; /* asd firmware */ const struct firmware *asd_fw; -- 2.43.5
