Skip to content

Commit af06a4b

Browse files
Stanley.YangLijo Lazar
Stanley.Yang
authored and
Lijo Lazar
committed
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. Change-Id: I8de9900aa76706f59bc029d4e9e8438c6e1db8e0 Signed-off-by: Stanley.Yang <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Reviewed-by: Hawking Zhang <[email protected]>
1 parent 773bf35 commit af06a4b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

+21
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)