drm/amdgpu/mes: Fix hung_queue_db_array loop limit for multi-XCC
Subsystems (2)
PATCH 1/1 drm/amdgpu/mes: Fix hung_queue_db_array loop limit for multi-XCC
The loop iterated only AMDGPU_MAX_MES_PIPES times, leaving entries uninitialized for multi-XCC GPUs. This causes null pointer dereferences when accessing arrays indexed by XCC ID >= 2. Extend the loop to cover all XCCs (AMDGPU_MAX_MES_PIPES * num_xcc), matching other per-XCC arrays.
Fixes 723b3bc87afb ("drm/amdgpu: Fixup boost mes detect hang array size")
Signed-off-by Geoffrey McRae <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>
Cc Amber Lin <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1 -1
@@ -237,7 +237,7 @@ int amdgpu_mes_init(struct amdgpu_device *adev) }if (adev->mes.hung_queue_db_array_size) { -for (i =0 ; i <AMDGPU_MAX_MES_PIPES ; i++) { +for (i =0 ; i <AMDGPU_MAX_MES_PIPES * num_xcc; i++) { r = amdgpu_bo_create_kernel(adev, adev->mes.hung_queue_db_array_size * sizeof(u32), PAGE_SIZE,
Signature · 1 line
2.43.0
Reviewed-by Amber Lin <[email protected]>
Quoted 28 lines · Geoffrey McRae
The loop iterated only
AMDGPU_MAX_MES_PIPEStimes, leaving entries uninitialized for multi-XCC GPUs. This causes null pointer dereferences when accessing arrays indexed by XCC ID >= 2. Extend the loop to cover all XCCs (AMDGPU_MAX_MES_PIPES*num_xcc), matching other per-XCC arrays.Fixes 723b3bc87afb ("drm/amdgpu: Fixup boost mes detect hang array size")Signed-off-by Geoffrey McRae <[email protected]>Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Cc Amber Lin <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1
-1@@ -237,7 +237,7 @@ int amdgpu_mes_init(struct amdgpu_device *adev) }if (adev->mes.hung_queue_db_array_size) { -for (i =0 ; i <AMDGPU_MAX_MES_PIPES ; i++) { +for (i =0 ; i <AMDGPU_MAX_MES_PIPES * num_xcc; i++) { r = amdgpu_bo_create_kernel(adev, adev->mes.hung_queue_db_array_size * sizeof(u32), PAGE_SIZE,