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

Commit cb5899ae authored by Naman Padhiar's avatar Naman Padhiar Committed by Gerrit - the friendly Code Review server
Browse files

icnss2: Decrement soc wake ref count



If ref count is greater than 1, decrement ref count without
calling SOC_WAKE_RELEASE QMI as for ref count greater than 1
SOC_WAKE_REQ is also not sent.
This will protect req/release mismatch in FW.

Change-Id: I8475e7b2429389c22a23483ee129db8753957ad3
Signed-off-by: default avatarNaman Padhiar <npadhiar@codeaurora.org>
parent c7abf2c0
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2332,6 +2332,12 @@ int icnss_force_wake_request(struct device *dev)
		return -EINVAL;
	}

	if (atomic_read(&priv->soc_wake_ref_count)) {
		count = atomic_inc_return(&priv->soc_wake_ref_count);
		icnss_pr_dbg("SOC already awake, Ref count: %d", count);
		return 0;
	}

	icnss_pr_dbg("Calling SOC Wake request");

	if (atomic_read(&priv->soc_wake_ref_count)) {
@@ -2350,6 +2356,7 @@ EXPORT_SYMBOL(icnss_force_wake_request);
int icnss_force_wake_release(struct device *dev)
{
	struct icnss_priv *priv = dev_get_drvdata(dev);
	int count = 0;

	if (!dev)
		return -ENODEV;
@@ -2359,6 +2366,13 @@ int icnss_force_wake_release(struct device *dev)
		return -EINVAL;
	}

	if (atomic_read(&priv->soc_wake_ref_count) > 1) {
		count = atomic_dec_return(&priv->soc_wake_ref_count);
		icnss_pr_dbg("SOC previous release pending, Ref count: %d",
			     count);
		return 0;
	}

	icnss_pr_dbg("Calling SOC Wake response");

	icnss_soc_wake_event_post(priv, ICNSS_SOC_WAKE_RELEASE_EVENT,