From e5127624bd4dafa83d544af8e333c463d2453cff Mon Sep 17 00:00:00 2001 From: Michael Adisumarta Date: Wed, 15 Apr 2020 18:44:18 -0700 Subject: [PATCH] msm:ipa: changes to defer remote channel starting for rndis connect this change defers starting of remote channels on device for rndis to wan state ioctl is received thus avoiding double channel starts from usb connect and wan state ioctl. Change-Id: Ibd0960927496a1c2fd14b2df8fa94287dd2388a7 Signed-off-by: Michael Adisumarta --- drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c | 27 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c index 3504b188bd4c..b279b5661a9a 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c @@ -2744,11 +2744,18 @@ int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot xdci_teth_prot) } } - if (probe_id == IPA_MPM_MHIP_CH_ID_MAX) { + if ((probe_id < IPA_MPM_MHIP_CH_ID_0) || + (probe_id >= IPA_MPM_MHIP_CH_ID_MAX)) { IPA_MPM_ERR("Unknown probe_id\n"); return 0; } + if (probe_id == IPA_MPM_MHIP_CH_ID_0) { + /* For rndis, the MPM processing happens in WAN State IOCTL */ + IPA_MPM_DBG("MPM Xdci connect for rndis, no -op\n"); + return 0; + } + IPA_MPM_DBG("Connect xdci prot %d -> mhip_client = %d probe_id = %d\n", xdci_teth_prot, mhip_client, probe_id); @@ -2793,7 +2800,7 @@ int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot xdci_teth_prot) atomic_set(&ipa_mpm_ctx->adpl_over_usb_available, 1); return 0; default: - IPA_MPM_DBG("mhip_client = %d not processed\n", mhip_client); + IPA_MPM_ERR("mhip_client = %d not processed\n", mhip_client); if (is_acted) { ret = ipa_mpm_vote_unvote_pcie_clk(CLK_OFF, probe_id, false, &is_acted); @@ -2803,7 +2810,8 @@ int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot xdci_teth_prot) return ret; } } - return 0; + ipa_assert(); + return -EINVAL; } if (mhip_client != IPA_MPM_MHIP_USB_DPL) @@ -2876,12 +2884,19 @@ int ipa_mpm_mhip_xdci_pipe_disable(enum ipa_usb_teth_prot xdci_teth_prot) } } - if (probe_id == IPA_MPM_MHIP_CH_ID_MAX) { - IPA_MPM_ERR("Invalid probe_id\n"); + if ((probe_id < IPA_MPM_MHIP_CH_ID_0) || + (probe_id >= IPA_MPM_MHIP_CH_ID_MAX)) { + IPA_MPM_ERR("Unknown probe_id\n"); return 0; } - IPA_MPM_ERR("xdci disconnect prot %d mhip_client = %d probe_id = %d\n", + if (probe_id == IPA_MPM_MHIP_CH_ID_0) { + /* For rndis, the MPM processing happens in WAN State IOCTL */ + IPA_MPM_DBG("MPM Xdci disconnect for rndis, no -op\n"); + return 0; + } + + IPA_MPM_DBG("xdci disconnect prot %d mhip_client = %d probe_id = %d\n", xdci_teth_prot, mhip_client, probe_id); /* * Make sure to stop Device side channels before