Skip to contentSkip to conversation

drm/amdgpu: fix MQD debugfs undefined symbol when DEBUG_FS=n

PATCH In review Sunil Khatri 2 participants 2 messages Jul 8, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix MQD debugfs undefined symbol when DEBUG_FS=n

Fix undefined reference to amdgpu_mqd_info_fops during debugfs_create_file if DEBUG_FS=n

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +4 -1
index 115d53bc9a8d..b1b80efc7993 100644
@@ -319,8 +319,9 @@ amdgpu_userq_destroy(struct drm_file *filp, int queue_id)
 	}
 	amdgpu_bo_unref(&queue->db_obj.obj);
 
+#if defined(CONFIG_DEBUG_FS)
 	debugfs_remove_recursive(queue->debugfs_queue);
-
+#endif
 	r = amdgpu_userq_unmap_helper(uq_mgr, queue);
 	amdgpu_userq_cleanup(uq_mgr, queue, queue_id);
 	mutex_unlock(&uq_mgr->userq_mutex);
@@ -523,9 +524,11 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	if (!queue_name)
 		return -ENOMEM;
 
+#if defined(CONFIG_DEBUG_FS)
 	/* Queue dentry per client to hold MQD information   */
 	queue->debugfs_queue = debugfs_create_dir(queue_name, filp->debugfs_client);
 	debugfs_create_file("mqd_info", 0444, queue->debugfs_queue, queue, &amdgpu_mqd_info_fops);
+#endif
 	kfree(queue_name);
 
 	args->out.queue_id = qid;
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 4 lines · Sunil Khatri

Fix undefined reference to amdgpu_mqd_info_fops during debugfs_create_file if DEBUG_FS=n

Yeah, that's exactly the reason why I wanted to put this into amdgpu_debugfs.c.

For now Reviewed-by: Christian König <[email protected]>, but we should clean that up at some point.

Going to push the patch to drm-misc-next now.

Regards,
Christian.

Quoted 31 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +4 -1
index 115d53bc9a8d..b1b80efc7993 100644
@@ -319,8 +319,9 @@ amdgpu_userq_destroy(struct drm_file *filp, int queue_id)
 	}
 	amdgpu_bo_unref(&queue->db_obj.obj);
 
+#if defined(CONFIG_DEBUG_FS)
 	debugfs_remove_recursive(queue->debugfs_queue);
-
+#endif
 	r = amdgpu_userq_unmap_helper(uq_mgr, queue);
 	amdgpu_userq_cleanup(uq_mgr, queue, queue_id);
 	mutex_unlock(&uq_mgr->userq_mutex);
@@ -523,9 +524,11 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	if (!queue_name)
 		return -ENOMEM;
 
+#if defined(CONFIG_DEBUG_FS)
 	/* Queue dentry per client to hold MQD information   */
 	queue->debugfs_queue = debugfs_create_dir(queue_name, filp->debugfs_client);
 	debugfs_create_file("mqd_info", 0444, queue->debugfs_queue, queue, &amdgpu_mqd_info_fops);
+#endif
 	kfree(queue_name);
 
 	args->out.queue_id = qid;