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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'drm-intel-next-fixes-2019-11-22' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

- Reverts a patch to avoid spinning forever when context's timeline
is active but has no requests

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191122155523.GA20167@jlahtine-desk.ger.corp.intel.com

+7 -2
+7 -2
drivers/gpu/drm/i915/gt/intel_gt_requests.c
··· 33 33 { 34 34 struct intel_gt_timelines *timelines = &gt->timelines; 35 35 struct intel_timeline *tl, *tn; 36 + unsigned long active_count = 0; 36 37 unsigned long flags; 37 38 bool interruptible; 38 39 LIST_HEAD(free); ··· 46 45 47 46 spin_lock_irqsave(&timelines->lock, flags); 48 47 list_for_each_entry_safe(tl, tn, &timelines->active_list, link) { 49 - if (!mutex_trylock(&tl->mutex)) 48 + if (!mutex_trylock(&tl->mutex)) { 49 + active_count++; /* report busy to caller, try again? */ 50 50 continue; 51 + } 51 52 52 53 intel_timeline_get(tl); 53 54 GEM_BUG_ON(!tl->active_count); ··· 76 73 list_safe_reset_next(tl, tn, link); 77 74 if (!--tl->active_count) 78 75 list_del(&tl->link); 76 + else 77 + active_count += !!rcu_access_pointer(tl->last_request.fence); 79 78 80 79 mutex_unlock(&tl->mutex); 81 80 ··· 92 87 list_for_each_entry_safe(tl, tn, &free, link) 93 88 __intel_timeline_free(&tl->kref); 94 89 95 - return list_empty(&timelines->active_list) ? 0 : timeout; 90 + return active_count ? timeout : 0; 96 91 } 97 92 98 93 int intel_gt_wait_for_idle(struct intel_gt *gt, long timeout)