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

Commit 9cfd7024 authored by Bojun Pan's avatar Bojun Pan
Browse files

msm: ipa3: Fix spin_unlock_bh warning in wan driver



spin_unlock_bh in ipa3_send unconditionally enable IRQ which is causing
spin_lock_irqsave(&wwan_ptr->lock, flags) in ipa3_wwan_xmit to be broken.
The fix here is to isolate the spin_unlock_bh and spin_lock_irqsave.

Change-Id: I777f643f8789876377d26d0a54c28289df064e40
Signed-off-by: default avatarBojun Pan <bojunp@codeaurora.org>
parent 66e38d99
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -1305,25 +1305,32 @@ static int ipa3_wwan_xmit(struct sk_buff *skb, struct net_device *dev)
	}
	/* IPA_PM checking end */

	/*
	 * increase the outstanding_pkts count first
	 * to avoid suspend happens in parallel
	 * after unlock
	 */
	atomic_inc(&wwan_ptr->outstanding_pkts);
	spin_unlock_irqrestore(&wwan_ptr->lock, flags);

	/*
	 * both data packets and command will be routed to
	 * IPA_CLIENT_Q6_WAN_CONS based on status configuration
	 */
	ret = ipa3_tx_dp(IPA_CLIENT_APPS_WAN_PROD, skb, NULL);
	if (ret) {
		atomic_dec(&wwan_ptr->outstanding_pkts);
		if (ret == -EPIPE) {
			IPAWANERR_RL("[%s] fatal: pipe is not valid\n",
				dev->name);
			dev_kfree_skb_any(skb);
			dev->stats.tx_dropped++;
			spin_unlock_irqrestore(&wwan_ptr->lock, flags);
			return NETDEV_TX_OK;
		}
		ret = NETDEV_TX_BUSY;
		goto out;
	}

	atomic_inc(&wwan_ptr->outstanding_pkts);
	dev->stats.tx_packets++;
	dev->stats.tx_bytes += skb->len;
	ret = NETDEV_TX_OK;
@@ -1333,7 +1340,6 @@ static int ipa3_wwan_xmit(struct sk_buff *skb, struct net_device *dev)
		ipa_pm_deferred_deactivate(rmnet_ipa3_ctx->q6_pm_hdl);

	}
	spin_unlock_irqrestore(&wwan_ptr->lock, flags);
	return ret;
}