diff options
author | xinhui pan <xinhui.pan@amd.com> | 2019-03-07 10:46:54 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-19 15:36:51 -0500 |
commit | acbbee015b017e8a07cff1b0f58b41c953fd9a56 (patch) | |
tree | e775f4500fa9815edb47256d8cc8955d838b1c8b /drivers/gpu/drm/amd/amdgpu | |
parent | 9b54d2017687df9fa827faf9e4022973b87fc0ff (diff) |
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: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 6 |
3 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 6bb71f6ee18e..309718cc24b2 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -3549,6 +3549,9 @@ static int gfx_v9_0_ecc_late_init(void *handle) return 0; } + if (*ras_if) + goto resume; + *ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL); if (!*ras_if) return -ENOMEM; @@ -3573,7 +3576,7 @@ static int gfx_v9_0_ecc_late_init(void *handle) 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; diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 0252345a1f08..b57476b7cc86 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -927,6 +927,9 @@ static int gmc_v9_0_ecc_late_init(void *handle) 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) @@ -952,7 +955,7 @@ static int gmc_v9_0_ecc_late_init(void *handle) 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; diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index f7a6fafd70ae..756f3c60ae6a 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c @@ -1522,6 +1522,10 @@ static int sdma_v4_0_late_init(void *handle) return 0; } + /* handle resume path. */ + if (*ras_if) + goto resume; + *ras_if = kmalloc(sizeof(**ras_if), GFP_KERNEL); if (!*ras_if) return -ENOMEM; @@ -1546,7 +1550,7 @@ static int sdma_v4_0_late_init(void *handle) 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; |