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

Commit fb482e5f authored by Skylar Chang's avatar Skylar Chang Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: schedule nop only once



Make sure that sending a TX NOP packet is happening
only after sending a least one regular packet.

Change-Id: I2028249e3b6748d84d89dd0c48744a769eba2547
CRs-Fixed: 2173282
Acked-by: default avatarAdy Abraham <adya@qti.qualcomm.com>
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent 17e77f21
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -221,7 +221,13 @@ static void ipa3_send_nop_desc(struct work_struct *work)
	tx_pkt->no_unmap_dma = true;
	tx_pkt->sys = sys;
	spin_lock_bh(&sys->spinlock);
	if (unlikely(!sys->nop_pending)) {
		spin_unlock_bh(&sys->spinlock);
		kmem_cache_free(ipa3_ctx->tx_pkt_wrapper_cache, tx_pkt);
		return;
	}
	list_add_tail(&tx_pkt->link, &sys->head_desc_list);
	sys->nop_pending = false;
	spin_unlock_bh(&sys->spinlock);

	memset(&nop_xfer, 0, sizeof(nop_xfer));
@@ -270,6 +276,7 @@ int ipa3_send(struct ipa3_sys_context *sys,
	int result;
	u32 mem_flag = GFP_ATOMIC;
	const struct ipa_gsi_ep_config *gsi_ep_cfg;
	bool send_nop = false;

	if (unlikely(!in_atomic))
		mem_flag = GFP_KERNEL;
@@ -403,10 +410,14 @@ int ipa3_send(struct ipa3_sys_context *sys,
	}
	kfree(gsi_xfer_elem_array);

	if (sys->use_comm_evt_ring && !sys->nop_pending) {
		sys->nop_pending = true;
		send_nop = true;
	}
	spin_unlock_bh(&sys->spinlock);

	/* set the timer for sending the NOP descriptor */
	if (sys->use_comm_evt_ring && !hrtimer_active(&sys->db_timer)) {
	if (send_nop) {
		ktime_t time = ktime_set(0, IPA_TX_SEND_COMPL_NOP_DELAY_NS);

		IPADBG_LOW("scheduling timer for ch %lu\n",
+1 −0
Original line number Diff line number Diff line
@@ -641,6 +641,7 @@ struct ipa3_sys_context {
	struct delayed_work switch_to_intr_work;
	enum ipa3_sys_pipe_policy policy;
	bool use_comm_evt_ring;
	bool nop_pending;
	int (*pyld_hdlr)(struct sk_buff *skb, struct ipa3_sys_context *sys);
	struct sk_buff * (*get_skb)(unsigned int len, gfp_t flags);
	void (*free_skb)(struct sk_buff *skb);