drm/amdgpu: save the funcs of gfx software rings
Subsystems (2)
PATCH 1/1 drm/amdgpu: save the funcs of gfx software rings
From: Trigger Huang <[email protected]>
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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c +1 -0
@@ -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; e->ring = ring;INIT_LIST_HEAD (&e->list);
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Quoted 28 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of [email protected]
Sent: Thursday, August 1, 2024 3:27 PM
To: [email protected]
Cc: Huang, Trigger <[email protected]>
Subject: [PATCH] drm/amdgpu: save the funcs of gfx software ringsFrom: Trigger Huang <[email protected]>
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 <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c +0
-0@@ -202,6 +202,7 @@ int amdgpu_ring_mux_add_sw_ring(struct
amdgpu_ring_mux*mux, structamdgpu_ring
Quoted 3 lines
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,
Jiadong
Quoted 5 lines
e->ring = ring; INIT_LIST_HEAD(&e->list);--
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Quoted 37 lines
-----Original Message-----
From: Zhu, Jiadong <[email protected]>
Sent: Thursday, August 1, 2024 3:58 PM
To: Huang, Trigger <[email protected]>; [email protected]
Cc: Huang, Trigger <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: save the funcs of gfx software rings[AMD Official Use Only - AMD Internal Distribution Only]
Quoted 28 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of [email protected]
Sent: Thursday, August 1, 2024 3:27 PM
To: [email protected]
Cc: Huang, Trigger <[email protected]>
Subject: [PATCH] drm/amdgpu: save the funcs of gfx software ringsFrom: Trigger Huang <[email protected]>
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 <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c +0
-0@@ -202,6 +202,7 @@ int amdgpu_ring_mux_add_sw_ring(struct
amdgpu_ring_mux*mux, structamdgpu_ring
Quoted 7 lines
Quoted 3 lines
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->funcsare 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
Quoted 10 lines
Thanks,
JiadongQuoted 5 lines
e->ring = ring; INIT_LIST_HEAD(&e->list);--
2.34.1