[PATCH] drm/amd/amdgpu: Fix iova debugfs for non-iommu case (v2)

Tom St Denis tom.stdenis at amd.com
Tue Sep 19 17:26:18 UTC 2017


Signed-off-by: Tom St Denis <tom.stdenis at amd.com>

(v2): Don't create iova file when iommu is disabled
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 0e5f78f3a97e..566b24bc06ce 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1902,6 +1902,10 @@ static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev)
 	struct dentry *ent, *root = minor->debugfs_root;
 
 	for (count = 0; count < ARRAY_SIZE(ttm_debugfs_entries); count++) {
+		if (ttm_debugfs_entries[count].domain == TTM_PL_SYSTEM) {
+			if (!iommu_get_domain_for_dev(adev->dev))
+				continue;
+		}
 		ent = debugfs_create_file(
 				ttm_debugfs_entries[count].name,
 				S_IFREG | S_IRUGO, root,
-- 
2.12.0



More information about the amd-gfx mailing list