[PATCH 1/4] drm/amdgpu: add param soft_reset_enable

Victor Zhao Victor.Zhao at amd.com
Thu Mar 10 06:11:52 UTC 2022


add parameter soft_reset_enable to control the enablement of
soft reset

Signed-off-by: Victor Zhao <Victor.Zhao at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 9 +++++++++
 drivers/gpu/drm/amd/amdgpu/nv.c         | 5 ++++-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 1f3c4521d348..22b846c359b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -238,6 +238,7 @@ extern int amdgpu_si_support;
 extern int amdgpu_cik_support;
 #endif
 extern int amdgpu_num_kcq;
+extern int amdgpu_soft_reset_enable;
 
 #define AMDGPU_VM_MAX_NUM_CTX			4096
 #define AMDGPU_SG_THRESHOLD			(256*1024*1024)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index b3fc5ae5fe6e..09daff7727b1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -201,6 +201,7 @@ struct amdgpu_watchdog_timer amdgpu_watchdog_timer = {
 	.timeout_fatal_disable = false,
 	.period = 0x0, /* default to 0x0 (timeout disable) */
 };
+int amdgpu_soft_reset_enable = -1;
 
 /**
  * DOC: vramlimit (int)
@@ -931,6 +932,14 @@ MODULE_PARM_DESC(smu_pptable_id,
 	"specify pptable id to be used (-1 = auto(default) value, 0 = use pptable from vbios, > 0 = soft pptable id)");
 module_param_named(smu_pptable_id, amdgpu_smu_pptable_id, int, 0444);
 
+/**
+ * DOC: soft_reset (int)
+ * Used to enable grbm soft reset
+ */
+MODULE_PARM_DESC(soft_reset_enable,
+	"enable soft reset (-1 = auto(default) value, 0 = disable, > 0 = enable)");
+module_param_named(soft_reset_enable, amdgpu_soft_reset_enable, int, 0444);
+
 /* These devices are not supported by amdgpu.
  * They are supported by the mach64, r128, radeon drivers
  */
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 59eafa31c626..fe9b9d896dc1 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -620,7 +620,10 @@ static uint32_t nv_get_rev_id(struct amdgpu_device *adev)
 
 static bool nv_need_full_reset(struct amdgpu_device *adev)
 {
-	return true;
+	if (amdgpu_soft_reset_enable <= 0)
+		return true;
+	else
+		return false;
 }
 
 static bool nv_need_reset_on_init(struct amdgpu_device *adev)
-- 
2.25.1



More information about the amd-gfx mailing list