On 2/7/2025 12:14 PM, Jiang Liu wrote: > As pwfw resets entrycount when device is suspended, so we should > accmulate the gfx_off_entrycount value instead of save the last value > of it. > > Signed-off-by: Jiang Liu <gerry@xxxxxxxxxxxxxxxxx> > --- > drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > index ed9dac00ebfb..70a5ab649e5f 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > @@ -2134,12 +2134,12 @@ static int smu_suspend(struct amdgpu_ip_block *ip_block) > smu_set_gfx_cgpg(smu, false); > > /* > - * pwfw resets entrycount when device is suspended, so we save the > - * last value to be used when we resume to keep it consistent > + * pwfw resets entrycount when device is suspended, so we accumulate > + * the `gfx_off_entrycount` value. > */ > ret = smu_get_entrycount_gfxoff(smu, &count); > if (!ret) > - adev->gfx.gfx_off_entrycount = count; > + adev->gfx.gfx_off_entrycount += count; This is slightly misleading - only Vangogh implements get_gfx_off_entrycount and its implementation, vangogh_get_gfxoff_entrycount, is already doing something like this - *entrycount = value + adev->gfx.gfx_off_entrycount; Thanks, Lijo > > /* clear this on suspend so it will get reprogrammed on resume */ > smu->workload_mask = 0;