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

Commit 57692b69 authored by Ravi Gummadidala's avatar Ravi Gummadidala
Browse files

msm: ipa: fix for race condition in IPA RM timer destruction



This change will ensure that the timer context is not wiped
out till it is known that the work is canceled and no longer
running

Change-Id: I52050caf020deda4353d13bdf28683d910e9ac66
Signed-off-by: default avatarRavi Gummadidala <rgummadi@codeaurora.org>
parent cb544cb0
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -138,7 +138,6 @@ int ipa_rm_inactivity_timer_init(enum ipa_rm_resource_name resource_name,
*/
int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name)
{
	unsigned long flags;
	IPADBG("%s: resource %d\n", __func__, resource_name);

	if (resource_name < 0 ||
@@ -153,9 +152,7 @@ int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name)
		return -EINVAL;
	}

	spin_lock_irqsave(&ipa_rm_it_handles[resource_name].lock, flags);
	cancel_delayed_work(&ipa_rm_it_handles[resource_name].work);
	spin_unlock_irqrestore(&ipa_rm_it_handles[resource_name].lock, flags);
	cancel_delayed_work_sync(&ipa_rm_it_handles[resource_name].work);

	memset(&ipa_rm_it_handles[resource_name], 0,
	       sizeof(struct ipa_rm_it_private));