aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c
diff options
context:
space:
mode:
authorIcenowy Zheng <[email protected]>2023-10-08 06:46:49 +0000
committerAlex Deucher <[email protected]>2023-10-09 21:02:52 +0000
commit219223eca4d8b39486107c62a52c9667016aa3b9 (patch)
treee5db474b44b499c3eba4060d333bf6cd04d192e4 /drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c
parentdrm/amdgpu/discovery: enable DCN 3.5.0 support (diff)
downloadkernel-219223eca4d8b39486107c62a52c9667016aa3b9.tar.gz
kernel-219223eca4d8b39486107c62a52c9667016aa3b9.zip
drm/amdgpu: fix SI failure due to doorbells allocation
SI hardware does not have doorbells at all, however currently the code will try to do the allocation and thus fail, makes SI AMDGPU not usable. Fix this failure by skipping doorbells allocation when doorbells count is zero. Fixes: 54c30d2a8def ("drm/amdgpu: create kernel doorbell pages") Reviewed-by: Shashank Sharma <[email protected]> Signed-off-by: Icenowy Zheng <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c
index 16292d86e6aa..3f3662e8b871 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c
@@ -147,6 +147,10 @@ int amdgpu_doorbell_create_kernel_doorbells(struct amdgpu_device *adev)
int r;
int size;
+ /* SI HW does not have doorbells, skip allocation */
+ if (adev->doorbell.num_kernel_doorbells == 0)
+ return 0;
+
/* Reserve first num_kernel_doorbells (page-aligned) for kernel ops */
size = ALIGN(adev->doorbell.num_kernel_doorbells * sizeof(u32), PAGE_SIZE);