Suspend will put irq, so resume need get irq back.
And in the same time, skip other ras initialization.
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
return 0;
}
+ if (*ras_if)
+ goto resume;
+
*ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL);
if (!*ras_if)
return -ENOMEM;
r = amdgpu_ras_sysfs_create(adev, &fs_info);
if (r)
goto sysfs;
-
+resume:
r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0);
if (r)
goto irq;
amdgpu_ras_feature_enable(adev, &ras_block, 0);
return 0;
}
+ /* handle resume path. */
+ if (*ras_if)
+ goto resume;
*ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL);
if (!*ras_if)
r = amdgpu_ras_sysfs_create(adev, &fs_info);
if (r)
goto sysfs;
-
+resume:
r = amdgpu_irq_get(adev, &adev->gmc.ecc_irq, 0);
if (r)
goto irq;
return 0;
}
+ /* handle resume path. */
+ if (*ras_if)
+ goto resume;
+
*ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL);
if (!*ras_if)
return -ENOMEM;
r = amdgpu_ras_sysfs_create(adev, &fs_info);
if (r)
goto sysfs;
-
+resume:
r = amdgpu_irq_get(adev, &adev->sdma.ecc_irq, AMDGPU_SDMA_IRQ_ECC0);
if (r)
goto irq;