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

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

Merge "ipa: fix ipa3_send_nop_desc locking before alloc"

parents c81a5ae5 cf105577
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -313,6 +313,7 @@ static void ipa3_send_nop_desc(struct work_struct *work)
	IPADBG_LOW("gsi send NOP for ch: %lu\n", sys->ep->gsi_chan_hdl);
	IPADBG_LOW("gsi send NOP for ch: %lu\n", sys->ep->gsi_chan_hdl);
	if (atomic_read(&sys->workqueue_flushed))
	if (atomic_read(&sys->workqueue_flushed))
		return;
		return;

	spin_lock_bh(&sys->spinlock);
	spin_lock_bh(&sys->spinlock);
	if (!list_empty(&sys->avail_tx_wrapper_list)) {
	if (!list_empty(&sys->avail_tx_wrapper_list)) {
		tx_pkt = list_first_entry(&sys->avail_tx_wrapper_list,
		tx_pkt = list_first_entry(&sys->avail_tx_wrapper_list,
@@ -321,8 +322,10 @@ static void ipa3_send_nop_desc(struct work_struct *work)
		sys->avail_tx_wrapper--;
		sys->avail_tx_wrapper--;
		memset(tx_pkt, 0, sizeof(struct ipa3_tx_pkt_wrapper));
		memset(tx_pkt, 0, sizeof(struct ipa3_tx_pkt_wrapper));
	} else {
	} else {
		spin_unlock_bh(&sys->spinlock);
		tx_pkt = kmem_cache_zalloc(ipa3_ctx->tx_pkt_wrapper_cache,
		tx_pkt = kmem_cache_zalloc(ipa3_ctx->tx_pkt_wrapper_cache,
			GFP_KERNEL);
			GFP_KERNEL);
		spin_lock_bh(&sys->spinlock);
	}
	}
	if (!tx_pkt) {
	if (!tx_pkt) {
		spin_unlock_bh(&sys->spinlock);
		spin_unlock_bh(&sys->spinlock);
@@ -358,7 +361,6 @@ static void ipa3_send_nop_desc(struct work_struct *work)


	/* make sure TAG process is sent before clocks are gated */
	/* make sure TAG process is sent before clocks are gated */
	ipa3_ctx->tag_process_before_gating = true;
	ipa3_ctx->tag_process_before_gating = true;

}
}




@@ -566,7 +568,6 @@ int ipa3_send(struct ipa3_sys_context *sys,


	/* set the timer for sending the NOP descriptor */
	/* set the timer for sending the NOP descriptor */
	if (send_nop) {
	if (send_nop) {

		ktime_t time = ktime_set(0, IPA_TX_SEND_COMPL_NOP_DELAY_NS);
		ktime_t time = ktime_set(0, IPA_TX_SEND_COMPL_NOP_DELAY_NS);


		IPADBG_LOW("scheduling timer for ch %lu\n",
		IPADBG_LOW("scheduling timer for ch %lu\n",