Xorg indefinitely hangs in kernelspace

Submitted by Hillf Danton on Oct. 3, 2019, 8:23 a.m.

Details

Message ID 20191003082330.15260-1-hdanton@sina.com
State New
Headers show
Series "Xorg indefinitely hangs in kernelspace" ( rev: 4 ) in Spice

Not browsing as part of any series.

Commit Message

Hillf Danton Oct. 3, 2019, 8:23 a.m.
On Thu, 3 Oct 2019 09:45:55 +0300 Jaak Ristioja wrote:
> On 30.09.19 16:29, Frediano Ziglio wrote:
> >   Why didn't you update bug at https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1813620?
> > I know it can seem tedious but would help tracking it.
> 
> I suppose the lack on centralized tracking and handling of Linux kernel
> bugs is a delicate topic, so I don't want to rant much more on that.
> Updating that bug would tedious and time-consuming indeed, which is why
> I haven't done that. To be honest, I don't have enough time and motivation.

Give the diff below a go only when it is convenient and only if it makes
a bit of sense to you.

Patch hide | download patch | download mbox

--- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c
+++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
@@ -110,6 +110,7 @@  int ttm_eu_reserve_buffers(struct ww_acq
 		ww_acquire_init(ticket, &reservation_ww_class);
 
 	list_for_each_entry(entry, list, head) {
+		bool lockon = false;
 		struct ttm_buffer_object *bo = entry->bo;
 
 		ret = __ttm_bo_reserve(bo, intr, (ticket == NULL), ticket);
@@ -150,6 +151,7 @@  int ttm_eu_reserve_buffers(struct ww_acq
 				dma_resv_lock_slow(bo->base.resv, ticket);
 				ret = 0;
 			}
+			lockon = !ret;
 		}
 
 		if (!ret && entry->num_shared)
@@ -157,6 +159,8 @@  int ttm_eu_reserve_buffers(struct ww_acq
 								entry->num_shared);
 
 		if (unlikely(ret != 0)) {
+			if (lockon)
+				dma_resv_unlock(bo->base.resv);
 			if (ret == -EINTR)
 				ret = -ERESTARTSYS;
 			if (ticket) {