]> www.infradead.org Git - nvme.git/commitdiff
drm/amdgpu: add ras POSION_CREATION event id support
authorYang Wang <kevinyang.wang@amd.com>
Thu, 27 Jun 2024 03:43:09 +0000 (11:43 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Jul 2024 20:55:18 +0000 (16:55 -0400)
add amdgpu ras POSION_CREATION event id support.

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-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_ras.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h

index 36917e4e3b194ae06c1bba70242d087c08a11774..ff90b8e4bc29b92deaab26386961271c42fa9da8 100644 (file)
@@ -2116,8 +2116,17 @@ static void amdgpu_ras_interrupt_poison_consumption_handler(struct ras_manager *
 static void amdgpu_ras_interrupt_poison_creation_handler(struct ras_manager *obj,
                                struct amdgpu_iv_entry *entry)
 {
-       dev_info(obj->adev->dev,
-               "Poison is created\n");
+       struct amdgpu_device *adev = obj->adev;
+       enum ras_event_type type = RAS_EVENT_TYPE_POISON_CREATION;
+       u64 event_id;
+       int ret;
+
+       ret = amdgpu_ras_mark_ras_event(adev, type);
+       if (ret)
+               return;
+
+       event_id = amdgpu_ras_acquire_event_id(adev, type);
+       RAS_EVENT_LOG(adev, event_id, "Poison is created\n");
 
        if (amdgpu_ip_version(obj->adev, UMC_HWIP, 0) >= IP_VERSION(12, 0, 0)) {
                struct amdgpu_ras *con = amdgpu_ras_get_context(obj->adev);
@@ -2889,6 +2898,7 @@ static int amdgpu_ras_poison_creation_handler(struct amdgpu_device *adev,
        uint32_t new_detect_count, total_detect_count;
        uint32_t need_query_count = poison_creation_count;
        bool query_data_timeout = false;
+       enum ras_event_type type = RAS_EVENT_TYPE_POISON_CREATION;
 
        memset(&info, 0, sizeof(info));
        info.head.block = AMDGPU_RAS_BLOCK__UMC;
@@ -2896,7 +2906,7 @@ static int amdgpu_ras_poison_creation_handler(struct amdgpu_device *adev,
        ecc_log = &ras->umc_ecc_log;
        total_detect_count = 0;
        do {
-               ret = amdgpu_ras_query_error_status(adev, &info);
+               ret = amdgpu_ras_query_error_status_with_event(adev, &info, type);
                if (ret)
                        return ret;
 
@@ -3975,6 +3985,7 @@ u64 amdgpu_ras_acquire_event_id(struct amdgpu_device *adev, enum ras_event_type
 
        switch (type) {
        case RAS_EVENT_TYPE_FATAL:
+       case RAS_EVENT_TYPE_POISON_CREATION:
                event_mgr = __get_ras_event_mgr(adev);
                if (!event_mgr)
                        return RAS_EVENT_INVALID_ID;
index 7c20def1c4f0f8d65a02bb331b32c4b9ae22e2c3..cc7a9be4fc1aa79fd545926ef841a8f5709af661 100644 (file)
@@ -435,6 +435,7 @@ struct umc_ecc_info {
 enum ras_event_type {
        RAS_EVENT_TYPE_INVALID = 0,
        RAS_EVENT_TYPE_FATAL,
+       RAS_EVENT_TYPE_POISON_CREATION,
        RAS_EVENT_TYPE_COUNT,
 };