]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: fix fence fallback timer expired error
authorSamuel Zhang <guoqing.zhang@amd.com>
Thu, 8 May 2025 06:36:35 +0000 (14:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Jun 2025 16:19:15 +0000 (12:19 -0400)
IH is not working after switching a new gpu index for the first time.

During VM resume, QEMU programming of VF MSIX table (register GFXMSIX_VECT0_ADDR_LO)
may not work.The access could be blocked by nBIF protection as VF isn't in
exclusive access mode. Exclusive access is enabled now, disable/enable MSIX
so that QEMU reprograms MSIX table.

call amdgpu_restore_msix on resume to restore msix table.

Signed-off-by: Samuel Zhang <guoqing.zhang@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h

index 13708dc7706a541baf87e0e216afd2b709c97dc9..b16f7c4beb22b9fd77fce0f7d1862fcb9b2f884b 100644 (file)
@@ -5109,6 +5109,13 @@ static inline int amdgpu_virt_resume(struct amdgpu_device *adev)
        int r;
        unsigned int prev_physical_node_id = adev->gmc.xgmi.physical_node_id;
 
+       /* During VM resume, QEMU programming of VF MSIX table (register GFXMSIX_VECT0_ADDR_LO)
+        * may not work. The access could be blocked by nBIF protection as VF isn't in
+        * exclusive access mode. Exclusive access is enabled now, disable/enable MSIX
+        * so that QEMU reprograms MSIX table.
+        */
+       amdgpu_restore_msix(adev);
+
        r = adev->gfxhub.funcs->get_xgmi_info(adev);
        if (r)
                return r;
index 5517451fc75d65e7d243d94918ddbc5f1134f2dd..56d973faca418a304445beaf1bd571b9af3d4077 100644 (file)
@@ -242,7 +242,7 @@ static bool amdgpu_msi_ok(struct amdgpu_device *adev)
        return true;
 }
 
-static void amdgpu_restore_msix(struct amdgpu_device *adev)
+void amdgpu_restore_msix(struct amdgpu_device *adev)
 {
        u16 ctrl;
 
index 04c0b4fa17a4e7bf9628c52f9d03cbcd443f81ee..9f0417456abda16cd562c330425a768f58ad2925 100644 (file)
@@ -146,5 +146,6 @@ void amdgpu_irq_gpu_reset_resume_helper(struct amdgpu_device *adev);
 int amdgpu_irq_add_domain(struct amdgpu_device *adev);
 void amdgpu_irq_remove_domain(struct amdgpu_device *adev);
 unsigned amdgpu_irq_create_mapping(struct amdgpu_device *adev, unsigned src_id);
+void amdgpu_restore_msix(struct amdgpu_device *adev);
 
 #endif