msm: kgsl: Free A6x per-context preemption buffer at detach time

preemption_context_destroy() will try to take the iommu mutex when
unmapping the buffer. Since the context can be destroyed from atomic
context for example, fence callbacks, taking the mutex will lead to a
kernel panic. Move the function from context destroy to context
detach. Detached contexts can no longer submit cmdbatches, so the
buffer can be safely released at this point after waiting for all
context cmdbatches already in flight to retire.

Change-Id: Ic48fa4638336a93e78e037bfc331037d611b40a3
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
1 file changed