drm/amdgpu: do not create ras debugfs/sysfs node for ASICs that don't have ras ability
authorHawking Zhang <Hawking.Zhang@amd.com>
Thu, 18 Jul 2019 04:49:15 +0000 (12:49 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Jul 2019 19:18:07 +0000 (14:18 -0500)
driver shouldn't init any ras debugfs/sysfs node for ASICs that don't have ras
hardware ability

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index 1a4412e47810256727036fdf21ab90ebb80d090e..3a9ece450b319d52d3381d0a041d2444b96c88b9 100644 (file)
@@ -1557,6 +1557,12 @@ int amdgpu_ras_init(struct amdgpu_device *adev)
 
        amdgpu_ras_check_supported(adev, &con->hw_supported,
                        &con->supported);
+       if (!con->hw_supported) {
+               amdgpu_ras_set_context(adev, NULL);
+               kfree(con);
+               return 0;
+       }
+
        con->features = 0;
        INIT_LIST_HEAD(&con->head);
        /* Might need get this flag from vbios. */