Re: [v3 5/6] drm/amdgpu: fix invalid memory access in amdgpu_fence_driver_sw_fini()

2025-01-09 Thread Christian König
Am 08.01.25 um 17:30 schrieb Chen, Xiaogang: On 1/8/2025 3:16 AM, Christian König wrote: Am 08.01.25 um 09:56 schrieb Jiang Liu: Function detects initialization status by checking sched->ops, Where is that done? Inside the scheduler or inside amdgpu? Inside amdgpu set ring->sched.ops to null

Re: [v3 5/6] drm/amdgpu: fix invalid memory access in amdgpu_fence_driver_sw_fini()

2025-01-08 Thread Chen, Xiaogang
On 1/8/2025 3:16 AM, Christian König wrote: Am 08.01.25 um 09:56 schrieb Jiang Liu: Function detects initialization status by checking sched->ops, Where is that done? Inside the scheduler or inside amdgpu? Inside amdgpu set ring->sched.ops to null if ring's scheduler init fail since we use

Re: [v3 5/6] drm/amdgpu: fix invalid memory access in amdgpu_fence_driver_sw_fini()

2025-01-08 Thread Lazar, Lijo
On 1/8/2025 2:46 PM, Christian König wrote: > Am 08.01.25 um 09:56 schrieb Jiang Liu: >> Function detects initialization status by checking sched->ops, > > Where is that done? Inside the scheduler or inside amdgpu? Down below inside amdgpu_fence_driver_sw_fini(). I think sched.ready is repurpo

Re: [v3 5/6] drm/amdgpu: fix invalid memory access in amdgpu_fence_driver_sw_fini()

2025-01-08 Thread Christian König
Am 08.01.25 um 09:56 schrieb Jiang Liu: Function detects initialization status by checking sched->ops, Where is that done? Inside the scheduler or inside amdgpu? Regards, Christian. so set sched->ops to non-NULL just before return in function amdgpu_fence_driver_sw_fini() and amdgpu_device

[v3 5/6] drm/amdgpu: fix invalid memory access in amdgpu_fence_driver_sw_fini()

2025-01-08 Thread Jiang Liu
Function detects initialization status by checking sched->ops, so set sched->ops to non-NULL just before return in function amdgpu_fence_driver_sw_fini() and amdgpu_device_init_schedulers() to avoid possible invalid memory access on error recover path. Signed-off-by: Jiang Liu --- drivers/gpu/dr