drm/amdgpu: sdma support ras gpu reset
authorxinhui pan <xinhui.pan@amd.com>
Wed, 8 May 2019 14:38:37 +0000 (22:38 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:20:50 +0000 (12:20 -0500)
request a gpu reset if ras return EAGAIN.
we will run late init again so it is ok to do nothing this time.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c

index 9c88ce513d78e98642522f77820ed224a43fde5b..65775964efd37249f6b68942e130c3da63d6face 100644 (file)
@@ -1531,8 +1531,14 @@ static int sdma_v4_0_late_init(void *handle)
        **ras_if = ras_block;
 
        r = amdgpu_ras_feature_enable_on_boot(adev, *ras_if, 1);
-       if (r)
+       if (r) {
+               if (r == -EAGAIN) {
+                       amdgpu_ras_request_reset_on_boot(adev,
+                                       AMDGPU_RAS_BLOCK__SDMA);
+                       r = 0;
+               }
                goto feature;
+       }
 
        ih_info.head = **ras_if;
        fs_info.head = **ras_if;
@@ -1571,7 +1577,7 @@ interrupt:
 feature:
        kfree(*ras_if);
        *ras_if = NULL;
-       return -EINVAL;
+       return r;
 }
 
 static int sdma_v4_0_sw_init(void *handle)