Quellcode durchsuchen

msm: ipa3: Queue nop desc again if it fails.

Currently during nop desc send, we are setting
nop pending flag to false before queing desc,
due to which we are not able to queue nop desc
again if it fails for first time. Now setting
nop pending flag to false only if we successfully
queued nop desc.

Change-Id: Ice0b3726f2ff0e81c0e5b041346e0ba06619ef62
Signed-off-by: Piyush Dhyani <[email protected]>
Piyush Dhyani vor 3 Jahren
Ursprung
Commit
23f607b8dd
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 4 2
      drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

+ 4 - 2
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

@@ -444,20 +444,22 @@ static void ipa3_send_nop_desc(struct work_struct *work)
 		return;
 		return;
 	}
 	}
 	list_add_tail(&tx_pkt->link, &sys->head_desc_list);
 	list_add_tail(&tx_pkt->link, &sys->head_desc_list);
-	sys->len++;
-	sys->nop_pending = false;
 
 
 	memset(&nop_xfer, 0, sizeof(nop_xfer));
 	memset(&nop_xfer, 0, sizeof(nop_xfer));
 	nop_xfer.type = GSI_XFER_ELEM_NOP;
 	nop_xfer.type = GSI_XFER_ELEM_NOP;
 	nop_xfer.flags = GSI_XFER_FLAG_EOT;
 	nop_xfer.flags = GSI_XFER_FLAG_EOT;
 	nop_xfer.xfer_user_data = tx_pkt;
 	nop_xfer.xfer_user_data = tx_pkt;
 	if (gsi_queue_xfer(sys->ep->gsi_chan_hdl, 1, &nop_xfer, true)) {
 	if (gsi_queue_xfer(sys->ep->gsi_chan_hdl, 1, &nop_xfer, true)) {
+		list_del(&tx_pkt->link);
+		kmem_cache_free(ipa3_ctx->tx_pkt_wrapper_cache, tx_pkt);
 		spin_unlock_bh(&sys->spinlock);
 		spin_unlock_bh(&sys->spinlock);
 		IPAERR("gsi_queue_xfer for ch:%lu failed\n",
 		IPAERR("gsi_queue_xfer for ch:%lu failed\n",
 			sys->ep->gsi_chan_hdl);
 			sys->ep->gsi_chan_hdl);
 		queue_work(sys->wq, &sys->work);
 		queue_work(sys->wq, &sys->work);
 		return;
 		return;
 	}
 	}
+	sys->len++;
+	sys->nop_pending = false;
 	spin_unlock_bh(&sys->spinlock);
 	spin_unlock_bh(&sys->spinlock);
 
 
 	/* make sure TAG process is sent before clocks are gated */
 	/* make sure TAG process is sent before clocks are gated */