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

Commit 171cd0ab authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa3: Fix to avoid setting endpoint delay in IPA 4.2/4.5 HW"

parents e7f223f5 71247e88
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -104,6 +104,8 @@ memory allocation over a PCIe bridge
				control.
- qcom,entire-ipa-block-size: Complete size of the ipa block in which all
				registers, collected upon crash, reside.
- qcom,ipa-endp-delay-wa: Boolean context flag to indicate end point delay work around
				supported or not.

IPA pipe sub nodes (A2 static pipes configurations):

+49 −6
Original line number Diff line number Diff line
@@ -2645,6 +2645,7 @@ void ipa3_q6_pre_shutdown_cleanup(void)

	IPA_ACTIVE_CLIENTS_INC_SIMPLE();

	if (!ipa3_ctx->ipa_endp_delay_wa)
		ipa3_q6_pipe_delay(true);
	ipa3_q6_avoid_holb();
	if (ipa3_ctx->ipa_config_is_mhi)
@@ -2669,12 +2670,20 @@ void ipa3_q6_pre_shutdown_cleanup(void)
	/* Remove delay from Q6 PRODs to avoid pending descriptors
	 * on pipe reset procedure
	 */
	if (!ipa3_ctx->ipa_endp_delay_wa) {
		ipa3_q6_pipe_delay(false);
		ipa3_set_reset_client_prod_pipe_delay(true,
			IPA_CLIENT_USB_PROD);
		if (ipa3_ctx->ipa_config_is_mhi)
			ipa3_set_reset_client_prod_pipe_delay(true,
				IPA_CLIENT_MHI_PROD);
	} else {
		ipa3_start_stop_client_prod_gsi_chnl(IPA_CLIENT_USB_PROD,
						false);
		if (ipa3_ctx->ipa_config_is_mhi)
			ipa3_start_stop_client_prod_gsi_chnl(
					IPA_CLIENT_MHI_PROD, false);
	}

	IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
	IPADBG_LOW("Exit with success\n");
@@ -2737,6 +2746,32 @@ void ipa3_q6_post_shutdown_cleanup(void)
	IPADBG_LOW("Exit with success\n");
}

/*
 * ipa3_client_prod_post_shutdown_cleanup () - As part of this function
 * set end point delay client producer pipes and starting corresponding
 * gsi channels
 */

void ipa3_client_prod_post_shutdown_cleanup(void)
{
	IPADBG_LOW("ENTER\n");

	IPA_ACTIVE_CLIENTS_INC_SIMPLE();

	ipa3_set_reset_client_prod_pipe_delay(true,
				IPA_CLIENT_USB_PROD);
	ipa3_start_stop_client_prod_gsi_chnl(IPA_CLIENT_USB_PROD, true);

	if (ipa3_ctx->ipa_config_is_mhi) {
		ipa3_set_reset_client_prod_pipe_delay(true,
						IPA_CLIENT_MHI_PROD);
		ipa3_start_stop_client_prod_gsi_chnl(IPA_CLIENT_MHI_PROD, true);
	}

	IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
	IPADBG_LOW("Exit with success\n");
}

static inline void ipa3_sram_set_canary(u32 *sram_mmio, int offset)
{
	/* Set 4 bytes of CANARY before the offset */
@@ -5361,6 +5396,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
	    resource_p->do_testbus_collection_on_crash;
	ipa3_ctx->do_non_tn_collection_on_crash =
	    resource_p->do_non_tn_collection_on_crash;
	ipa3_ctx->ipa_endp_delay_wa = resource_p->ipa_endp_delay_wa;

	WARN(ipa3_ctx->ipa3_hw_mode != IPA_HW_MODE_NORMAL,
		"Non NORMAL IPA HW mode, is this emulation platform ?");
@@ -5978,6 +6014,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
	ipa_drv_res->mhi_evid_limits[0] = IPA_MHI_GSI_EVENT_RING_ID_START;
	ipa_drv_res->mhi_evid_limits[1] = IPA_MHI_GSI_EVENT_RING_ID_END;
	ipa_drv_res->ipa_fltrt_not_hashable = false;
	ipa_drv_res->ipa_endp_delay_wa = false;

	/* Get IPA HW Version */
	result = of_property_read_u32(pdev->dev.of_node, "qcom,ipa-hw-ver",
@@ -6063,6 +6100,12 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
	IPADBG(": WDI-2.0 over gsi= %s\n",
			ipa_drv_res->ipa_wdi2_over_gsi
			? "True" : "False");
	ipa_drv_res->ipa_endp_delay_wa =
			of_property_read_bool(pdev->dev.of_node,
			"qcom,ipa-endp-delay-wa");
	IPADBG(": endppoint delay wa = %s\n",
			ipa_drv_res->ipa_endp_delay_wa
			? "True" : "False");

	ipa_drv_res->ipa_wdi3_over_gsi =
			of_property_read_bool(pdev->dev.of_node,
+32 −0
Original line number Diff line number Diff line
@@ -1126,6 +1126,38 @@ int ipa3_set_reset_client_prod_pipe_delay(bool set_reset,
	return result;
}

/*
 * Start/stop the CLIENT PROD pipes in SSR scenarios
 */

int ipa3_start_stop_client_prod_gsi_chnl(enum ipa_client_type client,
		bool start_chnl)
{
	int result = 0;
	int pipe_idx;
	struct ipa3_ep_context *ep;

	if (IPA_CLIENT_IS_CONS(client)) {
		IPAERR("client (%d) not PROD\n", client);
		return -EINVAL;
	}

	pipe_idx = ipa3_get_ep_mapping(client);

	if (pipe_idx == IPA_EP_NOT_ALLOCATED) {
		IPAERR("client (%d) not valid\n", client);
		return -EINVAL;
	}

	client_lock_unlock_cb(pipe_idx, true);
	ep = &ipa3_ctx->ep[pipe_idx];
	if (start_chnl)
		result = ipa3_start_gsi_channel(pipe_idx);
	else
		result = ipa3_stop_gsi_channel(pipe_idx);
	client_lock_unlock_cb(pipe_idx, false);
	return result;
}
int ipa3_set_reset_client_cons_pipe_sus_holb(bool set_reset,
		enum ipa_client_type client)
{
+7 −0
Original line number Diff line number Diff line
@@ -1625,6 +1625,7 @@ struct ipa3_context {
	bool ipa_wdi2;
	bool ipa_wdi2_over_gsi;
	bool ipa_wdi3_over_gsi;
	bool ipa_endp_delay_wa;
	bool ipa_fltrt_not_hashable;
	bool use_64_bit_dma_mask;
	/* featurize if memory footprint becomes a concern */
@@ -1743,6 +1744,7 @@ struct ipa3_plat_drv_res {
	bool do_register_collection_on_crash;
	bool do_testbus_collection_on_crash;
	bool do_non_tn_collection_on_crash;
	bool ipa_endp_delay_wa;
};

/**
@@ -2024,6 +2026,11 @@ void ipa3_register_lock_unlock_callback(int (*client_cb)(bool), u32 ipa_ep_idx);
void ipa3_deregister_lock_unlock_callback(u32 ipa_ep_idx);
int ipa3_set_reset_client_prod_pipe_delay(bool set_reset,
		enum ipa_client_type client);
int ipa3_start_stop_client_prod_gsi_chnl(enum ipa_client_type client,
		bool start_chnl);
void ipa3_client_prod_post_shutdown_cleanup(void);


int ipa3_set_reset_client_cons_pipe_sus_holb(bool set_reset,
		enum ipa_client_type client);

+4 −0
Original line number Diff line number Diff line
@@ -2855,6 +2855,10 @@ static int ipa3_lcl_mdm_ssr_notifier_cb(struct notifier_block *this,
		if (atomic_read(&rmnet_ipa3_ctx->is_ssr) &&
			ipa3_ctx->ipa_hw_type < IPA_HW_v4_0)
			ipa3_q6_post_shutdown_cleanup();

		if (ipa3_ctx->ipa_endp_delay_wa)
			ipa3_client_prod_post_shutdown_cleanup();

		IPAWANINFO("IPA AFTER_SHUTDOWN handling is complete\n");
		break;
	case SUBSYS_BEFORE_POWERUP: