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

Commit e8c66000 authored by Bojun Pan's avatar Bojun Pan Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: add debugfs support for NAPI chaining



Runtime enable/disable NAPI chaining feature using debugfs

Change-Id: I4b60caad3b75243d3c20281a312af95fb449174a
Signed-off-by: default avatarBojun Pan <bojunp@codeaurora.org>
parent 5ebcda44
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5206,6 +5206,9 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
	/* vote for svs2 on bootup */
	ipa3_ctx->curr_ipa_clk_rate = ipa3_ctx->ctrl->ipa_clk_rate_svs2;

	/* Enable ipa3_ctx->enable_napi_chain */
	ipa3_ctx->enable_napi_chain = 1;

	/* enable IPA clocks explicitly to allow the initialization */
	ipa3_enable_clks();

+7 −0
Original line number Diff line number Diff line
@@ -2272,6 +2272,13 @@ void ipa3_debugfs_init(void)
		goto fail;
	}

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

	file = debugfs_create_u32("clock_scaling_bw_threshold_nominal_mbps",
		IPA_READ_WRITE_MODE, dent,
		&ipa3_ctx->ctrl->clock_scaling_bw_threshold_nominal);
+12 −4
Original line number Diff line number Diff line
@@ -3913,8 +3913,10 @@ static int ipa_poll_gsi_n_pkt(struct ipa3_sys_context *sys,
		sys->ep->bytes_xfered_valid = false;
		idx++;
	}
	if (expected_num == idx)
	if (expected_num == idx) {
		*actual_num = idx;
		return GSI_STATUS_SUCCESS;
	}

	ret = gsi_poll_n_channel(sys->ep->gsi_chan_hdl,
		xfer_notify, expected_num - idx, &poll_num);
@@ -3923,6 +3925,7 @@ static int ipa_poll_gsi_n_pkt(struct ipa3_sys_context *sys,
			*actual_num = idx;
			return GSI_STATUS_SUCCESS;
		} else {
			*actual_num = 0;
			return ret;
		}
	} else if (ret != GSI_STATUS_SUCCESS) {
@@ -3930,7 +3933,7 @@ static int ipa_poll_gsi_n_pkt(struct ipa3_sys_context *sys,
			*actual_num = idx;
			return GSI_STATUS_SUCCESS;
		}

		*actual_num = 0;
		IPAERR("Poll channel err: %d\n", ret);
		return ret;
	}
@@ -3985,8 +3988,13 @@ int ipa3_rx_poll(u32 clnt_hdl, int weight)
	while (remain_aggr_weight > 0 &&
			atomic_read(&ep->sys->curr_polling_state)) {
		atomic_set(&ipa3_ctx->transport_pm.eot_activity, 1);
		if (ipa3_ctx->enable_napi_chain) {
			ret = ipa_poll_gsi_n_pkt(ep->sys, mem_info,
				remain_aggr_weight, &num);
		} else {
			ret = ipa_poll_gsi_n_pkt(ep->sys, mem_info,
				1, &num);
		}
		if (ret)
			break;

+1 −0
Original line number Diff line number Diff line
@@ -1580,6 +1580,7 @@ struct ipa3_context {
	struct device *uc_pdev;
	spinlock_t idr_lock;
	u32 enable_clock_scaling;
	u32 enable_napi_chain;
	u32 curr_ipa_clk_rate;
	bool q6_proxy_clk_vote_valid;
	struct mutex q6_proxy_clk_vote_mutex;