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

Commit 151e8f48 authored by Skylar Chang's avatar Skylar Chang
Browse files

msm: ipa3: enable smart prefetch control for GPI



Enable smart prefetch control for GPI channels.
This is done by configuring the channel scratch in GSI.

CRs-Fixed: 1000819
Change-Id: Iac1687b9b26eed715a1055cca295daa7b46f8abd
Acked-by: default avatarAdy Abraham <adya@qti.qualcomm.com>
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent 50c131ed
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3557,6 +3557,7 @@ static int ipa_gsi_setup_channel(struct ipa3_ep_context *ep)
{
	struct gsi_evt_ring_props gsi_evt_ring_props;
	struct gsi_chan_props gsi_channel_props;
	union __packed gsi_channel_scratch ch_scratch;
	struct ipa_gsi_ep_config *gsi_ep_info;
	dma_addr_t dma_addr;
	int result;
@@ -3657,6 +3658,16 @@ static int ipa_gsi_setup_channel(struct ipa3_ep_context *ep)
	if (result != GSI_STATUS_SUCCESS)
		goto fail_alloc_channel;

	memset(&ch_scratch, 0, sizeof(ch_scratch));
	ch_scratch.gpi.max_outstanding_tre = gsi_ep_info->ipa_if_tlv *
		GSI_CHAN_RE_SIZE_16B;
	ch_scratch.gpi.outstanding_threshold = 2 * GSI_CHAN_RE_SIZE_16B;
	result = gsi_write_channel_scratch(ep->gsi_chan_hdl, ch_scratch);
	if (result != GSI_STATUS_SUCCESS) {
		IPAERR("failed to write scratch %d\n", result);
		goto fail_start_channel;
	}

	result = gsi_start_channel(ep->gsi_chan_hdl);
	if (result != GSI_STATUS_SUCCESS)
		goto fail_start_channel;