drm/amdgpu: Add IDH_QUERY_ALIVE event for SR-IOV
authorTrigger Huang <Trigger.Huang@amd.com>
Tue, 30 Apr 2019 08:23:29 +0000 (16:23 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 6 May 2019 14:36:48 +0000 (09:36 -0500)
SR-IOV host side will send IDH_QUERY_ALIVE to guest VM to check
if this guest VM is still alive (not destroyed). The only thing
guest KMD need to do is to send ACK back to host.

Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h

index 8dbad496b29f2a3ab829650d9f50ac172f3aa9dd..2471e7cf75eac4cd565b1e0b070f862dc3b9c444 100644 (file)
@@ -372,6 +372,9 @@ static int xgpu_ai_mailbox_rcv_irq(struct amdgpu_device *adev,
                if (amdgpu_sriov_runtime(adev))
                        schedule_work(&adev->virt.flr_work);
                break;
+               case IDH_QUERY_ALIVE:
+                       xgpu_ai_mailbox_send_ack(adev);
+                       break;
                /* READY_TO_ACCESS_GPU is fetched by kernel polling, IRQ can ignore
                 * it byfar since that polling thread will handle it,
                 * other msg like flr complete is not handled here.
index 39d151b791533cc423e0216c169779f017ef2d4b..077e91a33d62d632c48c0eed5ddf0b3a997be676 100644 (file)
@@ -49,6 +49,7 @@ enum idh_event {
        IDH_FLR_NOTIFICATION_CMPL,
        IDH_SUCCESS,
        IDH_FAIL,
+       IDH_QUERY_ALIVE,
        IDH_EVENT_MAX
 };