lkml.org 
[lkml]   [2019]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] drm/ttm: Fix ttm_bo_glob.kobj state on cleanup
Date
Cleanup ttm_bo_glob.kobj when its reference count hits 0
so that it can be re-initialized by future ttm_bo_global_init calls
without dumping a stack trace.

Signed-off-by: Brian Yip <itsbriany@gmail.com>
---
drivers/gpu/drm/ttm/ttm_bo.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 988416fb8a0b..1e1844f4a4fa 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1535,6 +1535,10 @@ static void ttm_bo_global_release(void)
kobject_del(&glob->kobj);
kobject_put(&glob->kobj);
ttm_mem_global_release(&ttm_mem_glob);
+
+ if (!kref_read(&glob->kobj.kref))
+ glob->kobj.state_initialized = 0;
+
out:
mutex_unlock(&ttm_global_mutex);
}
--
2.20.1
\
 
 \ /
  Last update: 2019-04-15 01:38    [W:0.049 / U:2.596 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site