Skip to contentSkip to conversation

drm/radeon: silence out possible lock dependency warning

PATCH In review [email protected] 2 participants 3 messages Jan 24, 2012 – Jan 26, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: silence out possible lock dependency warning

From: Jerome Glisse <[email protected]>

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.

---
 drivers/gpu/drm/radeon/radeon_ring.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
drivers/gpu/drm/radeon/radeon_ring.c +11 -8
index e8bc709..1cb4b94 100644
@@ -204,22 +204,25 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib)
 
 int radeon_ib_pool_init(struct radeon_device *rdev)
 {
+	struct radeon_sa_manager tmp;
 	int i, r;
 
-	mutex_lock(&rdev->ib_pool.mutex);
-	if (rdev->ib_pool.ready) {
-		mutex_unlock(&rdev->ib_pool.mutex);
-		return 0;
-	}
-
-	r = radeon_sa_bo_manager_init(rdev, &rdev->ib_pool.sa_manager,
+	r = radeon_sa_bo_manager_init(rdev, &tmp,
 				      RADEON_IB_POOL_SIZE*64*1024,
 				      RADEON_GEM_DOMAIN_GTT);
 	if (r) {
-		mutex_unlock(&rdev->ib_pool.mutex);
 		return r;
 	}
 
+	mutex_lock(&rdev->ib_pool.mutex);
+	if (rdev->ib_pool.ready) {
+		mutex_unlock(&rdev->ib_pool.mutex);
+		radeon_sa_bo_manager_fini(rdev, &tmp);
+		return 0;
+	}
+
+	rdev->ib_pool.sa_manager = tmp;
+	INIT_LIST_HEAD(&rdev->ib_pool.sa_manager.sa_bo);
 	for (i = 0; i < RADEON_IB_POOL_SIZE; i++) {
 		rdev->ib_pool.ibs[i].fence = NULL;
 		rdev->ib_pool.ibs[i].idx = i;
Signature · 1 line
1.7.7.1
#1 lore raw

I suppose I can stop bisecting kernel about this possible lock and close the bug then?

Signature · 1 line
Alexandre Demers
#2 lore raw
Quoted 5 lines · Alexandre Demers

I suppose I can stop bisecting kernel about this possible lock and close the bug then?

--
Alexandre Demers

Yes, unless the bug is something else as the error message could be ignored and it wasn't
harmfull. ie even without that patch things couldn't go wrong.

Jerome