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

Commit 8e667df6 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "icnss2: Decrement soc wake ref count"

parents d94c8678 cb5899ae
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2339,6 +2339,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)) {
@@ -2357,6 +2363,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;
@@ -2366,6 +2373,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,