[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190414233729.17956-4-itsbriany@gmail.com>
Date: Sun, 14 Apr 2019 23:37:29 +0000
From: Brian Yip <itsbriany@...il.com>
To: christian.koenig@....com
Cc: ray.huang@....com, Jerry.Zhang@....com, airlied@...ux.ie,
daniel@...ll.ch, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, Brian Yip <itsbriany@...il.com>
Subject: [PATCH 3/3] drm/ttm: Fix ttm_bo_glob.kobj state on cleanup
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@...il.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
Powered by blists - more mailing lists