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

Commit 22fb0315 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: add ipc logging for ipa driver"

parents 74240891 102160e0
Loading
Loading
Loading
Loading
+40 −19
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@

#define IPA_TRANSPORT_PROD_TIMEOUT_MSEC 100

#define IPA_IPC_LOG_PAGES 50

#define IPA3_ACTIVE_CLIENTS_TABLE_BUF_SIZE 2048

#define IPA3_ACTIVE_CLIENT_LOG_TYPE_EP 0
@@ -498,7 +500,7 @@ static int ipa3_open(struct inode *inode, struct file *filp)
{
	struct ipa3_context *ctx = NULL;

	IPADBG("ENTER\n");
	IPADBG_LOW("ENTER\n");
	ctx = container_of(inode->i_cdev, struct ipa3_context, cdev);
	filp->private_data = ctx;

@@ -2917,11 +2919,11 @@ static int ipa3_get_clks(struct device *dev)
 */
void _ipa_enable_clks_v3_0(void)
{
	IPADBG("enabling gcc_ipa_clk\n");
	IPADBG_LOW("enabling gcc_ipa_clk\n");
	if (ipa3_clk) {
		clk_prepare(ipa3_clk);
		clk_enable(ipa3_clk);
		IPADBG("curr_ipa_clk_rate=%d", ipa3_ctx->curr_ipa_clk_rate);
		IPADBG_LOW("curr_ipa_clk_rate=%d", ipa3_ctx->curr_ipa_clk_rate);
		clk_set_rate(ipa3_clk, ipa3_ctx->curr_ipa_clk_rate);
		ipa3_uc_notify_clk_state(true);
	} else {
@@ -2981,7 +2983,7 @@ void ipa3_enable_clks(void)
 */
void _ipa_disable_clks_v3_0(void)
{
	IPADBG("disabling gcc_ipa_clk\n");
	IPADBG_LOW("disabling gcc_ipa_clk\n");
	ipa3_suspend_apps_pipes(true);
	ipa3_uc_notify_clk_state(false);
	if (ipa3_clk)
@@ -3141,7 +3143,7 @@ void ipa3_inc_client_enable_clks(struct ipa3_active_client_logging_info *id)
	ipa3_ctx->ipa3_active_clients.cnt++;
	if (ipa3_ctx->ipa3_active_clients.cnt == 1)
		ipa3_enable_clks();
	IPADBG("active clients = %d\n", ipa3_ctx->ipa3_active_clients.cnt);
	IPADBG_LOW("active clients = %d\n", ipa3_ctx->ipa3_active_clients.cnt);
	ipa3_active_clients_unlock();
}

@@ -3168,7 +3170,7 @@ int ipa3_inc_client_enable_clks_no_block(struct ipa3_active_client_logging_info
	}
	ipa3_active_clients_log_inc(id, true);
	ipa3_ctx->ipa3_active_clients.cnt++;
	IPADBG("active clients = %d\n", ipa3_ctx->ipa3_active_clients.cnt);
	IPADBG_LOW("active clients = %d\n", ipa3_ctx->ipa3_active_clients.cnt);
bail:
	ipa3_active_clients_trylock_unlock(&flags);

@@ -3193,7 +3195,7 @@ void ipa3_dec_client_disable_clks(struct ipa3_active_client_logging_info *id)
	ipa3_active_clients_lock();
	ipa3_active_clients_log_dec(id, false);
	ipa3_ctx->ipa3_active_clients.cnt--;
	IPADBG("active clients = %d\n", ipa3_ctx->ipa3_active_clients.cnt);
	IPADBG_LOW("active clients = %d\n", ipa3_ctx->ipa3_active_clients.cnt);
	if (ipa3_ctx->ipa3_active_clients.cnt == 0) {
		if (ipa3_ctx->tag_process_before_gating) {
			ipa3_ctx->tag_process_before_gating = false;
@@ -3228,7 +3230,7 @@ void ipa3_inc_acquire_wakelock(void)
	ipa3_ctx->wakelock_ref_cnt.cnt++;
	if (ipa3_ctx->wakelock_ref_cnt.cnt == 1)
		__pm_stay_awake(&ipa3_ctx->w_lock);
	IPADBG("active wakelock ref cnt = %d\n",
	IPADBG_LOW("active wakelock ref cnt = %d\n",
		ipa3_ctx->wakelock_ref_cnt.cnt);
	spin_unlock_irqrestore(&ipa3_ctx->wakelock_ref_cnt.spinlock, flags);
}
@@ -3247,7 +3249,7 @@ void ipa3_dec_release_wakelock(void)

	spin_lock_irqsave(&ipa3_ctx->wakelock_ref_cnt.spinlock, flags);
	ipa3_ctx->wakelock_ref_cnt.cnt--;
	IPADBG("active wakelock ref cnt = %d\n",
	IPADBG_LOW("active wakelock ref cnt = %d\n",
		ipa3_ctx->wakelock_ref_cnt.cnt);
	if (ipa3_ctx->wakelock_ref_cnt.cnt == 0)
		__pm_relax(&ipa3_ctx->w_lock);
@@ -3260,7 +3262,7 @@ int ipa3_set_required_perf_profile(enum ipa_voltage_level floor_voltage,
	enum ipa_voltage_level needed_voltage;
	u32 clk_rate;

	IPADBG("floor_voltage=%d, bandwidth_mbps=%u",
	IPADBG_LOW("floor_voltage=%d, bandwidth_mbps=%u",
					floor_voltage, bandwidth_mbps);

	if (floor_voltage < IPA_VOLTAGE_UNSPECIFIED ||
@@ -3270,7 +3272,7 @@ int ipa3_set_required_perf_profile(enum ipa_voltage_level floor_voltage,
	}

	if (ipa3_ctx->enable_clock_scaling) {
		IPADBG("Clock scaling is enabled\n");
		IPADBG_LOW("Clock scaling is enabled\n");
		if (bandwidth_mbps >=
			ipa3_ctx->ctrl->clock_scaling_bw_threshold_turbo)
			needed_voltage = IPA_VOLTAGE_TURBO;
@@ -3280,7 +3282,7 @@ int ipa3_set_required_perf_profile(enum ipa_voltage_level floor_voltage,
		else
			needed_voltage = IPA_VOLTAGE_SVS;
	} else {
		IPADBG("Clock scaling is disabled\n");
		IPADBG_LOW("Clock scaling is disabled\n");
		needed_voltage = IPA_VOLTAGE_NOMINAL;
	}

@@ -3302,13 +3304,13 @@ int ipa3_set_required_perf_profile(enum ipa_voltage_level floor_voltage,
	}

	if (clk_rate == ipa3_ctx->curr_ipa_clk_rate) {
		IPADBG("Same voltage\n");
		IPADBG_LOW("Same voltage\n");
		return 0;
	}

	ipa3_active_clients_lock();
	ipa3_ctx->curr_ipa_clk_rate = clk_rate;
	IPADBG("setting clock rate to %u\n", ipa3_ctx->curr_ipa_clk_rate);
	IPADBG_LOW("setting clock rate to %u\n", ipa3_ctx->curr_ipa_clk_rate);
	if (ipa3_ctx->ipa3_active_clients.cnt > 0) {
		clk_set_rate(ipa3_clk, ipa3_ctx->curr_ipa_clk_rate);
		if (ipa3_ctx->ipa3_hw_mode != IPA_HW_MODE_VIRTUAL)
@@ -3316,10 +3318,10 @@ int ipa3_set_required_perf_profile(enum ipa_voltage_level floor_voltage,
			    ipa3_ctx->ipa_bus_hdl, ipa3_get_bus_vote()))
				WARN_ON(1);
	} else {
		IPADBG("clocks are gated, not setting rate\n");
		IPADBG_LOW("clocks are gated, not setting rate\n");
	}
	ipa3_active_clients_unlock();
	IPADBG("Done\n");
	IPADBG_LOW("Done\n");
	return 0;
}

@@ -3349,7 +3351,8 @@ void ipa3_suspend_handler(enum ipa_irq_type interrupt,
	int res;
	struct ipa_ep_cfg_holb holb_cfg;

	IPADBG("interrupt=%d, interrupt_data=%u\n", interrupt, suspend_data);
	IPADBG("interrupt=%d, interrupt_data=%u\n",
		interrupt, suspend_data);
	memset(&holb_cfg, 0, sizeof(holb_cfg));
	holb_cfg.tmr_val = 0;

@@ -3365,8 +3368,8 @@ void ipa3_suspend_handler(enum ipa_irq_type interrupt,
					) {
					IPA_ACTIVE_CLIENTS_INC_EP(
						ipa3_ctx->ep[i].client);
					IPADBG("Pipes un-suspended.\n");
					IPADBG("Enter poll mode.\n");
					IPADBG_LOW("Pipes un-suspended.\n");
					IPADBG_LOW("Enter poll mode.\n");
					atomic_set(
					&ipa3_ctx->transport_pm.dec_clients,
					1);
@@ -3858,6 +3861,20 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
		goto fail_mem_ctx;
	}

	ipa3_ctx->logbuf = ipc_log_context_create(IPA_IPC_LOG_PAGES, "ipa", 0);
	if (ipa3_ctx->logbuf == NULL) {
		IPAERR("failed to get logbuf\n");
		result = -ENOMEM;
		goto fail_logbuf;
	}
	ipa3_ctx->logbuf_low =
		ipc_log_context_create(IPA_IPC_LOG_PAGES, "ipa_low", 0);
	if (ipa3_ctx->logbuf_low == NULL) {
		IPAERR("failed to get logbuf_low\n");
		result = -ENOMEM;
		goto fail_logbuf_low;
	}

	ipa3_ctx->pdev = ipa_dev;
	ipa3_ctx->uc_pdev = ipa_dev;
	ipa3_ctx->smmu_present = smmu_present;
@@ -4332,6 +4349,10 @@ fail_bus_reg:
fail_bind:
	kfree(ipa3_ctx->ctrl);
fail_mem_ctrl:
	ipc_log_context_destroy(ipa3_ctx->logbuf_low);
fail_logbuf_low:
	ipc_log_context_destroy(ipa3_ctx->logbuf);
fail_logbuf:
	kfree(ipa3_ctx);
	ipa3_ctx = NULL;
fail_mem_ctx:
+7 −0
Original line number Diff line number Diff line
@@ -2010,6 +2010,13 @@ void ipa3_debugfs_init(void)
		goto fail;
	}

	file = debugfs_create_u32("enable_low_prio_print", read_write_mode,
		dent, &ipa3_ctx->enable_low_prio_print);
	if (!file) {
		IPAERR("could not create enable_low_prio_print file\n");
		goto fail;
	}

	return;

fail:
+60 −56
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -89,7 +89,7 @@ static void ipa3_wq_write_done_common(struct ipa3_sys_context *sys,
	int i, cnt;

	cnt = tx_pkt->cnt;
	IPADBG("cnt: %d\n", cnt);
	IPADBG_LOW("cnt: %d\n", cnt);
	for (i = 0; i < cnt; i++) {
		spin_lock_bh(&sys->spinlock);
		if (unlikely(list_empty(&sys->head_desc_list))) {
@@ -359,7 +359,7 @@ int ipa3_send_one(struct ipa3_sys_context *sys, struct ipa3_desc *desc,
		if (desc->type == IPA_IMM_CMD_DESC) {
			sps_flags |= SPS_IOVEC_FLAG_IMME;
			len = desc->opcode;
			IPADBG("sending cmd=%d pyld_len=%d sps_flags=%x\n",
			IPADBG_LOW("sending cmd=%d pyld_len=%d sps_flags=%x\n",
					desc->opcode, desc->len, sps_flags);
			IPA_DUMP_BUFF(desc->pyld, dma_address, desc->len);
		} else {
@@ -676,7 +676,7 @@ static void ipa3_transport_irq_cmd_ack(void *user1, int user2)
		WARN_ON(1);
		return;
	}
	IPADBG("got ack for cmd=%d\n", desc->opcode);
	IPADBG_LOW("got ack for cmd=%d\n", desc->opcode);
	complete(&desc->xfer_done);
}

@@ -693,11 +693,12 @@ static void ipa3_transport_irq_cmd_ack(void *user1, int user2)
int ipa3_send_cmd(u16 num_desc, struct ipa3_desc *descr)
{
	struct ipa3_desc *desc;
	int result = 0;
	int i, result = 0;
	struct ipa3_sys_context *sys;
	int ep_idx;

	IPADBG("sending command\n");
	for (i = 0; i < num_desc; i++)
		IPADBG("sending imm cmd %d\n", descr[i].opcode);

	ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_CMD_PROD);
	if (-1 == ep_idx) {
@@ -757,7 +758,7 @@ static void ipa3_sps_irq_tx_notify(struct sps_event_notify *notify)
	struct ipa3_sys_context *sys = (struct ipa3_sys_context *)notify->user;
	int ret;

	IPADBG("event %d notified\n", notify->event_id);
	IPADBG_LOW("event %d notified\n", notify->event_id);

	switch (notify->event_id) {
	case SPS_EVENT_EOT:
@@ -801,7 +802,7 @@ static void ipa3_sps_irq_tx_no_aggr_notify(struct sps_event_notify *notify)
{
	struct ipa3_tx_pkt_wrapper *tx_pkt;

	IPADBG("event %d notified\n", notify->event_id);
	IPADBG_LOW("event %d notified\n", notify->event_id);

	switch (notify->event_id) {
	case SPS_EVENT_EOT:
@@ -911,7 +912,7 @@ static void ipa3_sps_irq_rx_notify(struct sps_event_notify *notify)
	struct ipa3_sys_context *sys = (struct ipa3_sys_context *)notify->user;
	int ret;

	IPADBG("event %d notified\n", notify->event_id);
	IPADBG_LOW("event %d notified\n", notify->event_id);

	switch (notify->event_id) {
	case SPS_EVENT_EOT:
@@ -1442,7 +1443,7 @@ static void ipa3_tx_comp_usr_notify_release(void *user1, int user2)
	struct sk_buff *skb = (struct sk_buff *)user1;
	int ep_idx = user2;

	IPADBG("skb=%p ep=%d\n", skb, ep_idx);
	IPADBG_LOW("skb=%p ep=%d\n", skb, ep_idx);

	IPA_STATS_INC_CNT(ipa3_ctx->stats.tx_pkts_compl);

@@ -1700,7 +1701,7 @@ static void ipa3_replenish_wlan_rx_cache(struct ipa3_sys_context *sys)
	struct gsi_xfer_elem gsi_xfer_elem_one;
	u32 rx_len_cached = 0;

	IPADBG("\n");
	IPADBG_LOW("\n");

	spin_lock_bh(&ipa3_ctx->wc_memb.wlan_spinlock);
	rx_len_cached = sys->len;
@@ -2092,7 +2093,7 @@ static int ipa3_lan_rx_pyld_hdlr(struct sk_buff *skb,
	}

	if (sys->len_partial) {
		IPADBG("len_partial %d\n", sys->len_partial);
		IPADBG_LOW("len_partial %d\n", sys->len_partial);
		buf = skb_push(skb, sys->len_partial);
		memcpy(buf, sys->prev_skb->data, sys->len_partial);
		sys->len_partial = 0;
@@ -2103,7 +2104,7 @@ static int ipa3_lan_rx_pyld_hdlr(struct sk_buff *skb,
	/* this pipe has TX comp (status only) + mux-ed LAN RX data
	 * (status+data) */
	if (sys->len_rem) {
		IPADBG("rem %d skb %d pad %d\n", sys->len_rem, skb->len,
		IPADBG_LOW("rem %d skb %d pad %d\n", sys->len_rem, skb->len,
				sys->len_pad);
		if (sys->len_rem <= skb->len) {
			if (sys->prev_skb) {
@@ -2150,18 +2151,18 @@ static int ipa3_lan_rx_pyld_hdlr(struct sk_buff *skb,
begin:
	while (skb->len) {
		drop_packet = false;
		IPADBG("LEN_REM %d\n", skb->len);
		IPADBG_LOW("LEN_REM %d\n", skb->len);

		if (skb->len < IPA_PKT_STATUS_SIZE) {
			WARN_ON(sys->prev_skb != NULL);
			IPADBG("status straddles buffer\n");
			IPADBG_LOW("status straddles buffer\n");
			sys->prev_skb = skb;
			sys->len_partial = skb->len;
			return rc;
		}

		status = (struct ipa3_hw_pkt_status *)skb->data;
		IPADBG("STATUS opcode=%d src=%d dst=%d len=%d\n",
		IPADBG_LOW("STATUS opcode=%d src=%d dst=%d len=%d\n",
				status->status_opcode, status->endp_src_idx,
				status->endp_dest_idx, status->pkt_len);
		if (sys->status_stat) {
@@ -2194,7 +2195,7 @@ begin:
		if (status->status_mask & IPA_HW_PKT_STATUS_MASK_TAG_VALID) {
			struct ipa3_tag_completion *comp;

			IPADBG("TAG packet arrived\n");
			IPADBG_LOW("TAG packet arrived\n");
			if (status->tag == IPA_COOKIE) {
				skb_pull(skb, IPA_PKT_STATUS_SIZE);
				if (skb->len < sizeof(comp)) {
@@ -2211,11 +2212,11 @@ begin:
			} else {
				ptr = tag_to_pointer_wa(status->tag);
				tx_pkt = (struct ipa3_tx_pkt_wrapper *)ptr;
				IPADBG("tx_pkt recv = %p\n", tx_pkt);
				IPADBG_LOW("tx_pkt recv = %p\n", tx_pkt);
			}
		}
		if (status->pkt_len == 0) {
			IPADBG("Skip aggr close status\n");
			IPADBG_LOW("Skip aggr close status\n");
			skb_pull(skb, IPA_PKT_STATUS_SIZE);
			IPA_STATS_INC_CNT(ipa3_ctx->stats.aggr_close);
			IPA_STATS_DEC_CNT(
@@ -2238,7 +2239,7 @@ begin:
			if (skb->len == IPA_PKT_STATUS_SIZE &&
					!status->exception) {
				WARN_ON(sys->prev_skb != NULL);
				IPADBG("Ins header in next buffer\n");
				IPADBG_LOW("Ins header in next buffer\n");
				sys->prev_skb = skb;
				sys->len_partial =	 skb->len;
				return rc;
@@ -2249,12 +2250,13 @@ begin:

			len = status->pkt_len + pad_len_byte +
				IPA_SIZE_DL_CSUM_META_TRAILER;
			IPADBG("pad %d pkt_len %d len %d\n", pad_len_byte,
			IPADBG_LOW("pad %d pkt_len %d len %d\n", pad_len_byte,
					status->pkt_len, len);

			if (status->exception ==
					IPA_HW_PKT_STATUS_EXCEPTION_DEAGGR) {
				IPADBG("Dropping packet on DeAggr Exception\n");
				IPADBG_LOW(
					"Dropping packet on DeAggr Exception\n");
				skb_pull(skb, len + IPA_PKT_STATUS_SIZE);
				continue;
			}
@@ -2262,7 +2264,7 @@ begin:
			skb2 = skb_clone(skb, GFP_KERNEL);
			if (likely(skb2)) {
				if (skb->len < len + IPA_PKT_STATUS_SIZE) {
					IPADBG("SPL skb len %d len %d\n",
					IPADBG_LOW("SPL skb len %d len %d\n",
							skb->len, len);
					sys->prev_skb = skb2;
					sys->len_rem = len - skb->len +
@@ -2272,7 +2274,7 @@ begin:
				} else {
					skb_trim(skb2, status->pkt_len +
							IPA_PKT_STATUS_SIZE);
					IPADBG("rx avail for %d\n",
					IPADBG_LOW("rx avail for %d\n",
							status->endp_dest_idx);
					if (drop_packet)
						dev_kfree_skb_any(skb2);
@@ -2305,11 +2307,12 @@ begin:
			}
			/* TX comp */
			ipa3_wq_write_done_status(src_pipe, tx_pkt);
			IPADBG("tx comp imp for %d\n", src_pipe);
			IPADBG_LOW("tx comp imp for %d\n", src_pipe);
		} else {
			/* TX comp */
			ipa3_wq_write_done_status(status->endp_src_idx, tx_pkt);
			IPADBG("tx comp exp for %d\n", status->endp_src_idx);
			IPADBG_LOW("tx comp exp for %d\n",
				status->endp_src_idx);
			skb_pull(skb, IPA_PKT_STATUS_SIZE);
			IPA_STATS_INC_CNT(ipa3_ctx->stats.stat_compl);
			IPA_STATS_DEC_CNT(
@@ -2345,13 +2348,13 @@ static void ipa3_wan_rx_handle_splt_pyld(struct sk_buff *skb,
{
	struct sk_buff *skb2;

	IPADBG("rem %d skb %d\n", sys->len_rem, skb->len);
	IPADBG_LOW("rem %d skb %d\n", sys->len_rem, skb->len);
	if (sys->len_rem <= skb->len) {
		if (sys->prev_skb) {
			skb2 = ipa3_join_prev_skb(sys->prev_skb, skb,
					sys->len_rem);
			if (likely(skb2)) {
				IPADBG(
				IPADBG_LOW(
					"removing Status element from skb and sending to WAN client");
				skb_pull(skb2, IPA_PKT_STATUS_SIZE);
				skb2->truesize = skb2->len +
@@ -2403,14 +2406,14 @@ static int ipa3_wan_rx_pyld_hdlr(struct sk_buff *skb,
		ipa3_wan_rx_handle_splt_pyld(skb, sys);

	while (skb->len) {
		IPADBG("LEN_REM %d\n", skb->len);
		IPADBG_LOW("LEN_REM %d\n", skb->len);
		if (skb->len < IPA_PKT_STATUS_SIZE) {
			IPAERR("status straddles buffer\n");
			WARN_ON(1);
			goto bail;
		}
		status = (struct ipa3_hw_pkt_status *)skb->data;
		IPADBG("STATUS opcode=%d src=%d dst=%d len=%d\n",
		IPADBG_LOW("STATUS opcode=%d src=%d dst=%d len=%d\n",
				status->status_opcode, status->endp_src_idx,
				status->endp_dest_idx, status->pkt_len);

@@ -2439,7 +2442,7 @@ static int ipa3_wan_rx_pyld_hdlr(struct sk_buff *skb,
			goto bail;
		}
		if (status->pkt_len == 0) {
			IPADBG("Skip aggr close status\n");
			IPADBG_LOW("Skip aggr close status\n");
			skb_pull(skb, IPA_PKT_STATUS_SIZE);
			IPA_STATS_DEC_CNT(ipa3_ctx->stats.rx_pkts);
			IPA_STATS_INC_CNT(ipa3_ctx->stats.wan_aggr_close);
@@ -2466,11 +2469,11 @@ static int ipa3_wan_rx_pyld_hdlr(struct sk_buff *skb,

		/*QMAP is BE: convert the pkt_len field from BE to LE*/
		pkt_len_with_pad = ntohs((qmap_hdr>>16) & 0xffff);
		IPADBG("pkt_len with pad %d\n", pkt_len_with_pad);
		IPADBG_LOW("pkt_len with pad %d\n", pkt_len_with_pad);
		/*get the CHECKSUM_PROCESS bit*/
		checksum_trailer_exists = status->status_mask &
				IPA_HW_PKT_STATUS_MASK_CKSUM_PROCESS;
		IPADBG("checksum_trailer_exists %d\n",
		IPADBG_LOW("checksum_trailer_exists %d\n",
				checksum_trailer_exists);

		frame_len = IPA_PKT_STATUS_SIZE +
@@ -2478,7 +2481,7 @@ static int ipa3_wan_rx_pyld_hdlr(struct sk_buff *skb,
			    pkt_len_with_pad;
		if (checksum_trailer_exists)
			frame_len += IPA_DL_CHECKSUM_LENGTH;
		IPADBG("frame_len %d\n", frame_len);
		IPADBG_LOW("frame_len %d\n", frame_len);

		skb2 = skb_clone(skb, GFP_KERNEL);
		if (likely(skb2)) {
@@ -2487,16 +2490,16 @@ static int ipa3_wan_rx_pyld_hdlr(struct sk_buff *skb,
			 * payload split across 2 buff
			 */
			if (skb->len < frame_len) {
				IPADBG("SPL skb len %d len %d\n",
				IPADBG_LOW("SPL skb len %d len %d\n",
						skb->len, frame_len);
				sys->prev_skb = skb2;
				sys->len_rem = frame_len - skb->len;
				skb_pull(skb, skb->len);
			} else {
				skb_trim(skb2, frame_len);
				IPADBG("rx avail for %d\n",
				IPADBG_LOW("rx avail for %d\n",
						status->endp_dest_idx);
				IPADBG(
				IPADBG_LOW(
					"removing Status element from skb and sending to WAN client");
				skb_pull(skb2, IPA_PKT_STATUS_SIZE);
				skb2->truesize = skb2->len +
@@ -2566,7 +2569,7 @@ void ipa3_lan_rx_cb(void *priv, enum ipa_dp_evt_type evt, unsigned long data)
	   ------------------------------------------
	 */
	*(u16 *)rx_skb->cb = ((metadata >> 16) & 0xFFFF);
	IPADBG("meta_data: 0x%x cb: 0x%x\n",
	IPADBG_LOW("meta_data: 0x%x cb: 0x%x\n",
			metadata, *(u32 *)rx_skb->cb);

	ep->client_notify(ep->priv, IPA_RECEIVE, (unsigned long)(rx_skb));
@@ -2638,7 +2641,7 @@ static void ipa3_wlan_wq_rx_common(struct ipa3_sys_context *sys, u32 size)
static void ipa3_dma_memcpy_notify(struct ipa3_sys_context *sys,
	struct ipa3_mem_buffer *mem_info)
{
	IPADBG("ENTER.\n");
	IPADBG_LOW("ENTER.\n");
	if (unlikely(list_empty(&sys->head_desc_list))) {
		IPAERR("descriptor list is empty!\n");
		WARN_ON(1);
@@ -2646,7 +2649,7 @@ static void ipa3_dma_memcpy_notify(struct ipa3_sys_context *sys,
	}
	sys->ep->client_notify(sys->ep->priv, IPA_RECEIVE,
				(unsigned long)(mem_info));
	IPADBG("EXIT\n");
	IPADBG_LOW("EXIT\n");
}

static void ipa3_wq_rx_avail(struct work_struct *work)
@@ -2679,7 +2682,8 @@ void ipa3_sps_irq_rx_no_aggr_notify(struct sps_event_notify *notify)
		if (IPA_CLIENT_IS_APPS_CONS(rx_pkt->sys->ep->client))
			atomic_set(&ipa3_ctx->transport_pm.eot_activity, 1);
		rx_pkt->len = notify->data.transfer.iovec.size;
		IPADBG("event %d notified sys=%p len=%u\n", notify->event_id,
		IPADBG_LOW("event %d notified sys=%p len=%u\n",
				notify->event_id,
				notify->user, rx_pkt->len);
		queue_work(rx_pkt->sys->wq, &rx_pkt->work);
		break;
@@ -2872,15 +2876,15 @@ static void ipa3_tx_client_rx_notify_release(void *user1, int user2)
	struct ipa_tx_data_desc *dd = (struct ipa_tx_data_desc *)user1;
	int ep_idx = user2;

	IPADBG("Received data desc anchor:%p\n", dd);
	IPADBG_LOW("Received data desc anchor:%p\n", dd);

	atomic_inc(&ipa3_ctx->ep[ep_idx].avail_fifo_desc);
	ipa3_ctx->ep[ep_idx].wstats.rx_pkts_status_rcvd++;

  /* wlan host driver waits till tx complete before unload */
	IPADBG("ep=%d fifo_desc_free_count=%d\n",
	IPADBG_LOW("ep=%d fifo_desc_free_count=%d\n",
		ep_idx, atomic_read(&ipa3_ctx->ep[ep_idx].avail_fifo_desc));
	IPADBG("calling client notify callback with priv:%p\n",
	IPADBG_LOW("calling client notify callback with priv:%p\n",
		ipa3_ctx->ep[ep_idx].priv);

	if (ipa3_ctx->ep[ep_idx].client_notify) {
@@ -2939,7 +2943,7 @@ int ipa3_tx_dp_mul(enum ipa_client_type src,
	u32 num_desc, cnt;
	int ep_idx;

	IPADBG("Received data desc anchor:%p\n", data_desc);
	IPADBG_LOW("Received data desc anchor:%p\n", data_desc);

	spin_lock_bh(&ipa3_ctx->wc_memb.ipa_tx_mul_spinlock);

@@ -2948,7 +2952,7 @@ int ipa3_tx_dp_mul(enum ipa_client_type src,
		IPAERR("dest EP does not exist.\n");
		goto fail_send;
	}
	IPADBG("ep idx:%d\n", ep_idx);
	IPADBG_LOW("ep idx:%d\n", ep_idx);
	sys = ipa3_ctx->ep[ep_idx].sys;

	if (unlikely(ipa3_ctx->ep[ep_idx].valid == 0)) {
@@ -2962,7 +2966,7 @@ int ipa3_tx_dp_mul(enum ipa_client_type src,
	list_for_each_entry(entry, &data_desc->link, link) {
		num_desc++;
	}
	IPADBG("Number of Data Descriptors:%d", num_desc);
	IPADBG_LOW("Number of Data Descriptors:%d", num_desc);

	if (atomic_read(&sys->ep->avail_fifo_desc) < num_desc) {
		IPAERR("Insufficient data descriptors available\n");
@@ -2974,7 +2978,7 @@ int ipa3_tx_dp_mul(enum ipa_client_type src,
	list_for_each_entry(entry, &data_desc->link, link) {
		memset(desc, 0, 2 * sizeof(struct ipa3_desc));

		IPADBG("Parsing data desc :%d\n", cnt);
		IPADBG_LOW("Parsing data desc :%d\n", cnt);
		cnt++;
		((u8 *)entry->pyld_buffer)[IPA_WLAN_HDR_QMAP_ID_OFFSET] =
			(u8)sys->ep->cfg.meta.qmap_id;
@@ -2988,18 +2992,18 @@ int ipa3_tx_dp_mul(enum ipa_client_type src,
		desc[1].type = IPA_DATA_DESC_SKB;
		desc[1].user1 = data_desc;
		desc[1].user2 = ep_idx;
		IPADBG("priv:%p pyld_buf:0x%p pyld_len:%d\n",
		IPADBG_LOW("priv:%p pyld_buf:0x%p pyld_len:%d\n",
			entry->priv, desc[1].pyld, desc[1].len);

		/* In case of last descriptor populate callback */
		if (cnt == num_desc) {
			IPADBG("data desc:%p\n", data_desc);
			IPADBG_LOW("data desc:%p\n", data_desc);
			desc[1].callback = ipa3_tx_client_rx_notify_release;
		} else {
			desc[1].callback = ipa3_tx_client_rx_pkt_status;
		}

		IPADBG("calling ipa3_send_one()\n");
		IPADBG_LOW("calling ipa3_send_one()\n");
		if (ipa3_send(sys, 2, desc, true)) {
			IPAERR("fail to send skb\n");
			sys->ep->wstats.rx_pkt_leak += (cnt-1);
@@ -3011,7 +3015,7 @@ int ipa3_tx_dp_mul(enum ipa_client_type src,
			atomic_dec(&sys->ep->avail_fifo_desc);

		sys->ep->wstats.rx_pkts_rcvd++;
		IPADBG("ep=%d fifo desc=%d\n",
		IPADBG_LOW("ep=%d fifo desc=%d\n",
			ep_idx, atomic_read(&sys->ep->avail_fifo_desc));
	}

@@ -3259,7 +3263,7 @@ static void ipa_gsi_irq_tx_notify_cb(struct gsi_chan_xfer_notify *notify)
{
	struct ipa3_tx_pkt_wrapper *tx_pkt;

	IPADBG("event %d notified\n", notify->evt_id);
	IPADBG_LOW("event %d notified\n", notify->evt_id);

	switch (notify->evt_id) {
	case GSI_CHAN_EVT_EOT:
@@ -3281,7 +3285,7 @@ static void ipa_gsi_irq_rx_notify_cb(struct gsi_chan_xfer_notify *notify)
		IPAERR("gsi notify is NULL.\n");
		return;
	}
	IPADBG("event %d notified\n", notify->evt_id);
	IPADBG_LOW("event %d notified\n", notify->evt_id);

	sys = (struct ipa3_sys_context *)notify->chan_user_data;
	rx_pkt_expected = list_first_entry(&sys->head_desc_list,
@@ -3323,7 +3327,7 @@ static void ipa_dma_gsi_irq_rx_notify_cb(struct gsi_chan_xfer_notify *notify)
		IPAERR("gsi notify is NULL.\n");
		return;
	}
	IPADBG("event %d notified\n", notify->evt_id);
	IPADBG_LOW("event %d notified\n", notify->evt_id);

	sys = (struct ipa3_sys_context *)notify->chan_user_data;
	if (sys->ep->client == IPA_CLIENT_MEMCPY_DMA_SYNC_CONS) {
@@ -3504,7 +3508,7 @@ static int ipa_populate_tag_field(struct ipa3_desc *desc,
		 * handling if 64-bit pointer is used
		 */
		tag->tag = pointer_to_tag_wa(tx_pkt);
		IPADBG("tx_pkt sent in tag: 0x%p\n", tx_pkt);
		IPADBG_LOW("tx_pkt sent in tag: 0x%p\n", tx_pkt);
		desc->pyld = tag;
		desc->len = sizeof(*tag);
		desc->user1 = tag;
+23 −21
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -246,12 +246,12 @@ static int ipa3_generate_flt_hw_rule(enum ipa_ip_type ip,
		}
	}

	IPADBG("en_rule=0x%x, action=%d, rt_idx=%d, retain_hdr=%d\n",
	IPADBG_LOW("en_rule=0x%x, action=%d, rt_idx=%d, retain_hdr=%d\n",
		en_rule,
		hdr->u.hdr.action,
		hdr->u.hdr.rt_tbl_idx,
		hdr->u.hdr.retain_hdr);
	IPADBG("priority=%d, rule_id=%d\n",
	IPADBG_LOW("priority=%d, rule_id=%d\n",
		hdr->u.hdr.priority,
		hdr->u.hdr.rule_id);

@@ -274,7 +274,7 @@ static void __ipa_reap_sys_flt_tbls(enum ipa_ip_type ip, enum ipa_rule_type rlt)
	struct ipa3_flt_tbl *tbl;
	int i;

	IPADBG("reaping sys flt tbls ip=%d rlt=%d\n", ip, rlt);
	IPADBG_LOW("reaping sys flt tbls ip=%d rlt=%d\n", ip, rlt);

	for (i = 0; i < ipa3_ctx->ipa_num_pipes; i++) {
		if (!ipa_is_ep_support_flt(i))
@@ -282,7 +282,7 @@ static void __ipa_reap_sys_flt_tbls(enum ipa_ip_type ip, enum ipa_rule_type rlt)

		tbl = &ipa3_ctx->flt_tbl[i][ip];
		if (tbl->prev_mem[rlt].phys_base) {
			IPADBG("reaping flt tbl (prev) pipe=%d\n", i);
			IPADBG_LOW("reaping flt tbl (prev) pipe=%d\n", i);
			dma_free_coherent(ipa3_ctx->pdev,
				tbl->prev_mem[rlt].size,
				tbl->prev_mem[rlt].base,
@@ -293,7 +293,8 @@ static void __ipa_reap_sys_flt_tbls(enum ipa_ip_type ip, enum ipa_rule_type rlt)

		if (list_empty(&tbl->head_flt_rule_list)) {
			if (tbl->curr_mem[rlt].phys_base) {
				IPADBG("reaping flt tbl (curr) pipe=%d\n", i);
				IPADBG_LOW("reaping flt tbl (curr) pipe=%d\n",
					i);
				dma_free_coherent(ipa3_ctx->pdev,
					tbl->curr_mem[rlt].size,
					tbl->curr_mem[rlt].base,
@@ -391,7 +392,7 @@ static int ipa_prep_flt_tbl_for_cmt(enum ipa_ip_type ip,
			IPAERR("failed to calculate HW FLT rule size\n");
			return -EPERM;
		}
		IPADBG("pipe %d hw_len %d priority %u\n",
		IPADBG_LOW("pipe %d hw_len %d priority %u\n",
			pipe_idx, entry->hw_len, entry->prio);

		if (entry->rule.hashable)
@@ -402,7 +403,8 @@ static int ipa_prep_flt_tbl_for_cmt(enum ipa_ip_type ip,

	if ((tbl->sz[IPA_RULE_HASHABLE] +
		tbl->sz[IPA_RULE_NON_HASHABLE]) == 0) {
		IPADBG("flt tbl pipe %d is with zero total size\n", pipe_idx);
		IPADBG_LOW("flt tbl pipe %d is with zero total size\n",
			pipe_idx);
		return 0;
	}

@@ -412,7 +414,7 @@ static int ipa_prep_flt_tbl_for_cmt(enum ipa_ip_type ip,
	if (tbl->sz[IPA_RULE_NON_HASHABLE])
		tbl->sz[IPA_RULE_NON_HASHABLE] += IPA_HW_TBL_HDR_WIDTH;

	IPADBG("FLT tbl pipe idx %d hash sz %u non-hash sz %u\n", pipe_idx,
	IPADBG_LOW("FLT tbl pipe idx %d hash sz %u non-hash sz %u\n", pipe_idx,
		tbl->sz[IPA_RULE_HASHABLE], tbl->sz[IPA_RULE_NON_HASHABLE]);

	return 0;
@@ -648,7 +650,7 @@ static int ipa_generate_flt_hw_tbl_img(enum ipa_ip_type ip,
	}

	ipa_get_flt_tbl_lcl_bdy_size(ip, &hash_bdy_sz, &nhash_bdy_sz);
	IPADBG("total flt tbl local body sizes: hash %u nhash %u\n",
	IPADBG_LOW("total flt tbl local body sizes: hash %u nhash %u\n",
		hash_bdy_sz, nhash_bdy_sz);

	hash_bdy->size = hash_bdy_sz + IPA_HW_TBL_BLK_SIZE_ALIGNMENT;
@@ -791,18 +793,18 @@ fail_desc_alloc:
static bool ipa_flt_skip_pipe_config(int pipe)
{
	if (ipa_is_modem_pipe(pipe)) {
		IPADBG("skip %d - modem owned pipe\n", pipe);
		IPADBG_LOW("skip %d - modem owned pipe\n", pipe);
		return true;
	}

	if (ipa3_ctx->skip_ep_cfg_shadow[pipe]) {
		IPADBG("skip %d\n", pipe);
		IPADBG_LOW("skip %d\n", pipe);
		return true;
	}

	if ((ipa3_get_ep_mapping(IPA_CLIENT_APPS_LAN_WAN_PROD) == pipe
		&& ipa3_ctx->modem_cfg_emb_pipe_flt)) {
		IPADBG("skip %d\n", pipe);
		IPADBG_LOW("skip %d\n", pipe);
		return true;
	}

@@ -900,7 +902,7 @@ int __ipa_commit_flt_v3(enum ipa_ip_type ip)
	hdr_idx = 0;
	for (i = 0; i < ipa3_ctx->ipa_num_pipes; i++) {
		if (!ipa_is_ep_support_flt(i)) {
			IPADBG("skip %d - not filtering pipe\n", i);
			IPADBG_LOW("skip %d - not filtering pipe\n", i);
			continue;
		}

@@ -909,7 +911,7 @@ int __ipa_commit_flt_v3(enum ipa_ip_type ip)
			continue;
		}

		IPADBG("Prepare imm cmd for hdr at index %d for pipe %d\n",
		IPADBG_LOW("Prepare imm cmd for hdr at index %d for pipe %d\n",
			hdr_idx, i);

		mem_cmd[num_cmd-1].skip_pipeline_clear = 0;
@@ -972,20 +974,20 @@ int __ipa_commit_flt_v3(enum ipa_ip_type ip)
		goto fail_send_cmd;
	}

	IPADBG("Hashable HEAD\n");
	IPADBG_LOW("Hashable HEAD\n");
	IPA_DUMP_BUFF(hash_hdr.base, hash_hdr.phys_base, hash_hdr.size);

	IPADBG("Non-Hashable HEAD\n");
	IPADBG_LOW("Non-Hashable HEAD\n");
	IPA_DUMP_BUFF(nhash_hdr.base, nhash_hdr.phys_base, nhash_hdr.size);

	if (hash_bdy.size) {
		IPADBG("Hashable BODY\n");
		IPADBG_LOW("Hashable BODY\n");
		IPA_DUMP_BUFF(hash_bdy.base,
			hash_bdy.phys_base, hash_bdy.size);
	}

	if (nhash_bdy.size) {
		IPADBG("Non-Hashable BODY\n");
		IPADBG_LOW("Non-Hashable BODY\n");
		IPA_DUMP_BUFF(nhash_bdy.base,
			nhash_bdy.phys_base, nhash_bdy.size);
	}
@@ -1112,7 +1114,7 @@ static int __ipa_finish_flt_rule_add(struct ipa3_flt_tbl *tbl,
	}
	*rule_hdl = id;
	entry->id = id;
	IPADBG("add flt rule rule_cnt=%d\n", tbl->rule_cnt);
	IPADBG_LOW("add flt rule rule_cnt=%d\n", tbl->rule_cnt);

	return 0;
}
@@ -1320,7 +1322,7 @@ static int __ipa_add_ep_flt_rule(enum ipa_ip_type ip, enum ipa_client_type ep,
		return -EINVAL;

	tbl = &ipa3_ctx->flt_tbl[ipa_ep_idx][ip];
	IPADBG("add ep flt rule ip=%d ep=%d\n", ip, ep);
	IPADBG_LOW("add ep flt rule ip=%d ep=%d\n", ip, ep);

	return __ipa_add_flt_rule(tbl, ip, rule, add_rear, rule_hdl);
}
+12 −12

File changed.

Preview size limit exceeded, changes collapsed.

Loading