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

Commit bd4ddc85 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: flush the desc before feeding"

parents f260e852 aab773f8
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -293,6 +293,8 @@ int ipa_send_one(struct ipa_sys_context *sys, struct ipa_desc *desc,
	dma_addr_t dma_address;
	u16 len;
	u32 mem_flag = GFP_ATOMIC;
	struct sps_iovec iov;
	int ret;

	if (unlikely(!in_atomic))
		mem_flag = GFP_KERNEL;
@@ -345,6 +347,17 @@ int ipa_send_one(struct ipa_sys_context *sys, struct ipa_desc *desc,

	spin_lock_bh(&sys->spinlock);
	list_add_tail(&tx_pkt->link, &sys->head_desc_list);
	if (sys->policy == IPA_POLICY_NOINTR_MODE) {
		do {
			ret = sps_get_iovec(sys->ep->ep_hdl, &iov);
			if (ret) {
				IPADBG("sps_get_iovec failed %d\n", ret);
				break;
			}
			if ((iov.addr == 0x0) && (iov.size == 0x0))
				break;
		} while (1);
	}
	result = sps_transfer_one(sys->ep->ep_hdl, dma_address, len, tx_pkt,
			sps_flags);
	if (result) {
@@ -400,6 +413,8 @@ int ipa_send(struct ipa_sys_context *sys, u32 num_desc, struct ipa_desc *desc,
	int fail_dma_wrap = 0;
	uint size = num_desc * sizeof(struct sps_iovec);
	u32 mem_flag = GFP_ATOMIC;
	struct sps_iovec iov;
	int ret;

	if (unlikely(!in_atomic))
		mem_flag = GFP_KERNEL;
@@ -510,6 +525,17 @@ int ipa_send(struct ipa_sys_context *sys, u32 num_desc, struct ipa_desc *desc,
		}
	}

	if (sys->policy == IPA_POLICY_NOINTR_MODE) {
		do {
			ret = sps_get_iovec(sys->ep->ep_hdl, &iov);
			if (ret) {
				IPADBG("sps_get_iovec failed %d\n", ret);
				break;
			}
			if ((iov.addr == 0x0) && (iov.size == 0x0))
				break;
		} while (1);
	}
	result = sps_transfer(sys->ep->ep_hdl, &transfer);
	if (result) {
		IPAERR("sps_transfer failed rc=%d\n", result);