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

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

Merge "icnss2: Properly handle SOC_WAKE req stuck in QMI"

parents 097e7aba 5c463f98
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1108,16 +1108,13 @@ static int icnss_event_soc_wake_request(struct icnss_priv *priv, void *data)
static int icnss_event_soc_wake_release(struct icnss_priv *priv, void *data)
{
	int ret = 0;
	int count = 0;

	if (!priv)
		return -ENODEV;

	count = atomic_dec_return(&priv->soc_wake_ref_count);

	if (count) {
	if (atomic_dec_if_positive(&priv->soc_wake_ref_count)) {
		icnss_pr_dbg("Wake release not called. Ref count: %d",
			     count);
			     priv->soc_wake_ref_count);
		return 0;
	}

@@ -2793,7 +2790,8 @@ int icnss_force_wake_release(struct device *dev)

	icnss_pr_dbg("Calling SOC Wake response");

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