mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-06 06:35:12 +00:00
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
This commit is contained in:
commit
e639ea0f91
1 changed files with 7 additions and 2 deletions
|
@ -33,6 +33,7 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout)
|
||||||
{
|
{
|
||||||
struct intel_gt_timelines *timelines = >->timelines;
|
struct intel_gt_timelines *timelines = >->timelines;
|
||||||
struct intel_timeline *tl, *tn;
|
struct intel_timeline *tl, *tn;
|
||||||
|
unsigned long active_count = 0;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
bool interruptible;
|
bool interruptible;
|
||||||
LIST_HEAD(free);
|
LIST_HEAD(free);
|
||||||
|
@ -45,8 +46,10 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout)
|
||||||
|
|
||||||
spin_lock_irqsave(&timelines->lock, flags);
|
spin_lock_irqsave(&timelines->lock, flags);
|
||||||
list_for_each_entry_safe(tl, tn, &timelines->active_list, link) {
|
list_for_each_entry_safe(tl, tn, &timelines->active_list, link) {
|
||||||
if (!mutex_trylock(&tl->mutex))
|
if (!mutex_trylock(&tl->mutex)) {
|
||||||
|
active_count++; /* report busy to caller, try again? */
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
intel_timeline_get(tl);
|
intel_timeline_get(tl);
|
||||||
GEM_BUG_ON(!tl->active_count);
|
GEM_BUG_ON(!tl->active_count);
|
||||||
|
@ -73,6 +76,8 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout)
|
||||||
list_safe_reset_next(tl, tn, link);
|
list_safe_reset_next(tl, tn, link);
|
||||||
if (!--tl->active_count)
|
if (!--tl->active_count)
|
||||||
list_del(&tl->link);
|
list_del(&tl->link);
|
||||||
|
else
|
||||||
|
active_count += !!rcu_access_pointer(tl->last_request.fence);
|
||||||
|
|
||||||
mutex_unlock(&tl->mutex);
|
mutex_unlock(&tl->mutex);
|
||||||
|
|
||||||
|
@ -87,7 +92,7 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout)
|
||||||
list_for_each_entry_safe(tl, tn, &free, link)
|
list_for_each_entry_safe(tl, tn, &free, link)
|
||||||
__intel_timeline_free(&tl->kref);
|
__intel_timeline_free(&tl->kref);
|
||||||
|
|
||||||
return list_empty(&timelines->active_list) ? 0 : timeout;
|
return active_count ? timeout : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int intel_gt_wait_for_idle(struct intel_gt *gt, long timeout)
|
int intel_gt_wait_for_idle(struct intel_gt *gt, long timeout)
|
||||||
|
|
Loading…
Add table
Reference in a new issue