drm/amdgpu: Commit CPER entry
authorXiang Liu <xiang.liu@amd.com>
Wed, 12 Feb 2025 12:17:11 +0000 (20:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Feb 2025 19:09:30 +0000 (14:09 -0500)
Commit the CPER entry to the ring buffer.

Signed-off-by: Xiang Liu <xiang.liu@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c

index 57775546e64befdee5d217bb004f5e2d67d65be9..26e0655e7ed49332dbba7d5cdb9f412a5e00051f 100644 (file)
@@ -280,6 +280,7 @@ int amdgpu_cper_generate_ue_record(struct amdgpu_device *adev,
 {
        struct cper_hdr *fatal = NULL;
        struct cper_sec_crashdump_reg_data reg_data = { 0 };
+       struct amdgpu_ring *ring = &adev->cper.ring_buf;
        int ret;
 
        fatal = amdgpu_cper_alloc_entry(adev, AMDGPU_CPER_TYPE_FATAL, 1);
@@ -302,7 +303,7 @@ int amdgpu_cper_generate_ue_record(struct amdgpu_device *adev,
        if (ret)
                return ret;
 
-       /*TODO: commit the cper entry to cper ring */
+       amdgpu_cper_ring_write(ring, fatal, fatal->record_length);
 
        return 0;
 }
@@ -329,6 +330,7 @@ int amdgpu_cper_generate_ce_records(struct amdgpu_device *adev,
 {
        struct cper_hdr *corrected = NULL;
        enum cper_error_severity sev = CPER_SEV_NON_FATAL_CORRECTED;
+       struct amdgpu_ring *ring = &adev->cper.ring_buf;
        uint32_t reg_data[CPER_ACA_REG_COUNT] = { 0 };
        struct aca_bank_node *node;
        struct aca_bank *bank;
@@ -377,7 +379,7 @@ int amdgpu_cper_generate_ce_records(struct amdgpu_device *adev,
                        return ret;
        }
 
-       /*TODO: commit the cper entry to cper ring */
+       amdgpu_cper_ring_write(ring, corrected, corrected->record_length);
 
        return 0;
 }