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

Commit d0ea932c authored by Ghanim Fodi's avatar Ghanim Fodi
Browse files

Update IPA and GSI driver techpack snapshot



Upate the driver to msm-5.4 kernel snapshot as of
'commit <e1007d06> ("sched/fair: consider uclamp
 boost while deciding the start_cpu")'.

Change-Id: If63ae521dd26cbf72514cd0b95acfe38ed68cf82
Signed-off-by: default avatarGhanim Fodi <gfodi@codeaurora.org>
parent 2bf0baa5
Loading
Loading
Loading
Loading
+17 −14
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/mutex.h>
@@ -1590,6 +1590,17 @@ static int ipa3_usb_xdci_connect_internal(
		return result;
	}

	/* Start MHIP UL channel before starting USB UL channel
	 * DL channel will be started when voting for PCIe -> LPM Exit.
	 */
	if (ipa3_is_mhip_offload_enabled()) {
		result = ipa_mpm_mhip_xdci_pipe_enable(params->teth_prot);
		if (result) {
			IPA_USB_ERR("failed to enable MHIP UL channel\n");
			goto connect_fail;
		}
	}

	if (params->teth_prot != IPA_USB_DIAG) {
		/* Start UL channel */
		result = ipa3_xdci_start(params->usb_to_ipa_clnt_hdl,
@@ -1610,20 +1621,11 @@ static int ipa3_usb_xdci_connect_internal(
		goto connect_dl_fail;
	}

	/* MHIP pipe enablement */
	if (ipa3_is_mhip_offload_enabled()) {
		result = ipa_mpm_mhip_xdci_pipe_enable(params->teth_prot);
		if (result) {
			IPA_USB_ERR("failed to enable MHIP channel\n");
			goto connect_teth_prot_fail;
		}
	}

	/* Connect tethering protocol */
	result = ipa3_usb_connect_teth_prot(params->teth_prot);
	if (result) {
		IPA_USB_ERR("failed to connect teth protocol\n");
		goto connect_mhip_prot_fail;
		goto connect_teth_prot_fail;
	}

	if (!ipa3_usb_set_state(IPA_USB_CONNECTED, false, ttype)) {
@@ -1637,9 +1639,6 @@ static int ipa3_usb_xdci_connect_internal(

state_change_connected_fail:
	ipa3_usb_disconnect_teth_prot(params->teth_prot);
connect_mhip_prot_fail:
	if (ipa3_is_mhip_offload_enabled())
		ipa_mpm_mhip_xdci_pipe_disable(params->teth_prot);
connect_teth_prot_fail:
	ipa3_xdci_disconnect(params->ipa_to_usb_clnt_hdl, false, -1);
	ipa3_reset_gsi_channel(params->ipa_to_usb_clnt_hdl);
@@ -1651,8 +1650,12 @@ static int ipa3_usb_xdci_connect_internal(
		ipa3_reset_gsi_event_ring(params->usb_to_ipa_clnt_hdl);
	}
connect_ul_fail:
	if (ipa3_is_mhip_offload_enabled())
		ipa_mpm_mhip_xdci_pipe_disable(params->teth_prot);
connect_fail:
		ipa_pm_deactivate_sync(
			ipa3_usb_ctx->ttype_ctx[ttype].pm_ctx.hdl);

	return result;
}

+8 −7
Original line number Diff line number Diff line
@@ -3862,22 +3862,23 @@ int _ipa_init_sram_v3(void)
	if (ipa_get_hw_type() >= IPA_HW_v4_5) {
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(nat_tbl_ofst) - 12);
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(nat_tbl_ofst) - 8);
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(nat_tbl_ofst) - 4);
		ipa3_sram_set_canary(ipa_sram_mmio, IPA_MEM_PART(nat_tbl_ofst));
	}
	if (ipa_get_hw_type() >= IPA_HW_v4_0) {
		if (ipa_get_hw_type() < IPA_HW_v4_5) {
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(pdn_config_ofst) - 4);
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(pdn_config_ofst));
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(stats_quota_ofst) - 4);
				IPA_MEM_PART(stats_quota_q6_ofst) - 4);
		ipa3_sram_set_canary(ipa_sram_mmio,
				IPA_MEM_PART(stats_quota_q6_ofst));
		} else {
			ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(stats_quota_ofst));
				IPA_MEM_PART(stats_quota_q6_ofst) - 12);
	}
	}

	if (ipa_get_hw_type() <= IPA_HW_v3_5 ||
		ipa_get_hw_type() >= IPA_HW_v4_5) {
		ipa3_sram_set_canary(ipa_sram_mmio,
+3 −1
Original line number Diff line number Diff line
@@ -1427,6 +1427,7 @@ static ssize_t ipa3_read_stats(struct file *file, char __user *ubuf,
		"lan_repl_rx_empty=%u\n"
		"flow_enable=%u\n"
		"flow_disable=%u\n",
		"rx_page_drop_cnt=%u\n",
		ipa3_ctx->stats.tx_sw_pkts,
		ipa3_ctx->stats.tx_hw_pkts,
		ipa3_ctx->stats.tx_non_linear,
@@ -1442,7 +1443,8 @@ static ssize_t ipa3_read_stats(struct file *file, char __user *ubuf,
		ipa3_ctx->stats.lan_rx_empty,
		ipa3_ctx->stats.lan_repl_rx_empty,
		ipa3_ctx->stats.flow_enable,
		ipa3_ctx->stats.flow_disable);
		ipa3_ctx->stats.flow_disable,
		ipa3_ctx->stats.rx_page_drop_cnt);
	cnt += nbytes;

	for (i = 0; i < IPAHAL_PKT_STATUS_EXCEPTION_MAX; i++) {
+21 −6
Original line number Diff line number Diff line
@@ -3398,10 +3398,17 @@ static struct sk_buff *handle_page_completion(struct gsi_chan_xfer_notify
		IPAERR("update_truesize not supported\n");

	if (notify->veid >= GSI_VEID_MAX) {
		rx_pkt->sys->free_rx_wrapper(rx_pkt);
		if (!rx_page.is_tmp_alloc)
			init_page_count(rx_page.page);
		IPAERR("notify->veid > GSI_VEID_MAX\n");
		if (!rx_page.is_tmp_alloc) {
			init_page_count(rx_page.page);
		} else {
			dma_unmap_page(ipa3_ctx->pdev, rx_page.dma_addr,
					rx_pkt->len, DMA_FROM_DEVICE);
			__free_pages(rx_pkt->page_data.page,
							IPA_WAN_PAGE_ORDER);
		}
		rx_pkt->sys->free_rx_wrapper(rx_pkt);
		IPA_STATS_INC_CNT(ipa3_ctx->stats.rx_page_drop_cnt);
		return NULL;
	}

@@ -3415,10 +3422,18 @@ static struct sk_buff *handle_page_completion(struct gsi_chan_xfer_notify
		sys->ep->client == IPA_CLIENT_APPS_LAN_CONS) {
		rx_skb = alloc_skb(0, GFP_ATOMIC);
		if (unlikely(!rx_skb)) {
			rx_pkt->sys->free_rx_wrapper(rx_pkt);
			if (!rx_page.is_tmp_alloc)
				init_page_count(rx_page.page);
			IPAERR("skb alloc failure\n");
			list_del(&rx_pkt->link);
			if (!rx_page.is_tmp_alloc) {
				init_page_count(rx_page.page);
			} else {
				dma_unmap_page(ipa3_ctx->pdev, rx_page.dma_addr,
					rx_pkt->len, DMA_FROM_DEVICE);
				__free_pages(rx_pkt->page_data.page,
							IPA_WAN_PAGE_ORDER);
			}
			rx_pkt->sys->free_rx_wrapper(rx_pkt);
			IPA_STATS_INC_CNT(ipa3_ctx->stats.rx_page_drop_cnt);
			return NULL;
		}
	/* go over the list backward to save computations on updating length */
+26 −7
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/debugfs.h>
@@ -271,6 +271,27 @@ static void ipa_close_coal_frame(struct ipahal_imm_cmd_pyld **coal_cmd_pyld)
		&reg_write_coal_close, false);
}

static bool ipa_validate_quota_stats_sram_size(u32 needed_len)
{
	u32 sram_size;

	/* Starting IPA4.5 Quota stats is split between Q6 and AP */

	if (ipa3_ctx->ipa_hw_type < IPA_HW_v4_5) {
		IPAERR("Not supported ipa_ver=%d\n", ipa3_ctx->ipa_hw_type);
		return false;
	}

	sram_size = IPA_MEM_PART(stats_quota_ap_size);
	if (needed_len > sram_size) {
		IPAERR("SRAM partition too small: %u needed %u\n",
			sram_size, needed_len);
		return false;
	}

	return true;
}

int ipa_init_quota_stats(u32 pipe_bitmask)
{
	struct ipahal_stats_init_pyld *pyld;
@@ -301,9 +322,7 @@ int ipa_init_quota_stats(u32 pipe_bitmask)
		return -EPERM;
	}

	if (pyld->len > IPA_MEM_PART(stats_quota_size)) {
		IPAERR("SRAM partition too small: %d needed %d\n",
			IPA_MEM_PART(stats_quota_size), pyld->len);
	if (!ipa_validate_quota_stats_sram_size(pyld->len)) {
		ret = -EPERM;
		goto destroy_init_pyld;
	}
@@ -356,7 +375,7 @@ int ipa_init_quota_stats(u32 pipe_bitmask)
	quota_base.offset = ipahal_get_reg_n_ofst(IPA_STAT_QUOTA_BASE_n,
		ipa3_ctx->ee);
	quota_base.value = ipa3_ctx->smem_restricted_bytes +
		IPA_MEM_PART(stats_quota_ofst);
		IPA_MEM_PART(stats_quota_ap_ofst);
	quota_base.value_mask = ~0;
	quota_base_pyld = ipahal_construct_imm_cmd(IPA_IMM_CMD_REGISTER_WRITE,
		&quota_base, false);
@@ -377,7 +396,7 @@ int ipa_init_quota_stats(u32 pipe_bitmask)
	cmd.size = pyld->len;
	cmd.system_addr = dma_address;
	cmd.local_addr = ipa3_ctx->smem_restricted_bytes +
			IPA_MEM_PART(stats_quota_ofst);
		IPA_MEM_PART(stats_quota_ap_ofst);
	cmd_pyld = ipahal_construct_imm_cmd(
		IPA_IMM_CMD_DMA_SHARED_MEM, &cmd, false);
	if (!cmd_pyld) {
@@ -476,7 +495,7 @@ int ipa_get_quota_stats(struct ipa_quota_stats_all *out)
	cmd.size = mem.size;
	cmd.system_addr = mem.phys_base;
	cmd.local_addr = ipa3_ctx->smem_restricted_bytes +
		IPA_MEM_PART(stats_quota_ofst) + offset.offset;
		IPA_MEM_PART(stats_quota_ap_ofst) + offset.offset;
	cmd_pyld[num_cmd] = ipahal_construct_imm_cmd(
		IPA_IMM_CMD_DMA_SHARED_MEM, &cmd, false);
	if (!cmd_pyld[num_cmd]) {
Loading