]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu:fix random missing of FLR NOTIFY
authorMonk Liu <Monk.Liu@amd.com>
Tue, 24 Oct 2017 07:10:11 +0000 (15:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2018 08:09:55 +0000 (09:09 +0100)
[ Upstream commit 34a4d2bf06b3ab92024b8e26d6049411369d1f1a ]

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c

index b4906d2f30d3eef8b00f4aa21398918d81b3a76a..0031f8f34db551b69d2cab99b22d3d1b009b9112 100644 (file)
@@ -282,9 +282,17 @@ static int xgpu_ai_mailbox_rcv_irq(struct amdgpu_device *adev,
                /* see what event we get */
                r = xgpu_ai_mailbox_rcv_msg(adev, IDH_FLR_NOTIFICATION);
 
-               /* only handle FLR_NOTIFY now */
-               if (!r)
-                       schedule_work(&adev->virt.flr_work);
+               /* sometimes the interrupt is delayed to inject to VM, so under such case
+                * the IDH_FLR_NOTIFICATION is overwritten by VF FLR from GIM side, thus
+                * above recieve message could be failed, we should schedule the flr_work
+                * anyway
+                */
+               if (r) {
+                       DRM_ERROR("FLR_NOTIFICATION is missed\n");
+                       xgpu_ai_mailbox_send_ack(adev);
+               }
+
+               schedule_work(&adev->virt.flr_work);
        }
 
        return 0;