]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: fix find ras error node error
authorYang Wang <kevinyang.wang@amd.com>
Fri, 20 Oct 2023 02:12:07 +0000 (10:12 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 Oct 2023 22:41:21 +0000 (18:41 -0400)
the origin function might return the wrong node.

Fixes: 5b1270beb380 ("drm/amdgpu: add ras_err_info to identify RAS error source")
Signed-off-by: Yang Wang <kevinyang.wang@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

index 3c83a2b8fb2c3689f2c12ca4ea4e8afe28d205ed..88e1b47c3d3faf01e319d819578bbf93698e2002 100644 (file)
@@ -3529,11 +3529,10 @@ static struct ras_err_node *amdgpu_ras_error_find_node_by_id(struct ras_err_data
 
        for_each_ras_error(err_node, err_data) {
                ref_id = &err_node->err_info.mcm_info;
-               if ((mcm_info->socket_id >= 0 && mcm_info->socket_id != ref_id->socket_id) ||
-                   (mcm_info->die_id >= 0 && mcm_info->die_id != ref_id->die_id))
-                       continue;
 
-               return err_node;
+               if (mcm_info->socket_id == ref_id->socket_id &&
+                   mcm_info->die_id == ref_id->die_id)
+                       return err_node;
        }
 
        return NULL;