drm/amdgpu/gmc7: fix wait_for_idle callers
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu/gmc7: fix wait_for_idle callers
The wait_for_idle signature was changed, but the callers were not.
--- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +14 -4
@@ -87,9 +87,14 @@ static void gmc_v7_0_init_golden_registers(struct amdgpu_device *adev)static void gmc_v7_0_mc_stop (struct amdgpu_device *adev) { +struct amdgpu_ip_block *ip_block;u32 blackout; -gmc_v7_0_wait_for_idle ((void *)adev); + ip_block =amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_GMC ); +if (!ip_block) +return ; + +gmc_v7_0_wait_for_idle (ip_block); blackout =RREG32 (mmMC_SHARED_BLACKOUT_CNTL);if (REG_GET_FIELD (blackout,MC_SHARED_BLACKOUT_CNTL ,BLACKOUT_MODE ) !=1 ) {
@@ -251,9 +256,14 @@ static void gmc_v7_0_vram_gtt_location(struct amdgpu_device *adev,*/ static void gmc_v7_0_mc_program (struct amdgpu_device *adev) { +struct amdgpu_ip_block *ip_block;u32 tmp;int i, j; + ip_block =amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_GMC ); +if (!ip_block) +return ; +/* Initialize HDP */ for (i =0 , j =0 ; i <32 ; i++, j +=0x6 ) {WREG32 ((0xb05 + j),0x00000000 );
@@ -264,7 +274,7 @@ static void gmc_v7_0_mc_program(struct amdgpu_device *adev) }WREG32 (mmHDP_REG_COHERENCY_FLUSH_CNTL,0 ); -if (gmc_v7_0_wait_for_idle ((void *)adev)) +if (gmc_v7_0_wait_for_idle (ip_block))dev_warn (adev->dev,"Wait for MC idle timedout !\n" );if (adev->mode_info.num_crtc) {
@@ -288,7 +298,7 @@ static void gmc_v7_0_mc_program(struct amdgpu_device *adev)WREG32 (mmMC_VM_AGP_BASE,0 );WREG32 (mmMC_VM_AGP_TOP, adev->gmc.agp_end >>22 );WREG32 (mmMC_VM_AGP_BOT, adev->gmc.agp_start >>22 ); -if (gmc_v7_0_wait_for_idle ((void *)adev)) +if (gmc_v7_0_wait_for_idle (ip_block))dev_warn (adev->dev,"Wait for MC idle timedout !\n" );WREG32 (mmBIF_FB_EN,BIF_FB_EN__FB_READ_EN_MASK |BIF_FB_EN__FB_WRITE_EN_MASK );
@@ -1183,7 +1193,7 @@ static int gmc_v7_0_soft_reset(struct amdgpu_ip_block *ip_block)if (srbm_soft_reset) {gmc_v7_0_mc_stop (adev); -if (gmc_v7_0_wait_for_idle ((void *)adev)) +if (gmc_v7_0_wait_for_idle (ip_block))dev_warn (adev->dev,"Wait for GMC idle timed out !\n" ); tmp =RREG32 (mmSRBM_SOFT_RESET);
Signature · 1 line
2.47.0
Quoted 36 lines · Alex Deucher
The
wait_for_idlesignature was changed, but the callers were not.Reported-by Michel Dänzer <[email protected]>Fixes 82ae6619a450 ("drm/amdgpu: update the handle ptr in wait_for_idle")Signed-off-by Alex Deucher <[email protected]>Cc Sunil Khatri <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +7
-1@@ -87,9 +87,14 @@ static void gmc_v7_0_init_golden_registers(struct amdgpu_device *adev)static void gmc_v7_0_mc_stop (struct amdgpu_device *adev) { +struct amdgpu_ip_block *ip_block;u32 blackout; -gmc_v7_0_wait_for_idle ((void *)adev); + ip_block =amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_GMC ); +if (!ip_block) +return ; + +gmc_v7_0_wait_for_idle (ip_block); blackout =RREG32 (mmMC_SHARED_BLACKOUT_CNTL);if (REG_GET_FIELD (blackout,MC_SHARED_BLACKOUT_CNTL ,BLACKOUT_MODE ) !=1 ) {@@ -251,9 +256,14 @@ static void gmc_v7_0_vram_gtt_location(struct amdgpu_device *adev,*/ static void gmc_v7_0_mc_program (struct amdgpu_device *adev) { +struct amdgpu_ip_block *ip_block;
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c static void gmc_v7_0_vram_gtt_location(struct amdgpu_device *adev, · line 269
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +4
-0u32 tmp;int i, j; + ip_block =amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_GMC ); +if (!ip_block) +return ; +/* Initialize HDP */ for (i =0 , j =0 ; i <32 ; i++, j +=0x6 ) {WREG32 ((0xb05 + j),0x00000000 );
Seems simpler to make gmc_v7_0_mc_stop & gmc_v7_0_mc_program take ip_block instead of adev as well (and fix up the comment before gmc_v7_0_mc_program).
Signature · 2 lines
Earthling Michel Dänzer \ GNOME / Xwayland / Mesa developer https://redhat.com \ Libre software enthusiast
Khatri, Sunil
Reviewed-byQuoted 51 lines · Michel Dänzer
Quoted 36 lines · Alex Deucher
The
wait_for_idlesignature was changed, but the callers were not.Reported-by Michel Dänzer <[email protected]>Fixes 82ae6619a450 ("drm/amdgpu: update the handle ptr in wait_for_idle")Signed-off-by Alex Deucher <[email protected]>Cc Sunil Khatri <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +7
-1@@ -87,9 +87,14 @@ static void gmc_v7_0_init_golden_registers(struct amdgpu_device *adev)static void gmc_v7_0_mc_stop (struct amdgpu_device *adev) { +struct amdgpu_ip_block *ip_block;u32 blackout; -gmc_v7_0_wait_for_idle ((void *)adev); + ip_block =amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_GMC ); +if (!ip_block) +return ; + +gmc_v7_0_wait_for_idle (ip_block); blackout =RREG32 (mmMC_SHARED_BLACKOUT_CNTL);if (REG_GET_FIELD (blackout,MC_SHARED_BLACKOUT_CNTL ,BLACKOUT_MODE ) !=1 ) {@@ -251,9 +256,14 @@ static void gmc_v7_0_vram_gtt_location(struct amdgpu_device *adev,*/ static void gmc_v7_0_mc_program (struct amdgpu_device *adev) { +struct amdgpu_ip_block *ip_block;drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c static void gmc_v7_0_vram_gtt_location(struct amdgpu_device *adev, · line 269
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +4
-0u32 tmp;int i, j; + ip_block =amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_GMC ); +if (!ip_block) +return ; +/* Initialize HDP */ for (i =0 , j =0 ; i <32 ; i++, j +=0x6 ) {WREG32 ((0xb05 + j),0x00000000 );Seems simpler to make
gmc_v7_0_mc_stop&gmc_v7_0_mc_programtakeip_blockinstead of adev as well (and fix up the comment beforegmc_v7_0_mc_program). We have changed the signature of the functions which are part of theamdgpu_ip_functionsand not for all. The existing change look good to me the way it is.
Quoted 41 lines · Michel Dänzer
Quoted 39 lines · Alex Deucher
The
wait_for_idlesignature was changed, but the callers were not.Reported-by Michel Dänzer <[email protected]>Fixes 82ae6619a450 ("drm/amdgpu: update the handle ptr in wait_for_idle")Signed-off-by Alex Deucher <[email protected]>Cc Sunil Khatri <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +7
-1@@ -87,9 +87,14 @@ static void gmc_v7_0_init_golden_registers(struct amdgpu_device *adev)static void gmc_v7_0_mc_stop (struct amdgpu_device *adev) { +struct amdgpu_ip_block *ip_block;u32 blackout; -gmc_v7_0_wait_for_idle ((void *)adev); + ip_block =amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_GMC ); +if (!ip_block) +return ; + +gmc_v7_0_wait_for_idle (ip_block); blackout =RREG32 (mmMC_SHARED_BLACKOUT_CNTL);if (REG_GET_FIELD (blackout,MC_SHARED_BLACKOUT_CNTL ,BLACKOUT_MODE ) !=1 ) {@@ -251,9 +256,14 @@ static void gmc_v7_0_vram_gtt_location(struct amdgpu_device *adev,*/ static void gmc_v7_0_mc_program (struct amdgpu_device *adev) { +struct amdgpu_ip_block *ip_block;u32 tmp;int i, j;
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c static void gmc_v7_0_vram_gtt_location(struct amdgpu_device *adev, · line 269
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +4
-0+ ip_block =amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_GMC ); +if (!ip_block) +return ; +/* Initialize HDP */ for (i =0 , j =0 ; i <32 ; i++, j +=0x6 ) {WREG32 ((0xb05 + j),0x00000000 );Seems simpler to make
gmc_v7_0_mc_stop&gmc_v7_0_mc_programtakeip_blockinstead of adev as well (and fix up the comment beforegmc_v7_0_mc_program).
I thought about that, but this keeps it consistent with the other gmc files and I'd like to keep the ip_block to the IP level functions.
Alex
Quoted 5 lines
--
Earthling Michel Dänzer \ GNOME / Xwayland / Mesa developer
https://redhat.com \ Libre software enthusiast