@@ -251,10 +251,12 @@ void intel_gt_watchdog_work(struct work_struct *work)
if (!i915_request_completed(rq)) {
struct dma_fence *f = &rq->fence;
+ dma_fence_access_begin();
pr_notice("Fence expiration time out i915-%s:%s:%llx!\n",
dma_fence_driver_name(f),
dma_fence_timeline_name(f),
f->seqno);
+ dma_fence_access_end();
i915_request_cancel(rq, -EINTR);
}
i915_request_put(rq);
@@ -2184,7 +2184,6 @@ void i915_request_show(struct drm_printer *m,
const char *prefix,
int indent)
{
- const char *name = dma_fence_timeline_name((struct dma_fence *)&rq->fence);
char buf[80] = "";
int x = 0;
@@ -2220,6 +2219,7 @@ void i915_request_show(struct drm_printer *m,
x = print_sched_attr(&rq->sched.attr, buf, x, sizeof(buf));
+ dma_fence_access_begin();
drm_printf(m, "%s%.*s%c %llx:%lld%s%s %s @ %dms: %s\n",
prefix, indent, " ",
queue_status(rq),
@@ -2228,7 +2228,8 @@ void i915_request_show(struct drm_printer *m,
fence_status(rq),
buf,
jiffies_to_msecs(jiffies - rq->emitted_jiffies),
- name);
+ dma_fence_timeline_name((struct dma_fence *)&rq->fence));
+ dma_fence_access_end();
}
static bool engine_match_ring(struct intel_engine_cs *engine, struct i915_request *rq)
@@ -434,11 +434,13 @@ static void timer_i915_sw_fence_wake(struct timer_list *t)
if (!fence)
return;
+ dma_fence_access_begin();
pr_notice("Asynchronous wait on fence %s:%s:%llx timed out (hint:%ps)\n",
dma_fence_driver_name(cb->dma),
dma_fence_timeline_name(cb->dma),
cb->dma->seqno,
i915_sw_fence_debug_hint(fence));
+ dma_fence_access_end();
i915_sw_fence_set_error_once(fence, -ETIMEDOUT);
i915_sw_fence_complete(fence);
Protect the access to driver and timeline name which otherwise could be freed as dma-fence exported is signalling fences. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> --- drivers/gpu/drm/i915/gt/intel_gt_requests.c | 2 ++ drivers/gpu/drm/i915/i915_request.c | 5 +++-- drivers/gpu/drm/i915/i915_sw_fence.c | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-)