Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee52ccec authored by Lucas Stach's avatar Lucas Stach Committed by Greg Kroah-Hartman
Browse files

drm/etnaviv: put submit prev MMU context when it exists



commit cda7532916f7bc860b36a1806cb8352e6f63dacb upstream.

The prev context is the MMU context at the time of the job
queueing in hardware. As a job might be queued multiple times
due to recovery after a GPU hang, we need to make sure to put
the stale prev MMU context from a prior queuing, to avoid the
reference and thus the MMU context leaking.

Cc: stable@vger.kernel.org # 5.4
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
Tested-by: default avatarMichael Walle <michael@walle.cc>
Tested-by: default avatarMarek Vasut <marex@denx.de>
Reviewed-by: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a9bacefd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1310,6 +1310,8 @@ struct dma_fence *etnaviv_gpu_submit(struct etnaviv_gem_submit *submit)
		gpu->mmu_context = etnaviv_iommu_context_get(submit->mmu_context);
		etnaviv_gpu_start_fe_idleloop(gpu);
	} else {
		if (submit->prev_mmu_context)
			etnaviv_iommu_context_put(submit->prev_mmu_context);
		submit->prev_mmu_context = etnaviv_iommu_context_get(gpu->mmu_context);
	}