[AMD Official Use Only - General] Yeah, I agree. But I have no idea which place is better. Best, Zhenguo Cloud-GPU Core team, SRDC -----Original Message----- From: Koenig, Christian <Christian.Koenig@xxxxxxx> Sent: Tuesday, April 2, 2024 4:14 PM To: Yin, ZhenGuo (Chris) <ZhenGuo.Yin@xxxxxxx>; amd-gfx@xxxxxxxxxxxxxxxxxxxxx Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx> Subject: Re: [PATCH] drm/amdgpu: clear set_q_mode_offs when VM changed Am 02.04.24 um 08:37 schrieb ZhenGuo Yin: > [Why] > set_q_mode_offs don't get cleared after GPU reset, nexting SET_Q_MODE > packet to init shadow memory will be skiped, hence there has a page fault. > > [How] > VM flush is needed after GPU reset, clear set_q_mode_offs when > emitting VM flush. > > Fixes: 8dad9c062355 ("drm/amdgpu: workaround to avoid SET_Q_MODE > packets v2") > Signed-off-by: ZhenGuo Yin <zhenguo.yin@xxxxxxx> Good catch, yeah it probably doesn't make much sense to execute this after a VM flush. Reviewed-by: Christian König <christian.koenig@xxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c > b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c > index 7a906318e451..c11c6299711e 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c > @@ -5465,6 +5465,7 @@ static void gfx_v11_0_ring_emit_vm_flush(struct amdgpu_ring *ring, > /* Make sure that we can't skip the SET_Q_MODE packets when the VM > * changed in any way. > */ > + ring->set_q_mode_offs = 0; > ring->set_q_mode_ptr = NULL; > } >