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

Commit 22fe1e7d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: Fix incorrect wakelock handling"

parents 359d1d30 b09c22c0
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -3418,11 +3418,14 @@ void ipa_inc_acquire_wakelock(enum ipa_wakelock_ref_client ref_client)
		return;
	spin_lock_irqsave(&ipa_ctx->wakelock_ref_cnt.spinlock, flags);
	if (ipa_ctx->wakelock_ref_cnt.cnt & (1 << ref_client))
		IPAERR("client enum %d mask already set. ref cnt = %d\n",
		IPADBG("client enum %d mask already set. ref cnt = %d\n",
		ref_client, ipa_ctx->wakelock_ref_cnt.cnt);
	ipa_ctx->wakelock_ref_cnt.cnt |= (1 << ref_client);
	if (ipa_ctx->wakelock_ref_cnt.cnt)
	if (ipa_ctx->wakelock_ref_cnt.cnt &&
		!ipa_ctx->wakelock_ref_cnt.wakelock_acquired) {
		__pm_stay_awake(&ipa_ctx->w_lock);
		ipa_ctx->wakelock_ref_cnt.wakelock_acquired = true;
	}
	IPADBG_LOW("active wakelock ref cnt = %d client enum %d\n",
		ipa_ctx->wakelock_ref_cnt.cnt, ref_client);
	spin_unlock_irqrestore(&ipa_ctx->wakelock_ref_cnt.spinlock, flags);
@@ -3446,8 +3449,11 @@ void ipa_dec_release_wakelock(enum ipa_wakelock_ref_client ref_client)
	ipa_ctx->wakelock_ref_cnt.cnt &= ~(1 << ref_client);
	IPADBG_LOW("active wakelock ref cnt = %d client enum %d\n",
		ipa_ctx->wakelock_ref_cnt.cnt, ref_client);
	if (ipa_ctx->wakelock_ref_cnt.cnt == 0)
	if (ipa_ctx->wakelock_ref_cnt.cnt == 0 &&
		ipa_ctx->wakelock_ref_cnt.wakelock_acquired) {
		__pm_relax(&ipa_ctx->w_lock);
		ipa_ctx->wakelock_ref_cnt.wakelock_acquired = false;
	}
	spin_unlock_irqrestore(&ipa_ctx->wakelock_ref_cnt.spinlock, flags);
}

+1 −0
Original line number Diff line number Diff line
@@ -841,6 +841,7 @@ struct ipa_active_clients {
struct ipa_wakelock_ref_cnt {
	spinlock_t spinlock;
	u32 cnt;
	bool wakelock_acquired;
};

struct ipa_tag_completion {