Skip to content

Commit b1338a8

Browse files
Stanley.Yangalexdeucher
authored andcommitted
drm/amdgpu: Workaround to skip kiq ring test during ras gpu recovery
This is workaround, kiq ring test failed in suspend stage when do ras recovery. Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 5509e59 commit b1338a8

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "amdgpu_rlc.h"
3030
#include "amdgpu_ras.h"
3131
#include "amdgpu_xcp.h"
32+
#include "amdgpu_xgmi.h"
3233

3334
/* delay 0.1 second to enable gfx off feature */
3435
#define GFX_OFF_DELAY_ENABLE msecs_to_jiffies(100)
@@ -501,6 +502,9 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev, int xcc_id)
501502
{
502503
struct amdgpu_kiq *kiq = &adev->gfx.kiq[xcc_id];
503504
struct amdgpu_ring *kiq_ring = &kiq->ring;
505+
struct amdgpu_hive_info *hive;
506+
struct amdgpu_ras *ras;
507+
int hive_ras_recovery = 0;
504508
int i, r = 0;
505509
int j;
506510

@@ -521,6 +525,23 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev, int xcc_id)
521525
RESET_QUEUES, 0, 0);
522526
}
523527

528+
/**
529+
* This is workaround: only skip kiq_ring test
530+
* during ras recovery in suspend stage for gfx9.4.3
531+
*/
532+
hive = amdgpu_get_xgmi_hive(adev);
533+
if (hive) {
534+
hive_ras_recovery = atomic_read(&hive->ras_recovery);
535+
amdgpu_put_xgmi_hive(hive);
536+
}
537+
538+
ras = amdgpu_ras_get_context(adev);
539+
if ((amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3)) &&
540+
ras && (atomic_read(&ras->in_recovery) || hive_ras_recovery)) {
541+
spin_unlock(&kiq->ring_lock);
542+
return 0;
543+
}
544+
524545
if (kiq_ring->sched.ready && !adev->job_hang)
525546
r = amdgpu_ring_test_helper(kiq_ring);
526547
spin_unlock(&kiq->ring_lock);

0 commit comments

Comments
 (0)