On Wed, Nov 20, 2024 at 4:21 AM Michel Dänzer <michel@xxxxxxxxxxx> wrote: > > On 2024-11-19 20:23, Alex Deucher wrote: > > The wait_for_idle signature was changed, but the callers > > were not. > > > > Reported-by: Michel Dänzer <michel@xxxxxxxxxxx> > > Fixes: 82ae6619a450 ("drm/amdgpu: update the handle ptr in wait_for_idle") > > Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> > > Cc: Sunil Khatri <sunil.khatri@xxxxxxx> > > --- > > drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 18 ++++++++++++++---- > > 1 file changed, 14 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c > > index 8f6f2f067641..347bccd92696 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c > > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c > > @@ -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); > > 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). 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 > > > -- > Earthling Michel Dänzer \ GNOME / Xwayland / Mesa developer > https://redhat.com \ Libre software enthusiast