Commit acbbee01 authored by xinhui pan's avatar xinhui pan Committed by Alex Deucher

drm/amdgpu: handle ras resume

Suspend will put irq, so resume need get irq back.
And in the same time, skip other ras initialization.
Signed-off-by: default avatarxinhui pan <xinhui.pan@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9b54d201
...@@ -3549,6 +3549,9 @@ static int gfx_v9_0_ecc_late_init(void *handle) ...@@ -3549,6 +3549,9 @@ static int gfx_v9_0_ecc_late_init(void *handle)
return 0; return 0;
} }
if (*ras_if)
goto resume;
*ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL); *ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL);
if (!*ras_if) if (!*ras_if)
return -ENOMEM; return -ENOMEM;
...@@ -3573,7 +3576,7 @@ static int gfx_v9_0_ecc_late_init(void *handle) ...@@ -3573,7 +3576,7 @@ static int gfx_v9_0_ecc_late_init(void *handle)
r = amdgpu_ras_sysfs_create(adev, &fs_info); r = amdgpu_ras_sysfs_create(adev, &fs_info);
if (r) if (r)
goto sysfs; goto sysfs;
resume:
r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0); r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0);
if (r) if (r)
goto irq; goto irq;
......
...@@ -927,6 +927,9 @@ static int gmc_v9_0_ecc_late_init(void *handle) ...@@ -927,6 +927,9 @@ static int gmc_v9_0_ecc_late_init(void *handle)
amdgpu_ras_feature_enable(adev, &ras_block, 0); amdgpu_ras_feature_enable(adev, &ras_block, 0);
return 0; return 0;
} }
/* handle resume path. */
if (*ras_if)
goto resume;
*ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL); *ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL);
if (!*ras_if) if (!*ras_if)
...@@ -952,7 +955,7 @@ static int gmc_v9_0_ecc_late_init(void *handle) ...@@ -952,7 +955,7 @@ static int gmc_v9_0_ecc_late_init(void *handle)
r = amdgpu_ras_sysfs_create(adev, &fs_info); r = amdgpu_ras_sysfs_create(adev, &fs_info);
if (r) if (r)
goto sysfs; goto sysfs;
resume:
r = amdgpu_irq_get(adev, &adev->gmc.ecc_irq, 0); r = amdgpu_irq_get(adev, &adev->gmc.ecc_irq, 0);
if (r) if (r)
goto irq; goto irq;
......
...@@ -1522,6 +1522,10 @@ static int sdma_v4_0_late_init(void *handle) ...@@ -1522,6 +1522,10 @@ static int sdma_v4_0_late_init(void *handle)
return 0; return 0;
} }
/* handle resume path. */
if (*ras_if)
goto resume;
*ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL); *ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL);
if (!*ras_if) if (!*ras_if)
return -ENOMEM; return -ENOMEM;
...@@ -1546,7 +1550,7 @@ static int sdma_v4_0_late_init(void *handle) ...@@ -1546,7 +1550,7 @@ static int sdma_v4_0_late_init(void *handle)
r = amdgpu_ras_sysfs_create(adev, &fs_info); r = amdgpu_ras_sysfs_create(adev, &fs_info);
if (r) if (r)
goto sysfs; goto sysfs;
resume:
r = amdgpu_irq_get(adev, &adev->sdma.ecc_irq, AMDGPU_SDMA_IRQ_ECC0); r = amdgpu_irq_get(adev, &adev->sdma.ecc_irq, AMDGPU_SDMA_IRQ_ECC0);
if (r) if (r)
goto irq; goto irq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment