drm/amdgpu: add RAS poison consumption handler for AI SRIOV
authorTao Zhou <tao.zhou1@amd.com>
Fri, 29 Jul 2022 08:32:05 +0000 (16:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Dec 2022 17:18:19 +0000 (12:18 -0500)
Send message to host and host will handle it.

v2: split the patch into two parts, one is for mxgpu ai and another one
is for common poison consumption handler.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h

index 2b9d806e23afb4b28ea5d7a8613257a876ddd477..b9e9480448afe9e56324daf866deb77eb2d34063 100644 (file)
@@ -88,6 +88,7 @@ struct amdgpu_virt_ops {
        int (*wait_reset)(struct amdgpu_device *adev);
        void (*trans_msg)(struct amdgpu_device *adev, enum idh_request req,
                          u32 data1, u32 data2, u32 data3);
+       void (*ras_poison_handler)(struct amdgpu_device *adev);
 };
 
 /*
index 12906ba74462fb65669392bc826663e8fbb60d09..63725b2ebc03733f607aaf9dd9f8a649f75d2dae 100644 (file)
@@ -404,6 +404,11 @@ static int xgpu_ai_request_init_data(struct amdgpu_device *adev)
        return xgpu_ai_send_access_requests(adev, IDH_REQ_GPU_INIT_DATA);
 }
 
+static void xgpu_ai_ras_poison_handler(struct amdgpu_device *adev)
+{
+       xgpu_ai_send_access_requests(adev, IDH_RAS_POISON);
+}
+
 const struct amdgpu_virt_ops xgpu_ai_virt_ops = {
        .req_full_gpu   = xgpu_ai_request_full_gpu_access,
        .rel_full_gpu   = xgpu_ai_release_full_gpu_access,
@@ -411,4 +416,5 @@ const struct amdgpu_virt_ops xgpu_ai_virt_ops = {
        .wait_reset = NULL,
        .trans_msg = xgpu_ai_mailbox_trans_msg,
        .req_init_data  = xgpu_ai_request_init_data,
+       .ras_poison_handler = xgpu_ai_ras_poison_handler,
 };
index fa7e13e0459ee3e664e2e3781d05d0faadde7422..af1a784696bd25d2738f4480f3d45833e31b0968 100644 (file)
@@ -39,6 +39,7 @@ enum idh_request {
 
        IDH_LOG_VF_ERROR       = 200,
        IDH_READY_TO_RESET      = 201,
+       IDH_RAS_POISON  = 202,
 };
 
 enum idh_event {