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

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

Merge "msm: ipa3: Do not wait for IPA DMA_TASK H/W ACK for GSI"

parents b62cdfdb 70eb8339
Loading
Loading
Loading
Loading
+35 −2
Original line number Diff line number Diff line
@@ -776,11 +776,29 @@ static void ipa3_transport_irq_cmd_ack(void *user1, int user2)
 * for this function.
 */
int ipa3_send_cmd(u16 num_desc, struct ipa3_desc *descr)
{
	return ipa3_send_cmd_timeout(num_desc, descr, 0);
}

/**
 * ipa3_send_cmd_timeout - send immediate commands with limited time
 *	waiting for ACK from IPA HW
 * @num_desc:	number of descriptors within the desc struct
 * @descr:	descriptor structure
 * @timeout:	millisecond to wait till get ACK from IPA HW
 *
 * Function will block till command gets ACK from IPA HW or timeout.
 * Caller needs to free any resources it allocated after function returns
 * The callback in ipa3_desc should not be set by the caller
 * for this function.
 */
int ipa3_send_cmd_timeout(u16 num_desc, struct ipa3_desc *descr, u32 timeout)
{
	struct ipa3_desc *desc;
	int i, result = 0;
	struct ipa3_sys_context *sys;
	int ep_idx;
	int completed;

	for (i = 0; i < num_desc; i++)
		IPADBG("sending imm cmd %d\n", descr[i].opcode);
@@ -807,7 +825,14 @@ int ipa3_send_cmd(u16 num_desc, struct ipa3_desc *descr)
			result = -EFAULT;
			goto bail;
		}
		if (timeout) {
			completed = wait_for_completion_timeout(
				&descr->xfer_done, msecs_to_jiffies(timeout));
			if (!completed)
				IPADBG("timeout waiting for imm-cmd ACK\n");
		} else {
			wait_for_completion(&descr->xfer_done);
		}
	} else {
		desc = &descr[num_desc - 1];
		init_completion(&desc->xfer_done);
@@ -822,9 +847,17 @@ int ipa3_send_cmd(u16 num_desc, struct ipa3_desc *descr)
			result = -EFAULT;
			goto bail;
		}
		if (timeout) {
			completed = wait_for_completion_timeout(
				&desc->xfer_done, msecs_to_jiffies(timeout));
			if (!completed)
				IPADBG("timeout waiting for imm-cmd ACK\n");
		} else {
			wait_for_completion(&desc->xfer_done);
		}

	}

bail:
	IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
	return result;
+1 −0
Original line number Diff line number Diff line
@@ -1820,6 +1820,7 @@ void ipa3_dump_buff_internal(void *base, dma_addr_t phy_base, u32 size);
int ipa3_controller_static_bind(struct ipa3_controller *controller,
		enum ipa_hw_type ipa_hw_type);
int ipa3_cfg_route(struct ipahal_reg_route *route);
int ipa3_send_cmd_timeout(u16 num_desc, struct ipa3_desc *descr, u32 timeout);
int ipa3_send_cmd(u16 num_desc, struct ipa3_desc *descr);
int ipa3_cfg_filter(u32 disable);
int ipa3_pipe_mem_init(u32 start_ofst, u32 size);
+5 −2
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@
#define IPA_EOT_COAL_GRAN_MIN (1)
#define IPA_EOT_COAL_GRAN_MAX (16)

#define IPA_DMA_TASK_FOR_GSI_TIMEOUT_MSEC (15)

#define IPA_AGGR_BYTE_LIMIT (\
		IPA_ENDP_INIT_AGGR_N_AGGR_BYTE_LIMIT_BMSK >> \
		IPA_ENDP_INIT_AGGR_N_AGGR_BYTE_LIMIT_SHFT)
@@ -99,7 +101,7 @@
#define IPA_GROUP_DPL		IPA_GROUP_DL
#define IPA_GROUP_DIAG		(2)
#define IPA_GROUP_DMA		(3)
#define IPA_GROUP_IMM_CMD	IPA_GROUP_DMA
#define IPA_GROUP_IMM_CMD	IPA_GROUP_UL
#define IPA_GROUP_Q6ZIP		(4)
#define IPA_GROUP_Q6ZIP_GENERAL	IPA_GROUP_Q6ZIP
#define IPA_GROUP_UC_RX_Q	(5)
@@ -4948,7 +4950,8 @@ int ipa3_inject_dma_task_for_gsi(void)
	desc.type = IPA_IMM_CMD_DESC;

	IPADBG("sending 1B packet to IPA\n");
	if (ipa3_send_cmd(1, &desc)) {
	if (ipa3_send_cmd_timeout(1, &desc,
		IPA_DMA_TASK_FOR_GSI_TIMEOUT_MSEC)) {
		IPAERR("ipa3_send_cmd failed\n");
		return -EFAULT;
	}