Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon: silence out possible lock dependency warning

Silence out the lock dependency warning by moving bo allocation out
of ib mutex protected section. Might lead to useless temporary
allocation but it's not harmful as such things only happen at
initialization.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Jerome Glisse and committed by
Dave Airlie
d54fbd49 598781d7

+11 -8
+11 -8
drivers/gpu/drm/radeon/radeon_ring.c
··· 204 204 205 205 int radeon_ib_pool_init(struct radeon_device *rdev) 206 206 { 207 + struct radeon_sa_manager tmp; 207 208 int i, r; 209 + 210 + r = radeon_sa_bo_manager_init(rdev, &tmp, 211 + RADEON_IB_POOL_SIZE*64*1024, 212 + RADEON_GEM_DOMAIN_GTT); 213 + if (r) { 214 + return r; 215 + } 208 216 209 217 mutex_lock(&rdev->ib_pool.mutex); 210 218 if (rdev->ib_pool.ready) { 211 219 mutex_unlock(&rdev->ib_pool.mutex); 220 + radeon_sa_bo_manager_fini(rdev, &tmp); 212 221 return 0; 213 222 } 214 223 215 - r = radeon_sa_bo_manager_init(rdev, &rdev->ib_pool.sa_manager, 216 - RADEON_IB_POOL_SIZE*64*1024, 217 - RADEON_GEM_DOMAIN_GTT); 218 - if (r) { 219 - mutex_unlock(&rdev->ib_pool.mutex); 220 - return r; 221 - } 222 - 224 + rdev->ib_pool.sa_manager = tmp; 225 + INIT_LIST_HEAD(&rdev->ib_pool.sa_manager.sa_bo); 223 226 for (i = 0; i < RADEON_IB_POOL_SIZE; i++) { 224 227 rdev->ib_pool.ibs[i].fence = NULL; 225 228 rdev->ib_pool.ibs[i].idx = i;