]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: fix SI failure due to doorbells allocation
authorIcenowy Zheng <uwu@icenowy.me>
Sun, 8 Oct 2023 06:46:49 +0000 (14:46 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 9 Oct 2023 21:02:52 +0000 (17:02 -0400)
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 <shashank.sharma@amd.com>
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c

index 16292d86e6aae31476bf0e2874dfb429336c695c..3f3662e8b871032c21e1c02e308b78515cfc05c3 100644 (file)
@@ -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);