From: Dave Airlie Date: Tue, 7 Aug 2018 20:07:06 +0000 (+1000) Subject: Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm... X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=569f0a8694d0ff13c5d296a594c7d8cec8d6f35f;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next From: Lucas Stach "not much to de-stage this time. Changes from Philipp and Souptick to use memset32 more and switch the fault handler to the new vm_fault_t and two small fixes for issues that can be hit in rare corner cases from me." Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/1533563808.2809.7.camel@pengutronix.de --- 569f0a8694d0ff13c5d296a594c7d8cec8d6f35f diff --cc drivers/gpu/drm/etnaviv/etnaviv_sched.c index 3949f18afb35,b267d9c4d91c..69e9b431bf1f --- a/drivers/gpu/drm/etnaviv/etnaviv_sched.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_sched.c @@@ -140,15 -140,21 +140,21 @@@ static const struct drm_sched_backend_o int etnaviv_sched_push_job(struct drm_sched_entity *sched_entity, struct etnaviv_gem_submit *submit) { - int ret; + int ret = 0; + + /* + * Hold the fence lock across the whole operation to avoid jobs being + * pushed out of order with regard to their sched fence seqnos as + * allocated in drm_sched_job_init. + */ + mutex_lock(&submit->gpu->fence_lock); - ret = drm_sched_job_init(&submit->sched_job, &submit->gpu->sched, - sched_entity, submit->cmdbuf.ctx); + ret = drm_sched_job_init(&submit->sched_job, sched_entity, + submit->cmdbuf.ctx); if (ret) - return ret; + goto out_unlock; submit->out_fence = dma_fence_get(&submit->sched_job.s_fence->finished); - mutex_lock(&submit->gpu->fence_idr_lock); submit->out_fence_id = idr_alloc_cyclic(&submit->gpu->fence_idr, submit->out_fence, 0, INT_MAX, GFP_KERNEL);