drm/amdgpu: Protect the amdgpu_bo_list list with a mutex v2
authorLuben Tuikov <luben.tuikov@amd.com>
Wed, 20 Jul 2022 19:04:18 +0000 (15:04 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 Jul 2022 20:03:41 +0000 (16:03 -0400)
commit5df79aeb6e0890d6f5fd6e12c7ad238a1617b210
tree3b539cca9656dc74c0305863aa4c9ee1a3920faa
parent4528c18605654bea022d294c9ba2e93600d05a94
drm/amdgpu: Protect the amdgpu_bo_list list with a mutex v2

Protect the struct amdgpu_bo_list with a mutex. This is used during command
submission in order to avoid buffer object corruption as recorded in
the link below.

v2 (chk): Keep the mutex looked for the whole CS to avoid using the
  list from multiple CS threads at the same time.

Suggested-by: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <Alexander.Deucher@amd.com>
Cc: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Cc: Vitaly Prosyak <Vitaly.Prosyak@amd.com>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2048
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: Luben Tuikov <luben.tuikov@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c