drm/i915: Move list of timelines under its own lock
Currently, the list of timelines is serialised by the struct_mutex, but to alleviate difficulties with using that mutex in future, move the list management under its own dedicated mutex. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190128102356.15037-5-chris@chris-wilson.co.uk
此提交包含在:
@@ -854,7 +854,8 @@ bool i915_gem_unset_wedged(struct drm_i915_private *i915)
|
||||
*
|
||||
* No more can be submitted until we reset the wedged bit.
|
||||
*/
|
||||
list_for_each_entry(tl, &i915->gt.timelines, link) {
|
||||
mutex_lock(&i915->gt.timelines.mutex);
|
||||
list_for_each_entry(tl, &i915->gt.timelines.list, link) {
|
||||
struct i915_request *rq;
|
||||
long timeout;
|
||||
|
||||
@@ -876,9 +877,12 @@ bool i915_gem_unset_wedged(struct drm_i915_private *i915)
|
||||
timeout = dma_fence_default_wait(&rq->fence, true,
|
||||
MAX_SCHEDULE_TIMEOUT);
|
||||
i915_request_put(rq);
|
||||
if (timeout < 0)
|
||||
if (timeout < 0) {
|
||||
mutex_unlock(&i915->gt.timelines.mutex);
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&i915->gt.timelines.mutex);
|
||||
|
||||
intel_engines_sanitize(i915, false);
|
||||
|
||||
|
新增問題並參考
封鎖使用者