Skip to contentSkip to conversation

Xorg indefinitely hangs in kernelspace

DISCUSSION Hillf Danton 1 participant 1 message Sep 9, 2019

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

On Mon, 9 Sep 2019 from Gerd Hoffmann <[email protected]>

Quoted 2 lines

Hmm, I think the patch is wrong.

Hmm...it should have added change only in the error path, leaving locks for drivers to release if job is done with no error returned.

Quoted 2 lines

As far I know it is the qxl drivers's
job to call ttm_eu_backoff_reservation().

Like other drivers, qxl is currently doing the right.

Quoted 3 lines

Doing that automatically in
ttm will most likely break other ttm users.

You are right. They are responsible for doing backoff if error happens while validating buffers afterwards.

drivers/gpu/drm/ttm/ttm_execbuf_util.c +5 -0
@@ -111,8 +111,10 @@ int ttm_eu_reserve_buffers(struct ww_acq
 
 	list_for_each_entry(entry, list, head) {
 		struct ttm_buffer_object *bo = entry->bo;
+		bool lockon;
 
 		ret = __ttm_bo_reserve(bo, intr, (ticket == NULL), ticket);
+		lockon = !ret;
 		if (!ret && unlikely(atomic_read(&bo->cpu_writers) > 0)) {
 			reservation_object_unlock(bo->resv);
 
@@ -151,6 +153,7 @@ int ttm_eu_reserve_buffers(struct ww_acq
 				ret = 0;
 			}
 		}
+		lockon = !ret;
 
 		if (!ret && entry->num_shared)
 			ret = reservation_object_reserve_shared(bo->resv,
@@ -163,6 +166,8 @@ int ttm_eu_reserve_buffers(struct ww_acq
 				ww_acquire_done(ticket);
 				ww_acquire_fini(ticket);
 			}
+			if (lockon)
+				ttm_eu_backoff_reservation_reverse(list, entry);
 			return ret;
 		}
 

--