memory
in global structure initialization functions rather than checking
reference counters in their corresponding release functions.
Brian Yip (2):
drm/ttm: Reset ttm_mem_global when initialized
drm/ttm: Reset ttm_bo_glob when initialized
drivers/gpu/drm/ttm/ttm_bo.c | 6 +-
drivers
Always initialize ttm_bo_glob from a pristine state when its use_count
is 0. Persist use_count so that ttm_bo_glob can later be released.
Signed-off-by: Brian Yip
---
drivers/gpu/drm/ttm/ttm_bo.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm
ttm_mem_global structure such that its state will
be pristine and thus, ready to be re-initialized.
Signed-off-by: Brian Yip
---
drivers/gpu/drm/ttm/ttm_memory.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
index 699fed9e08ee
Cleanup ttm_mem_glob.kobj when its reference count hits 0
so that it can be re-initialized by future ttm_mem_global_init calls
without dumping a stack trace.
Signed-off-by: Brian Yip
---
drivers/gpu/drm/ttm/ttm_memory.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a
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
---
drivers/gpu/drm/ttm/ttm_bo.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/ttm
ttm_mem_global_init where ttm_mem_global.num_zones
is eventually incremented beyond TTM_MEM_MAX_ZONES.
ttm_mem_global.num_zones is then used to dereference a ttm_mem_zone beyond
the amount of ttm_mem_zones allocated, resulting in a crash.
Signed-off-by: Brian Yip
---
drivers/gpu/drm/ttm/ttm_memory.c
during this process. This resulted in a crash and
false positive kobj initialization warnings during subsequent initialization
of these global structures.
Fix the crash and false positive kobj initialization warnings.
Brian Yip (3):
drm/ttm: Reset num_zones on ttm_mem_global cleanup
drm/ttm