Skip to contentSkip to conversation

drm/amdgpu: fix send ras disable cmd when asic not support ras

PATCH Superseded Stanley.Yang 1 participant 1 message Mar 12, 2021

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix send ras disable cmd when asic not support ras

cause:
It is necessary to send ras disable command to ras-ta to program GB_EDC_MODE to "BYPASS" mode during gfx block ras later init, because the ras capability is disable read from vbios for vega20 gaming, but the ras context is released during ras init process,
this will cause send ras disable command to ras-to failed.
how:
Delay releasing ras context, the ras context
will be released after gfx block later init done.

Changed from V1:
move release_ras_context into ras_resume

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    |  9 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c       | 57 +++++++++++++++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h       |  2 +
 .../gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c    |  4 ++
 4 files changed, 58 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -3
index 7f7238283d26..88e3f8cdd7cb 100644
@@ -3499,11 +3499,11 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 			adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME;
 			adev->virt.ops = NULL;
 			r = -EAGAIN;
-			goto failed;
+			goto release_ras_con;
 		}
 		dev_err(adev->dev, "amdgpu_device_ip_init failed\n");
 		amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_AMDGPU_INIT_FAIL, 0, 0);
-		goto failed;
+		goto release_ras_con;
 	}
 
 	dev_info(adev->dev,
@@ -3568,7 +3568,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	if (r) {
 		dev_err(adev->dev, "amdgpu_device_ip_late_init failed\n");
 		amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_AMDGPU_LATE_INIT_FAIL, 0, r);
-		goto failed;
+		goto release_ras_con;
 	}
 
 	/* must succeed. */
@@ -3595,6 +3595,9 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 
 	return 0;
 
+release_ras_con:
+	amdgpu_release_ras_context(adev);
+
 failed:
 	amdgpu_vf_error_trans_all(adev);
 	if (atpx)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +46 -11

139 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +2 -0
index a64bbb6dcfa4..60df268a0c66 100644
@@ -626,4 +626,6 @@ void amdgpu_ras_global_ras_isr(struct amdgpu_device *adev);
 void amdgpu_ras_set_error_query_ready(struct amdgpu_device *adev, bool ready);
 
 bool amdgpu_ras_need_emergency_restart(struct amdgpu_device *adev);
+
+void amdgpu_release_ras_context(struct amdgpu_device *adev);
 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +4 -0
index 7f527f8bbdb1..6008152f1363 100644
@@ -441,6 +441,10 @@ bool amdgpu_ras_eeprom_check_err_threshold(struct amdgpu_device *adev)
 	if (!__is_ras_eeprom_supported(adev))
 		return false;
 
+	/* skip check VEGA20 Gaming */
+	if (!adev->ras_features)
+		return false;
+
 	if (con->eeprom_control.tbl_hdr.header == EEPROM_TABLE_HDR_BAD) {
 		dev_warn(adev->dev, "This GPU is in BAD status.");
 		dev_warn(adev->dev, "Please retire it or setting one bigger "
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx