]> git.baikalelectronics.ru Git - kernel.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)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 4 Dec 2017 21:41:32 +0000 (16:41 -0500)
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>
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c

index c32d0b0868e8056263432541c4e6acc1ff532b39..d31259e5bb45bed7aebcf37cf722589dc4da3b33 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;