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

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

Merge "icnss2: Avoid race between SOC WAKE REQ/RESP"

parents 15330ab9 25c1e316
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -2329,7 +2329,6 @@ EXPORT_SYMBOL(icnss_set_fw_log_mode);
int icnss_force_wake_request(struct device *dev)
{
	struct icnss_priv *priv = dev_get_drvdata(dev);
	int count = 0;

	if (!dev)
		return -ENODEV;
@@ -2339,9 +2338,9 @@ 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);
	if (atomic_inc_not_zero(&priv->soc_wake_ref_count)) {
		icnss_pr_dbg("SOC already awake, Ref count: %d",
			     atomic_read(&priv->soc_wake_ref_count));
		return 0;
	}