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

Commit 3021a6fc authored by Gidon Studinski's avatar Gidon Studinski
Browse files

msm: ipa: update IPA driver to the tip of msm-4.4 kernel



The commit contains changes from the following original commits:
commit c114fe5555d0 ("msm: ipa: fix potential race condition ioctls")
commit c6d606203352 ("msm: ipa: WDI2.0: hotspot offload using WDI 2.0
interface")
commit 634732c1bb02 ("msm: ipa3: fix GSI ring DMA allocation
parameters")
commit 915354544a81 ("msm: ipa3: Fix timeout period of IPA resource add
dependency")
commit a1e8c020b542 ("msm: ipa3: Fix wrong parameter to xdci release
function")
commit bd09eb993a1a ("msm: ipa: fix skb recycle logic")
commit b2c8a0dbe6c8 ("msm: ipa: fix memory leak on QMI")
commit c4fddbc45db0 ("msm: ipa: mhi: add perf vote")
commit 7bd2a476f7d8 ("msm: ipa: Allocate memory on send message")
commit b544de499e55 ("msm: ipa3: increase SSR tag timeout")
commit 15dc347f5272 ("msm: ipa3: hal: change FnR prints to low")
commit b0756920f39f ("msm: ipa: unlock WLAN doorbell register access")
commit 0dfb2feb3e79 ("msm: ipa: Recycle wan buffer")
commit 1966a333f80b ("mam: ipa: always add default flt rule at the
end")
commit 9ba1638c4bdb ("msm: ipa3: change FnR prints to low")
commit 8b81dd70999c ("msm: ipa3: fix benign prints on ipa3_usb_init")
commit d51f2f62e4bc ("msm: ipa3: Add specific logs to improve debugging
capabilities")
commit 21fab3e70330 ("msm: ipa: fix mutex_lock with task->state !=
RUNNING")
commit bdb22900877b ("msm: ipa3: Do not wait for IPA DMA_TASK H/W
ACK for GSI")
commit fc5f71883677 ("msm: ipa: fix reference count in rm")
commit cd5f5121db9a ("msm: ipa: update wan pool size on napi enable")
commit 7e079d086ffe ("msm: ipa: Remove obsolete IOMMU domain
attribute")
commit 38b227b0c22f ("msm: ipa: Add guard around nat entries read")
commit 9dc2df841d20 ("msm: ipa: fix static analysis sign issue")
commit 3ce1ef220c57 ("msm: ipa3: add check on qmi-client handler")
commit 5334ff493a3f ("msm: ipa: Fix ipa ready cb return value")

All of these changes come to complete the initial IPA driver snapshot:
commit 9659e593 ("msm: ipa: initial commit of IPA driver")

Change-Id: Iad2c7633eb15393202d5ba8b3209363442410160
Signed-off-by: default avatarGidon Studinski <gidons@codeaurora.org>
Signed-off-by: default avatarAmir Levy <alevy@codeaurora.org>
parent 245de31b
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