[PATCH] drm/amdgpu: save the funcs of gfx software rings

Huang, Trigger Trigger.Huang at amd.com
Thu Aug 1 08:38:16 UTC 2024


[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Zhu, Jiadong <Jiadong.Zhu at amd.com>
> Sent: Thursday, August 1, 2024 3:58 PM
> To: Huang, Trigger <Trigger.Huang at amd.com>; amd-gfx at lists.freedesktop.org
> Cc: Huang, Trigger <Trigger.Huang at amd.com>
> Subject: RE: [PATCH] drm/amdgpu: save the funcs of gfx software rings
>
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> > -----Original Message-----
> > From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of
> > Trigger.Huang at amd.com
> > Sent: Thursday, August 1, 2024 3:27 PM
> > To: amd-gfx at lists.freedesktop.org
> > Cc: Huang, Trigger <Trigger.Huang at amd.com>
> > Subject: [PATCH] drm/amdgpu: save the funcs of gfx software rings
> >
> > From: Trigger Huang <Trigger.Huang at amd.com>
> >
> > Currently the funcs variable of a gfx software ring is not set. So if
> > it is visited somewhere, it will lead to error logic being executed.
> > For example, if we want to call some callbacks in funcs of a gfx
> > software ring, like per ring reset, it will be failed due to funcs is NULL.
> >
> > Signed-off-by: Trigger Huang <Trigger.Huang at amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c
> > index d234b7ccfaaf..4dad03a07492 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c
> > @@ -202,6 +202,7 @@ int amdgpu_ring_mux_add_sw_ring(struct
> > amdgpu_ring_mux *mux, struct amdgpu_ring
> >
> >       e = &mux->ring_entry[mux->num_ring_entries];
> >       ring->entry_index = mux->num_ring_entries;
> > +     ring->funcs = mux->real_ring->funcs;
>
> The ring functions are set in gfx_v9_0_set_ring_funcs, what is the case that
> funcs of software ring are not set while real ring's funcs are set.
> Otherwise, real_ring->funcs are not the same as software ring's.

Thanks for pointing out this. I just realized my mistake, that I am testing the per ring reset on the software ring, but I only set the reset callback for the real ring, while not for the sw ring, and that's why I saw NULL pointer of reset callback function when job timeout.

Let's drop this patch.

Thanks,
Trigger
>
> Thanks,
> Jiadong
>
> >       e->ring = ring;
> >
> >       INIT_LIST_HEAD(&e->list);
> > --
> > 2.34.1
>



More information about the amd-gfx mailing list