aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMonk Liu <Monk.Liu@amd.com>2016-06-14 12:02:21 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 14:51:12 -0400
commita909c6bd9f9223e91b40b1c56c2c81ae504295b3 (patch)
treea5e678dd531c85277d8603a48a386d22b159c116
parentc71dbd93eb0039838de920ae1712ff65fd648290 (diff)
drm/amdgpu: fix ring debugfs bug
debugfs file added but not released after driver unloaded Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c10
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index b6c8309ce891..f41d23139a3a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -798,6 +798,9 @@ struct amdgpu_ring {
798 unsigned cond_exe_offs; 798 unsigned cond_exe_offs;
799 u64 cond_exe_gpu_addr; 799 u64 cond_exe_gpu_addr;
800 volatile u32 *cond_exe_cpu_addr; 800 volatile u32 *cond_exe_cpu_addr;
801#if defined(CONFIG_DEBUG_FS)
802 struct dentry *ent;
803#endif
801}; 804};
802 805
803/* 806/*
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 942111517e40..c38203e04efe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -49,6 +49,7 @@
49 */ 49 */
50static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, 50static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
51 struct amdgpu_ring *ring); 51 struct amdgpu_ring *ring);
52static void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring);
52 53
53/** 54/**
54 * amdgpu_ring_alloc - allocate space on the ring buffer 55 * amdgpu_ring_alloc - allocate space on the ring buffer
@@ -362,6 +363,7 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)
362 } 363 }
363 amdgpu_bo_unref(&ring_obj); 364 amdgpu_bo_unref(&ring_obj);
364 } 365 }
366 amdgpu_debugfs_ring_fini(ring);
365} 367}
366 368
367/* 369/*
@@ -445,6 +447,14 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
445 return PTR_ERR(ent); 447 return PTR_ERR(ent);
446 448
447 i_size_write(ent->d_inode, ring->ring_size + 12); 449 i_size_write(ent->d_inode, ring->ring_size + 12);
450 ring->ent = ent;
448#endif 451#endif
449 return 0; 452 return 0;
450} 453}
454
455static void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring)
456{
457#if defined(CONFIG_DEBUG_FS)
458 debugfs_remove(ring->ent);
459#endif
460}