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

Commit e47abbf1 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: update IPA driver to the tip of msm-4.4 kernel" into msm-4.8

parents f66e9c32 3021a6fc
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ Optional:
	compatible "qcom,ipa-smmu-wlan-cb"
- ipa_smmu_uc: uc SMMU device
	compatible "qcom,ipa-smmu-uc-cb"
- qcom,smmu-disable-htw: boolean value to turn off SMMU page table caching
- qcom,use-a2-service: determine if A2 service will be used
- qcom,use-ipa-tethering-bridge: determine if tethering bridge will be used
- qcom,use-ipa-bamdma-a2-bridge: determine if a2/ipa hw bridge will be used
@@ -72,6 +71,12 @@ memory allocation over a PCIe bridge
- qcom,tethered-flow-control:   Boolean context flag to indicate whether
                                apps based flow control is needed for tethered
                                call.
- qcom,rx-polling-sleep-ms:	Receive Polling Timeout in millisecond,
				default is 1 millisecond.
- qcom,ipa-polling-iteration:	IPA Polling Iteration Count,default is 40.
- qcom,ipa-tz-unlock-reg:       Register start addresses and ranges which
                                need to be unlocked by TZ.

IPA pipe sub nodes (A2 static pipes configurations):

-label: two labels are supported, a2-to-ipa and ipa-to-a2 which
+8 −4
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@
#define IPA_API_DISPATCH_RETURN(api, p...) \
	do { \
		if (!ipa_api_ctrl) { \
			pr_err("IPA HW is not supported on this target\n"); \
			pr_err("%s:%d IPA HW is not supported\n", \
				__func__, __LINE__); \
			ret = -EPERM; \
		} \
		else { \
@@ -44,7 +45,8 @@
#define IPA_API_DISPATCH(api, p...) \
	do { \
		if (!ipa_api_ctrl) \
			pr_err("IPA HW is not supported on this target\n"); \
			pr_err("%s:%d IPA HW is not supported\n", \
				__func__, __LINE__); \
		else { \
			if (ipa_api_ctrl->api) { \
				ipa_api_ctrl->api(p); \
@@ -59,7 +61,8 @@
#define IPA_API_DISPATCH_RETURN_PTR(api, p...) \
	do { \
		if (!ipa_api_ctrl) { \
			pr_err("IPA HW is not supported on this target\n"); \
			pr_err("%s:%d IPA HW is not supported\n", \
				__func__, __LINE__); \
			ret = NULL; \
		} \
		else { \
@@ -77,7 +80,8 @@
#define IPA_API_DISPATCH_RETURN_BOOL(api, p...) \
	do { \
		if (!ipa_api_ctrl) { \
			pr_err("IPA HW is not supported on this target\n"); \
			pr_err("%s:%d IPA HW is not supported\n", \
				__func__, __LINE__); \
			ret = false; \
		} \
		else { \
+20 −0
Original line number Diff line number Diff line
@@ -2435,6 +2435,7 @@ int ipa_mhi_init(struct ipa_mhi_init_params *params)
	int res;
	struct ipa_rm_create_params mhi_prod_params;
	struct ipa_rm_create_params mhi_cons_params;
	struct ipa_rm_perf_profile profile;

	IPA_MHI_FUNC_ENTRY();

@@ -2506,6 +2507,14 @@ int ipa_mhi_init(struct ipa_mhi_init_params *params)
		goto fail_create_rm_prod;
	}

	memset(&profile, 0, sizeof(profile));
	profile.max_supported_bandwidth_mbps = 1000;
	res = ipa_rm_set_perf_profile(IPA_RM_RESOURCE_MHI_PROD, &profile);
	if (res) {
		IPA_MHI_ERR("fail to set profile to MHI_PROD\n");
		goto fail_perf_rm_prod;
	}

	/* Create CONS in IPA RM */
	memset(&mhi_cons_params, 0, sizeof(mhi_cons_params));
	mhi_cons_params.name = IPA_RM_RESOURCE_MHI_CONS;
@@ -2518,6 +2527,14 @@ int ipa_mhi_init(struct ipa_mhi_init_params *params)
		goto fail_create_rm_cons;
	}

	memset(&profile, 0, sizeof(profile));
	profile.max_supported_bandwidth_mbps = 1000;
	res = ipa_rm_set_perf_profile(IPA_RM_RESOURCE_MHI_CONS, &profile);
	if (res) {
		IPA_MHI_ERR("fail to set profile to MHI_CONS\n");
		goto fail_perf_rm_cons;
	}

	/* Initialize uC interface */
	ipa_uc_mhi_init(ipa_mhi_uc_ready_cb,
		ipa_mhi_uc_wakeup_request_cb);
@@ -2530,7 +2547,10 @@ int ipa_mhi_init(struct ipa_mhi_init_params *params)
	IPA_MHI_FUNC_EXIT();
	return 0;

fail_perf_rm_cons:
	ipa_rm_delete_resource(IPA_RM_RESOURCE_MHI_CONS);
fail_create_rm_cons:
fail_perf_rm_prod:
	ipa_rm_delete_resource(IPA_RM_RESOURCE_MHI_PROD);
fail_create_rm_prod:
	destroy_workqueue(ipa_mhi_client_ctx->wq);
+10 −10
Original line number Diff line number Diff line
@@ -2034,7 +2034,7 @@ static void ipa_usb_debugfs_init(void)

	ipa3_usb_ctx->dent = debugfs_create_dir("ipa_usb", 0);
	if (IS_ERR(ipa3_usb_ctx->dent)) {
		IPA_USB_ERR("fail to create folder in debug_fs.\n");
		pr_err("fail to create folder in debug_fs.\n");
		return;
	}

@@ -2043,7 +2043,7 @@ static void ipa_usb_debugfs_init(void)
			&ipa3_ipa_usb_ops);
	if (!ipa3_usb_ctx->dfile_state_info ||
		IS_ERR(ipa3_usb_ctx->dfile_state_info)) {
		IPA_USB_ERR("failed to create file for state_info\n");
		pr_err("failed to create file for state_info\n");
		goto fail;
	}

@@ -2136,11 +2136,11 @@ int ipa_usb_xdci_connect(struct ipa_usb_xdci_chan_params *ul_chan_params,

connect_fail:
	ipa3_usb_release_xdci_channel(dl_out_params->clnt_hdl,
		dl_chan_params->teth_prot);
		IPA3_USB_GET_TTYPE(dl_chan_params->teth_prot));
alloc_dl_chan_fail:
	if (connect_params->teth_prot != IPA_USB_DIAG)
		ipa3_usb_release_xdci_channel(ul_out_params->clnt_hdl,
			ul_chan_params->teth_prot);
			IPA3_USB_GET_TTYPE(ul_chan_params->teth_prot));
bad_params:
	mutex_unlock(&ipa3_usb_ctx->general_mutex);
	return result;
@@ -2644,11 +2644,11 @@ static int __init ipa3_usb_init(void)
	unsigned long flags;
	int res;

	IPA_USB_DBG("entry\n");
	pr_debug("entry\n");
	ipa3_usb_ctx = kzalloc(sizeof(struct ipa3_usb_context), GFP_KERNEL);
	if (ipa3_usb_ctx == NULL) {
		IPA_USB_ERR("failed to allocate memory\n");
		IPA_USB_ERR(":ipa_usb init failed\n");
		pr_err("failed to allocate memory\n");
		pr_err(":ipa_usb init failed\n");
		return -EFAULT;
	}
	memset(ipa3_usb_ctx, 0, sizeof(struct ipa3_usb_context));
@@ -2680,19 +2680,19 @@ static int __init ipa3_usb_init(void)

	ipa3_usb_ctx->wq = create_singlethread_workqueue("ipa_usb_wq");
	if (!ipa3_usb_ctx->wq) {
		IPA_USB_ERR("failed to create workqueue\n");
		pr_err("failed to create workqueue\n");
		res = -EFAULT;
		goto ipa_usb_workqueue_fail;
	}

	ipa_usb_debugfs_init();

	IPA_USB_INFO("exit: IPA_USB init success!\n");
	pr_info("exit: IPA_USB init success!\n");

	return 0;

ipa_usb_workqueue_fail:
	IPA_USB_ERR(":init failed (%d)\n", -res);
	pr_err(":init failed (%d)\n", -res);
	kfree(ipa3_usb_ctx);
	return res;
}
+9 −5
Original line number Diff line number Diff line
@@ -267,18 +267,19 @@ static int _ipa_rm_add_dependency_sync(enum ipa_rm_resource_name resource_name,
		time = wait_for_completion_timeout(
				&((struct ipa_rm_resource_cons *)consumer)->
				request_consumer_in_progress,
				HZ);
				HZ * 5);
		result = 0;
		if (!time) {
			IPA_RM_ERR("TIMEOUT waiting for %s GRANT event.",
					ipa_rm_resource_str(depends_on_name));
			result = -ETIME;
		}
		} else {
			IPA_RM_DBG("%s waited for %s GRANT %lu time.\n",
				ipa_rm_resource_str(resource_name),
				ipa_rm_resource_str(depends_on_name),
				time);
		}
	}
	IPA_RM_DBG("EXIT with %d\n", result);

	return result;
@@ -819,7 +820,8 @@ static void ipa_rm_wq_resume_handler(struct work_struct *work)
	}
	ipa_rm_resource_consumer_request_work(
			(struct ipa_rm_resource_cons *)resource,
			ipa_rm_work->prev_state, ipa_rm_work->needed_bw, true);
			ipa_rm_work->prev_state, ipa_rm_work->needed_bw, true,
			ipa_rm_work->inc_usage_count);
	spin_unlock_irqrestore(&ipa_rm_ctx->ipa_rm_lock, flags);
bail:
	kfree(ipa_rm_work);
@@ -915,7 +917,8 @@ int ipa_rm_wq_send_suspend_cmd(enum ipa_rm_resource_name resource_name,

int ipa_rm_wq_send_resume_cmd(enum ipa_rm_resource_name resource_name,
		enum ipa_rm_resource_state prev_state,
		u32 needed_bw)
		u32 needed_bw,
		bool inc_usage_count)
{
	int result = -ENOMEM;
	struct ipa_rm_wq_suspend_resume_work_type *work = kzalloc(sizeof(*work),
@@ -925,6 +928,7 @@ int ipa_rm_wq_send_resume_cmd(enum ipa_rm_resource_name resource_name,
		work->resource_name = resource_name;
		work->prev_state = prev_state;
		work->needed_bw = needed_bw;
		work->inc_usage_count = inc_usage_count;
		result = queue_work(ipa_rm_ctx->ipa_rm_wq,
				(struct work_struct *)work);
	} else {
Loading