[PATCH v2 6/6] drm/amdgpu: Default disable LSDMA until proven stable.

Yifan Zhang yifan1.zhang at amd.com
Fri Nov 17 02:09:46 UTC 2023


Add a module parameter for enabling LSDMA, defalt disable it until
proven stable. The module parameter is used to enable LSDMA ring
mode, and switch paging, system buffer management from SDMA to LSDMA.

Signed-off-by: Yifan Zhang <yifan1.zhang at amd.com>
Reviewed-by: Tim Huang <Tim.Huang at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c |  8 +++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       | 10 ++++++++++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 625ba88258f2..c489b8af2ee1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -216,6 +216,7 @@ extern int amdgpu_force_asic_type;
 extern int amdgpu_smartshift_bias;
 extern int amdgpu_use_xgmi_p2p;
 extern int amdgpu_mtype_local;
+extern int amdgpu_lsdma;
 extern bool enforce_isolation;
 #ifdef CONFIG_HSA_AMD
 extern int sched_policy;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 3e7ad86d7fa9..fe21fc4f1b00 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -2715,9 +2715,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 	if (r)
 		return r;
 
-	r = amdgpu_discovery_set_lsdma_ip_blocks(adev);
-	if (r)
-		return r;
+	if (amdgpu_lsdma) {
+		r = amdgpu_discovery_set_lsdma_ip_blocks(adev);
+		if (r)
+			return r;
+	}
 
 	r = amdgpu_discovery_set_mes_ip_blocks(adev);
 	if (r)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 5d009175318e..716c1701458e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -153,6 +153,7 @@ int amdgpu_vm_block_size = -1;
 int amdgpu_vm_fault_stop;
 int amdgpu_vm_update_mode = -1;
 int amdgpu_exp_hw_support;
+int amdgpu_lsdma;
 int amdgpu_dc = -1;
 int amdgpu_sched_jobs = 32;
 int amdgpu_sched_hw_submission = 2;
@@ -427,6 +428,15 @@ module_param_named(vm_fault_stop, amdgpu_vm_fault_stop, int, 0444);
 MODULE_PARM_DESC(vm_update_mode, "VM update using CPU (0 = never (default except for large BAR(LB)), 1 = Graphics only, 2 = Compute only (default for LB), 3 = Both");
 module_param_named(vm_update_mode, amdgpu_vm_update_mode, int, 0444);
 
+/**
+ * DOC: lsdma (int)
+ * Enable lsdma ring mode, setup lsdma ring, utilize lsdma for paging and system buffer management. Do NOT expose it until proven stable
+ */
+/*
+MODULE_PARM_DESC(lsdma, "Enable lsdma ring mode, setup lsdma ring, utilize lsdma for paging and system buffer management (1 = enable, 0 = disable(default))");
+module_param_named(lsdma, amdgpu_lsdma, int, 0444);
+*/
+
 /**
  * DOC: exp_hw_support (int)
  * Enable experimental hw support (1 = enable). The default is 0 (disabled).
-- 
2.37.3



More information about the amd-gfx mailing list