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

Commit f7ef8f64 authored by Ashok Vuyyuru's avatar Ashok Vuyyuru
Browse files

msm: ipa3: Fix to increase timeout value for send command



Due to freeing the command payload Observing proc error
from IPA HW when HW delayed to process the command. Add
changes to increase timeout value and handling return
value from timeout function.

Change-Id: I0c953a9cc299ffdf1bd8c746a2b60a2107e993ee
Signed-off-by: default avatarAshok Vuyyuru <avuyyuru@codeaurora.org>
parent 7e711cbf
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -5023,6 +5023,18 @@ static void __ipa3_dec_client_disable_clks(void)
	if (ret)
		goto bail;

	/* Send force close coalsecing frame command in LPM mode before taking
	 * mutex lock and otherwise observing race condition.
	 */
	if (atomic_read(&ipa3_ctx->ipa3_active_clients.cnt) == 1 &&
		!ipa3_ctx->tag_process_before_gating) {
		ipa3_force_close_coal();
		/* While sending force close command setting
		 * tag process as true to make configure to
		 * original state
		 */
		ipa3_ctx->tag_process_before_gating = false;
	}
	/* seems like this is the only client holding the clocks */
	mutex_lock(&ipa3_ctx->ipa3_active_clients.mutex);
	if (atomic_read(&ipa3_ctx->ipa3_active_clients.cnt) == 1 &&
+3 −1
Original line number Diff line number Diff line
@@ -718,8 +718,10 @@ int ipa3_send_cmd_timeout(u16 num_desc, struct ipa3_desc *descr, u32 timeout)

	completed = wait_for_completion_timeout(
		&comp->comp, msecs_to_jiffies(timeout));
	if (!completed)
	if (!completed) {
		IPADBG("timeout waiting for imm-cmd ACK\n");
		result = -EBUSY;
	}

	if (atomic_dec_return(&comp->cnt) == 0)
		kfree(comp);
+1 −0
Original line number Diff line number Diff line
@@ -2968,6 +2968,7 @@ int ipa3_set_flt_tuple_mask(int pipe_idx, struct ipahal_reg_hash_tuple *tuple);
int ipa3_set_rt_tuple_mask(int tbl_idx, struct ipahal_reg_hash_tuple *tuple);
void ipa3_set_resorce_groups_min_max_limits(void);
int ipa3_suspend_apps_pipes(bool suspend);
void ipa3_force_close_coal(void);
int ipa3_flt_read_tbl_from_hw(u32 pipe_idx,
	enum ipa_ip_type ip_type,
	bool hashable,
+2 −4
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@

#define IPA_FILT_ROUT_HASH_REG_VAL_v4_2 (0x00000000)
#define IPA_DMA_TASK_FOR_GSI_TIMEOUT_MSEC (15)
#define IPA_COAL_CLOSE_FRAME_CMD_TIMEOUT_MSEC (500)

#define IPA_AGGR_BYTE_LIMIT (\
		IPA_ENDP_INIT_AGGR_N_AGGR_BYTE_LIMIT_BMSK >> \
@@ -7805,7 +7806,7 @@ void ipa3_force_close_coal(void)

	IPADBG("Sending 1 descriptor for coal force close\n");
	if (ipa3_send_cmd_timeout(1, &desc,
		IPA_DMA_TASK_FOR_GSI_TIMEOUT_MSEC)) {
		IPA_COAL_CLOSE_FRAME_CMD_TIMEOUT_MSEC)) {
		IPAERR("ipa3_send_cmd failed\n");
		ipa_assert();
	}
@@ -7816,9 +7817,6 @@ int ipa3_suspend_apps_pipes(bool suspend)
{
	int res;

	if (suspend)
		ipa3_force_close_coal();

	/* As per HPG first need start/stop coalescing channel
	 * then default one. Coalescing client number was greater then
	 * default one so starting the last client.