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

Commit cf4c95e5 authored by Shubhraprakash Das's avatar Shubhraprakash Das
Browse files

msm: kgsl: Delete context event group on detach



Delete the context event group when the context is detached instead
of deleting it when context is destroyed. If the event group is deleted
when context is destroyed then a race occurs between deleting the event
group and processing the event group.

CRs-Fixed: 713905
Change-Id: Ifdc3397394d585f164f77d2e299a9d664bcbdc73
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent cc95eee0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -348,6 +348,7 @@ static void adreno_drawctxt_detach_callback(struct kgsl_device *device,
	wake_up_all(&drawctxt->waiting);
	wake_up_all(&drawctxt->wq);
	complete_all(&drawctxt->base.detach_gate);
	kgsl_del_event_group(&context->events);
	kgsl_context_put(context);
	adreno_profile_process_results(adreno_dev);
}
+0 −1
Original line number Diff line number Diff line
@@ -634,7 +634,6 @@ kgsl_context_destroy(struct kref *kref)
	write_unlock(&device->context_lock);
	kgsl_sync_timeline_destroy(context);
	kgsl_process_private_put(context->proc_priv);
	kgsl_del_event_group(&context->events);

	device->ftbl->drawctxt_destroy(context);
}
+4 −2
Original line number Diff line number Diff line
@@ -73,7 +73,8 @@ void kgsl_process_event_group(struct kgsl_device *device,

	context = group->context;

	_kgsl_context_get(context);
	if (context && !_kgsl_context_get(context))
		return;

	spin_lock(&group->lock);

@@ -204,7 +205,8 @@ int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group,
		return -ENOMEM;

	/* Get a reference to the context while the event is active */
	_kgsl_context_get(context);
	if (context && !_kgsl_context_get(context))
		return -EINVAL;

	event->device = device;
	event->context = context;