Loading drivers/platform/msm/ipa/ipa_clients/ipa_usb.c +69 −40 Original line number Diff line number Diff line Loading @@ -2050,8 +2050,8 @@ static int ipa3_usb_xdci_connect_internal( if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_enable(params->teth_prot); if (result) { IPA_USB_ERR("failed to connect MHIP channel\n"); goto connect_dl_fail; IPA_USB_ERR("failed to enable MHIP channel\n"); goto connect_teth_prot_fail; } } Loading @@ -2059,7 +2059,7 @@ static int ipa3_usb_xdci_connect_internal( result = ipa3_usb_connect_teth_prot(params->teth_prot); if (result) { IPA_USB_ERR("failed to connect teth protocol\n"); goto connect_teth_prot_fail; goto connect_mhip_prot_fail; } if (!ipa3_usb_set_state(IPA_USB_CONNECTED, false, ttype)) { Loading @@ -2073,6 +2073,9 @@ static int ipa3_usb_xdci_connect_internal( state_change_connected_fail: ipa3_usb_disconnect_teth_prot(params->teth_prot); connect_mhip_prot_fail: if (ipa3_is_mhip_offload_enabled()) ipa_mpm_mhip_xdci_pipe_disable(params->teth_prot); connect_teth_prot_fail: ipa3_xdci_disconnect(params->ipa_to_usb_clnt_hdl, false, -1); ipa3_reset_gsi_channel(params->ipa_to_usb_clnt_hdl); Loading Loading @@ -2520,14 +2523,17 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl, if (orig_state != IPA_USB_SUSPENDED) { spin_unlock_irqrestore(&ipa3_usb_ctx->state_lock, flags); /* Stop UL MHIP channel */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_ul_data_stop(teth_prot); result = ipa_mpm_mhip_ul_start_stop_data( MPM_MHIP_STOP, teth_prot); if (result) { IPA_USB_ERR("fail UL MHIP Data stop\n"); goto bad_params; } } /* Stop UL channel */ result = ipa3_xdci_disconnect(ul_clnt_hdl, true, Loading @@ -2543,12 +2549,11 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl, } else spin_unlock_irqrestore(&ipa3_usb_ctx->state_lock, flags); if (teth_prot == IPA_USB_RMNET) { IPA_USB_DBG("USB suspend resetting dma mode\n"); result = ipa_mpm_reset_dma_mode(IPA_CLIENT_USB_PROD, IPA_CLIENT_MHI_PRIME_RMNET_CONS); /* Stop UL/DL MHIP channels */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot); if (result) { IPA_USB_ERR("failed to reset dma mode\n"); IPA_USB_ERR("failed to disconnect MHIP pipe\n"); goto bad_params; } } Loading @@ -2557,14 +2562,6 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl, teth_prot); if (result) goto bad_params; /* Stop UL/DL MHIP channels */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot); if (result) { IPA_USB_ERR("failed to disconnect MHIP channel\n"); goto bad_params; } } /* Disconnect tethering protocol */ result = ipa3_usb_disconnect_teth_prot(teth_prot); Loading Loading @@ -2741,20 +2738,38 @@ static int ipa3_usb_suspend_no_remote_wakeup(u32 ul_clnt_hdl, u32 dl_clnt_hdl, } if (!IPA3_USB_IS_TTYPE_DPL(ttype)) { /* Stop UL MHIP channel - enable HOLB */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_STOP, teth_prot); if (result) { IPA_USB_ERR("fail UL MHIP Data stop\n"); goto start_dl; } } /* Stop UL channel */ result = ipa3_xdci_disconnect(ul_clnt_hdl, true, ipa3_usb_ctx->qmi_req_id); if (result) { IPA_USB_ERR("failed disconnect UL channel\n"); goto start_dl; goto start_mhip; } ipa3_usb_ctx->qmi_req_id++; } /* Stop MHIP channel */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot); if (result) { IPA_USB_ERR("failed to disconnect MHIP pipe\n"); goto start_ul; } } /* Disconnect tethering protocol */ result = ipa3_usb_disconnect_teth_prot(teth_prot); if (result) goto start_ul; goto enable_mhip; if (ipa_pm_is_used()) result = ipa_pm_deactivate_sync( Loading @@ -2775,9 +2790,16 @@ static int ipa3_usb_suspend_no_remote_wakeup(u32 ul_clnt_hdl, u32 dl_clnt_hdl, connect_teth: (void)ipa3_usb_connect_teth_prot(teth_prot); enable_mhip: if (ipa3_is_mhip_offload_enabled()) (void)ipa_mpm_mhip_xdci_pipe_enable(teth_prot); start_ul: if (!IPA3_USB_IS_TTYPE_DPL(ttype)) (void)ipa3_xdci_connect(ul_clnt_hdl); start_mhip: if (ipa3_is_mhip_offload_enabled() && !IPA3_USB_IS_TTYPE_DPL(ttype)) (void)ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_START, teth_prot); start_dl: (void)ipa3_xdci_connect(dl_clnt_hdl); fail_exit: Loading Loading @@ -2827,16 +2849,6 @@ int ipa_usb_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl, goto bad_params; } if (teth_prot == IPA_USB_RMNET) { IPA_USB_DBG("USB suspend resetting dma mode\n"); result = ipa_mpm_reset_dma_mode(IPA_CLIENT_USB_PROD, IPA_CLIENT_MHI_PRIME_RMNET_CONS); if (result) { IPA_USB_ERR("failed to reset dma mode\n"); goto bad_params; } } /* Stop UL channel & suspend DL/DPL EP */ result = ipa3_xdci_suspend(ul_clnt_hdl, dl_clnt_hdl, true, Loading Loading @@ -2885,14 +2897,7 @@ int ipa_usb_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl, &ipa3_usb_notify_remote_wakeup_work); } spin_unlock_irqrestore(&ipa3_usb_ctx->state_lock, flags); /* Stop MHIP channel */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot); if (result) { IPA_USB_ERR("failed to disconnect MHIP channel\n"); goto release_prod_fail; } } IPA_USB_DBG_LOW("exit\n"); mutex_unlock(&ipa3_usb_ctx->general_mutex); return 0; Loading Loading @@ -2955,15 +2960,39 @@ static int ipa3_usb_resume_no_remote_wakeup(u32 ul_clnt_hdl, u32 dl_clnt_hdl, goto stop_ul; } /* Start MHIP channel */ if (ipa3_is_mhip_offload_enabled()) { if (!IPA3_USB_IS_TTYPE_DPL(ttype)) { /* Start UL MHIP channel */ result = ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_START, teth_prot); if (result) { IPA_USB_ERR("fail UL MHIP Data Start\n"); goto stop_dl; } } result = ipa_mpm_mhip_xdci_pipe_enable(teth_prot); if (result) { IPA_USB_ERR("failed to enable MHIP pipe\n"); goto stop_mhip_data; } } /* Change state to CONNECTED */ if (!ipa3_usb_set_state(IPA_USB_CONNECTED, false, ttype)) { IPA_USB_ERR("failed to change state to connected\n"); result = -EFAULT; goto stop_dl; goto stop_mhip; } return 0; stop_mhip: if (ipa3_is_mhip_offload_enabled()) (void)ipa_mpm_mhip_xdci_pipe_disable(teth_prot); stop_mhip_data: /* Stop UL MHIP data */ if (ipa3_is_mhip_offload_enabled() && !IPA3_USB_IS_TTYPE_DPL(ttype)) (void)ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_STOP, teth_prot); stop_dl: (void)ipa3_xdci_disconnect(dl_clnt_hdl, false, -1); stop_ul: Loading drivers/platform/msm/ipa/ipa_v3/ipa_i.h +11 −3 Original line number Diff line number Diff line Loading @@ -215,6 +215,11 @@ enum { NUM_SMEM_SUBSYSTEMS, }; enum ipa_mpm_start_stop_type { MPM_MHIP_STOP, MPM_MHIP_START, }; #define IPA_WDI_RX_RING_RES 0 #define IPA_WDI_RX_RING_RP_RES 1 #define IPA_WDI_RX_COMP_RING_RES 2 Loading Loading @@ -2917,7 +2922,9 @@ int ipa3_get_gsi_chan_info(struct gsi_chan_info *gsi_chan_info, int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot prot); int ipa_mpm_mhip_xdci_pipe_disable(enum ipa_usb_teth_prot xdci_teth_prot); int ipa_mpm_notify_wan_state(void); int ipa_mpm_mhip_ul_data_stop(enum ipa_usb_teth_prot xdci_teth_prot); int ipa_mpm_mhip_ul_start_stop_data( enum ipa_mpm_start_stop_type start_stop, enum ipa_usb_teth_prot xdci_teth_prot); int ipa3_is_mhip_offload_enabled(void); int ipa_mpm_reset_dma_mode(enum ipa_client_type src_pipe, enum ipa_client_type dst_pipe); Loading @@ -2937,7 +2944,8 @@ static inline int ipa_mpm_notify_wan_state(void) { return 0; } static inline int ipa_mpm_mhip_ul_data_stop( static inline int ipa_mpm_mhip_ul_start_stop_data( enum ipa_mpm_start_stop_type start_stop, enum ipa_usb_teth_prot xdci_teth_prot) { return 0; Loading drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c +36 −23 Original line number Diff line number Diff line Loading @@ -106,11 +106,6 @@ enum ipa_mpm_mhip_client_type { IPA_MPM_MHIP_NONE, }; enum ipa_mpm_start_stop_type { STOP, START, }; enum ipa_mpm_clk_vote_type { CLK_ON, CLK_OFF, Loading Loading @@ -1275,7 +1270,7 @@ static void ipa_mpm_mhip_shutdown(int mhip_idx) if (mhip_idx != IPA_MPM_MHIP_CH_ID_2) { /* For DPL, stop only DL channel */ ipa_mpm_start_stop_ul_mhip_data_path(mhip_idx, STOP); ipa_mpm_start_stop_ul_mhip_data_path(mhip_idx, MPM_MHIP_STOP); ipa_mpm_clean_mhip_chan(mhip_idx, ul_prod_chan); } Loading Loading @@ -1449,7 +1444,7 @@ static enum mhip_status_type ipa_mpm_start_stop_mhip_chan( } } is_start = (start_stop == START) ? true : false; is_start = (start_stop == MPM_MHIP_START) ? true : false; if (is_start) { if (mhip_chan == IPA_MPM_MHIP_CHAN_UL) { Loading Loading @@ -1573,12 +1568,13 @@ int ipa_mpm_notify_wan_state(void) } status = ipa_mpm_start_stop_mhip_chan( IPA_MPM_MHIP_CHAN_UL, probe_id, START); IPA_MPM_MHIP_CHAN_UL, probe_id, MPM_MHIP_START); switch (status) { case MHIP_STATUS_SUCCESS: case MHIP_STATUS_NO_OP: ipa_mpm_change_teth_state(probe_id, IPA_MPM_TETH_CONNECTED); ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, START); ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_START); if (ret) { IPA_MPM_ERR("Couldnt start UL GSI channel"); Loading Loading @@ -2087,10 +2083,10 @@ static int ipa_mpm_mhi_probe_cb(struct mhi_device *mhi_dev, if (ul_prod != IPA_CLIENT_MAX) { /* No teth started yet, disable UL channel */ ipa_mpm_start_stop_mhip_chan(IPA_MPM_MHIP_CHAN_UL, probe_id, STOP); probe_id, MPM_MHIP_STOP); /* Disable data path */ if (ipa_mpm_start_stop_ul_mhip_data_path(probe_id, STOP)) { MPM_MHIP_STOP)) { IPA_MPM_ERR("MHIP Enable data path failed\n"); goto fail_start_channel; } Loading @@ -2105,7 +2101,7 @@ static int ipa_mpm_mhi_probe_cb(struct mhi_device *mhi_dev, /* Enable data path */ if (ul_prod != IPA_CLIENT_MAX) { if (ipa_mpm_start_stop_ul_mhip_data_path(probe_id, START)) { MPM_MHIP_START)) { IPA_MPM_ERR("MHIP Enable data path failed\n"); goto fail_start_channel; } Loading Loading @@ -2238,7 +2234,7 @@ static void ipa_mpm_mhi_status_cb(struct mhi_device *mhi_dev, if (!ipa_mpm_ctx->md[mhip_idx].in_lpm) { status = ipa_mpm_start_stop_mhip_chan( IPA_MPM_MHIP_CHAN_DL, mhip_idx, STOP); mhip_idx, MPM_MHIP_STOP); IPA_MPM_DBG("status = %d\n", status); ipa_mpm_vote_unvote_ipa_clk(CLK_OFF, mhip_idx); ipa_mpm_ctx->md[mhip_idx].in_lpm = true; Loading @@ -2251,7 +2247,7 @@ static void ipa_mpm_mhi_status_cb(struct mhi_device *mhi_dev, ipa_mpm_vote_unvote_ipa_clk(CLK_ON, mhip_idx); status = ipa_mpm_start_stop_mhip_chan( IPA_MPM_MHIP_CHAN_DL, mhip_idx, START); mhip_idx, MPM_MHIP_START); IPA_MPM_DBG("status = %d\n", status); ipa_mpm_ctx->md[mhip_idx].in_lpm = false; } else { Loading Loading @@ -2389,12 +2385,14 @@ int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot xdci_teth_prot) if (mhip_client != IPA_MPM_MHIP_USB_DPL) /* Start UL MHIP channel for offloading teth connection */ status = ipa_mpm_start_stop_mhip_chan(IPA_MPM_MHIP_CHAN_UL, probe_id, START); probe_id, MPM_MHIP_START); switch (status) { case MHIP_STATUS_SUCCESS: case MHIP_STATUS_NO_OP: ipa_mpm_change_teth_state(probe_id, IPA_MPM_TETH_CONNECTED); ipa_mpm_start_stop_ul_mhip_data_path(probe_id, START); ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_START); pipe_idx = ipa3_get_ep_mapping(IPA_CLIENT_USB_PROD); Loading Loading @@ -2426,7 +2424,8 @@ int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot xdci_teth_prot) return ret; } int ipa_mpm_mhip_ul_data_stop(enum ipa_usb_teth_prot xdci_teth_prot) int ipa_mpm_mhip_ul_start_stop_data(enum ipa_mpm_start_stop_type start_stop, enum ipa_usb_teth_prot xdci_teth_prot) { int probe_id = IPA_MPM_MHIP_CH_ID_MAX; int i; Loading Loading @@ -2455,10 +2454,17 @@ int ipa_mpm_mhip_ul_data_stop(enum ipa_usb_teth_prot xdci_teth_prot) IPA_MPM_DBG("Map xdci prot %d to mhip_client = %d probe_id = %d\n", xdci_teth_prot, mhip_client, probe_id); ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, STOP); if (start_stop == MPM_MHIP_STOP) { ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_STOP); if (ret) IPA_MPM_ERR("Error stopping UL path, err = %d\n", ret); } else if (start_stop == MPM_MHIP_START) { ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_START); if (ret) IPA_MPM_ERR("Error starting UL path, err = %d\n", ret); } return ret; } Loading Loading @@ -2495,6 +2501,13 @@ int ipa_mpm_mhip_xdci_pipe_disable(enum ipa_usb_teth_prot xdci_teth_prot) switch (mhip_client) { case IPA_MPM_MHIP_USB_RMNET: ret = ipa_mpm_reset_dma_mode(IPA_CLIENT_USB_PROD, IPA_CLIENT_MHI_PRIME_RMNET_CONS); if (ret) { IPA_MPM_ERR("failed to reset dma mode\n"); return ret; } break; case IPA_MPM_MHIP_TETH: IPA_MPM_DBG("Teth Disconnecting for prot %d\n", mhip_client); break; Loading @@ -2513,14 +2526,14 @@ int ipa_mpm_mhip_xdci_pipe_disable(enum ipa_usb_teth_prot xdci_teth_prot) } status = ipa_mpm_start_stop_mhip_chan(IPA_MPM_MHIP_CHAN_UL, probe_id, STOP); probe_id, MPM_MHIP_STOP); switch (status) { case MHIP_STATUS_SUCCESS: case MHIP_STATUS_NO_OP: case MHIP_STATUS_EP_NOT_READY: ipa_mpm_change_teth_state(probe_id, IPA_MPM_TETH_INIT); ipa_mpm_start_stop_ul_mhip_data_path(probe_id, STOP); ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_STOP); break; case MHIP_STATUS_FAIL: case MHIP_STATUS_BAD_STATE: Loading Loading
drivers/platform/msm/ipa/ipa_clients/ipa_usb.c +69 −40 Original line number Diff line number Diff line Loading @@ -2050,8 +2050,8 @@ static int ipa3_usb_xdci_connect_internal( if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_enable(params->teth_prot); if (result) { IPA_USB_ERR("failed to connect MHIP channel\n"); goto connect_dl_fail; IPA_USB_ERR("failed to enable MHIP channel\n"); goto connect_teth_prot_fail; } } Loading @@ -2059,7 +2059,7 @@ static int ipa3_usb_xdci_connect_internal( result = ipa3_usb_connect_teth_prot(params->teth_prot); if (result) { IPA_USB_ERR("failed to connect teth protocol\n"); goto connect_teth_prot_fail; goto connect_mhip_prot_fail; } if (!ipa3_usb_set_state(IPA_USB_CONNECTED, false, ttype)) { Loading @@ -2073,6 +2073,9 @@ static int ipa3_usb_xdci_connect_internal( state_change_connected_fail: ipa3_usb_disconnect_teth_prot(params->teth_prot); connect_mhip_prot_fail: if (ipa3_is_mhip_offload_enabled()) ipa_mpm_mhip_xdci_pipe_disable(params->teth_prot); connect_teth_prot_fail: ipa3_xdci_disconnect(params->ipa_to_usb_clnt_hdl, false, -1); ipa3_reset_gsi_channel(params->ipa_to_usb_clnt_hdl); Loading Loading @@ -2520,14 +2523,17 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl, if (orig_state != IPA_USB_SUSPENDED) { spin_unlock_irqrestore(&ipa3_usb_ctx->state_lock, flags); /* Stop UL MHIP channel */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_ul_data_stop(teth_prot); result = ipa_mpm_mhip_ul_start_stop_data( MPM_MHIP_STOP, teth_prot); if (result) { IPA_USB_ERR("fail UL MHIP Data stop\n"); goto bad_params; } } /* Stop UL channel */ result = ipa3_xdci_disconnect(ul_clnt_hdl, true, Loading @@ -2543,12 +2549,11 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl, } else spin_unlock_irqrestore(&ipa3_usb_ctx->state_lock, flags); if (teth_prot == IPA_USB_RMNET) { IPA_USB_DBG("USB suspend resetting dma mode\n"); result = ipa_mpm_reset_dma_mode(IPA_CLIENT_USB_PROD, IPA_CLIENT_MHI_PRIME_RMNET_CONS); /* Stop UL/DL MHIP channels */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot); if (result) { IPA_USB_ERR("failed to reset dma mode\n"); IPA_USB_ERR("failed to disconnect MHIP pipe\n"); goto bad_params; } } Loading @@ -2557,14 +2562,6 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl, teth_prot); if (result) goto bad_params; /* Stop UL/DL MHIP channels */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot); if (result) { IPA_USB_ERR("failed to disconnect MHIP channel\n"); goto bad_params; } } /* Disconnect tethering protocol */ result = ipa3_usb_disconnect_teth_prot(teth_prot); Loading Loading @@ -2741,20 +2738,38 @@ static int ipa3_usb_suspend_no_remote_wakeup(u32 ul_clnt_hdl, u32 dl_clnt_hdl, } if (!IPA3_USB_IS_TTYPE_DPL(ttype)) { /* Stop UL MHIP channel - enable HOLB */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_STOP, teth_prot); if (result) { IPA_USB_ERR("fail UL MHIP Data stop\n"); goto start_dl; } } /* Stop UL channel */ result = ipa3_xdci_disconnect(ul_clnt_hdl, true, ipa3_usb_ctx->qmi_req_id); if (result) { IPA_USB_ERR("failed disconnect UL channel\n"); goto start_dl; goto start_mhip; } ipa3_usb_ctx->qmi_req_id++; } /* Stop MHIP channel */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot); if (result) { IPA_USB_ERR("failed to disconnect MHIP pipe\n"); goto start_ul; } } /* Disconnect tethering protocol */ result = ipa3_usb_disconnect_teth_prot(teth_prot); if (result) goto start_ul; goto enable_mhip; if (ipa_pm_is_used()) result = ipa_pm_deactivate_sync( Loading @@ -2775,9 +2790,16 @@ static int ipa3_usb_suspend_no_remote_wakeup(u32 ul_clnt_hdl, u32 dl_clnt_hdl, connect_teth: (void)ipa3_usb_connect_teth_prot(teth_prot); enable_mhip: if (ipa3_is_mhip_offload_enabled()) (void)ipa_mpm_mhip_xdci_pipe_enable(teth_prot); start_ul: if (!IPA3_USB_IS_TTYPE_DPL(ttype)) (void)ipa3_xdci_connect(ul_clnt_hdl); start_mhip: if (ipa3_is_mhip_offload_enabled() && !IPA3_USB_IS_TTYPE_DPL(ttype)) (void)ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_START, teth_prot); start_dl: (void)ipa3_xdci_connect(dl_clnt_hdl); fail_exit: Loading Loading @@ -2827,16 +2849,6 @@ int ipa_usb_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl, goto bad_params; } if (teth_prot == IPA_USB_RMNET) { IPA_USB_DBG("USB suspend resetting dma mode\n"); result = ipa_mpm_reset_dma_mode(IPA_CLIENT_USB_PROD, IPA_CLIENT_MHI_PRIME_RMNET_CONS); if (result) { IPA_USB_ERR("failed to reset dma mode\n"); goto bad_params; } } /* Stop UL channel & suspend DL/DPL EP */ result = ipa3_xdci_suspend(ul_clnt_hdl, dl_clnt_hdl, true, Loading Loading @@ -2885,14 +2897,7 @@ int ipa_usb_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl, &ipa3_usb_notify_remote_wakeup_work); } spin_unlock_irqrestore(&ipa3_usb_ctx->state_lock, flags); /* Stop MHIP channel */ if (ipa3_is_mhip_offload_enabled()) { result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot); if (result) { IPA_USB_ERR("failed to disconnect MHIP channel\n"); goto release_prod_fail; } } IPA_USB_DBG_LOW("exit\n"); mutex_unlock(&ipa3_usb_ctx->general_mutex); return 0; Loading Loading @@ -2955,15 +2960,39 @@ static int ipa3_usb_resume_no_remote_wakeup(u32 ul_clnt_hdl, u32 dl_clnt_hdl, goto stop_ul; } /* Start MHIP channel */ if (ipa3_is_mhip_offload_enabled()) { if (!IPA3_USB_IS_TTYPE_DPL(ttype)) { /* Start UL MHIP channel */ result = ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_START, teth_prot); if (result) { IPA_USB_ERR("fail UL MHIP Data Start\n"); goto stop_dl; } } result = ipa_mpm_mhip_xdci_pipe_enable(teth_prot); if (result) { IPA_USB_ERR("failed to enable MHIP pipe\n"); goto stop_mhip_data; } } /* Change state to CONNECTED */ if (!ipa3_usb_set_state(IPA_USB_CONNECTED, false, ttype)) { IPA_USB_ERR("failed to change state to connected\n"); result = -EFAULT; goto stop_dl; goto stop_mhip; } return 0; stop_mhip: if (ipa3_is_mhip_offload_enabled()) (void)ipa_mpm_mhip_xdci_pipe_disable(teth_prot); stop_mhip_data: /* Stop UL MHIP data */ if (ipa3_is_mhip_offload_enabled() && !IPA3_USB_IS_TTYPE_DPL(ttype)) (void)ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_STOP, teth_prot); stop_dl: (void)ipa3_xdci_disconnect(dl_clnt_hdl, false, -1); stop_ul: Loading
drivers/platform/msm/ipa/ipa_v3/ipa_i.h +11 −3 Original line number Diff line number Diff line Loading @@ -215,6 +215,11 @@ enum { NUM_SMEM_SUBSYSTEMS, }; enum ipa_mpm_start_stop_type { MPM_MHIP_STOP, MPM_MHIP_START, }; #define IPA_WDI_RX_RING_RES 0 #define IPA_WDI_RX_RING_RP_RES 1 #define IPA_WDI_RX_COMP_RING_RES 2 Loading Loading @@ -2917,7 +2922,9 @@ int ipa3_get_gsi_chan_info(struct gsi_chan_info *gsi_chan_info, int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot prot); int ipa_mpm_mhip_xdci_pipe_disable(enum ipa_usb_teth_prot xdci_teth_prot); int ipa_mpm_notify_wan_state(void); int ipa_mpm_mhip_ul_data_stop(enum ipa_usb_teth_prot xdci_teth_prot); int ipa_mpm_mhip_ul_start_stop_data( enum ipa_mpm_start_stop_type start_stop, enum ipa_usb_teth_prot xdci_teth_prot); int ipa3_is_mhip_offload_enabled(void); int ipa_mpm_reset_dma_mode(enum ipa_client_type src_pipe, enum ipa_client_type dst_pipe); Loading @@ -2937,7 +2944,8 @@ static inline int ipa_mpm_notify_wan_state(void) { return 0; } static inline int ipa_mpm_mhip_ul_data_stop( static inline int ipa_mpm_mhip_ul_start_stop_data( enum ipa_mpm_start_stop_type start_stop, enum ipa_usb_teth_prot xdci_teth_prot) { return 0; Loading
drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c +36 −23 Original line number Diff line number Diff line Loading @@ -106,11 +106,6 @@ enum ipa_mpm_mhip_client_type { IPA_MPM_MHIP_NONE, }; enum ipa_mpm_start_stop_type { STOP, START, }; enum ipa_mpm_clk_vote_type { CLK_ON, CLK_OFF, Loading Loading @@ -1275,7 +1270,7 @@ static void ipa_mpm_mhip_shutdown(int mhip_idx) if (mhip_idx != IPA_MPM_MHIP_CH_ID_2) { /* For DPL, stop only DL channel */ ipa_mpm_start_stop_ul_mhip_data_path(mhip_idx, STOP); ipa_mpm_start_stop_ul_mhip_data_path(mhip_idx, MPM_MHIP_STOP); ipa_mpm_clean_mhip_chan(mhip_idx, ul_prod_chan); } Loading Loading @@ -1449,7 +1444,7 @@ static enum mhip_status_type ipa_mpm_start_stop_mhip_chan( } } is_start = (start_stop == START) ? true : false; is_start = (start_stop == MPM_MHIP_START) ? true : false; if (is_start) { if (mhip_chan == IPA_MPM_MHIP_CHAN_UL) { Loading Loading @@ -1573,12 +1568,13 @@ int ipa_mpm_notify_wan_state(void) } status = ipa_mpm_start_stop_mhip_chan( IPA_MPM_MHIP_CHAN_UL, probe_id, START); IPA_MPM_MHIP_CHAN_UL, probe_id, MPM_MHIP_START); switch (status) { case MHIP_STATUS_SUCCESS: case MHIP_STATUS_NO_OP: ipa_mpm_change_teth_state(probe_id, IPA_MPM_TETH_CONNECTED); ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, START); ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_START); if (ret) { IPA_MPM_ERR("Couldnt start UL GSI channel"); Loading Loading @@ -2087,10 +2083,10 @@ static int ipa_mpm_mhi_probe_cb(struct mhi_device *mhi_dev, if (ul_prod != IPA_CLIENT_MAX) { /* No teth started yet, disable UL channel */ ipa_mpm_start_stop_mhip_chan(IPA_MPM_MHIP_CHAN_UL, probe_id, STOP); probe_id, MPM_MHIP_STOP); /* Disable data path */ if (ipa_mpm_start_stop_ul_mhip_data_path(probe_id, STOP)) { MPM_MHIP_STOP)) { IPA_MPM_ERR("MHIP Enable data path failed\n"); goto fail_start_channel; } Loading @@ -2105,7 +2101,7 @@ static int ipa_mpm_mhi_probe_cb(struct mhi_device *mhi_dev, /* Enable data path */ if (ul_prod != IPA_CLIENT_MAX) { if (ipa_mpm_start_stop_ul_mhip_data_path(probe_id, START)) { MPM_MHIP_START)) { IPA_MPM_ERR("MHIP Enable data path failed\n"); goto fail_start_channel; } Loading Loading @@ -2238,7 +2234,7 @@ static void ipa_mpm_mhi_status_cb(struct mhi_device *mhi_dev, if (!ipa_mpm_ctx->md[mhip_idx].in_lpm) { status = ipa_mpm_start_stop_mhip_chan( IPA_MPM_MHIP_CHAN_DL, mhip_idx, STOP); mhip_idx, MPM_MHIP_STOP); IPA_MPM_DBG("status = %d\n", status); ipa_mpm_vote_unvote_ipa_clk(CLK_OFF, mhip_idx); ipa_mpm_ctx->md[mhip_idx].in_lpm = true; Loading @@ -2251,7 +2247,7 @@ static void ipa_mpm_mhi_status_cb(struct mhi_device *mhi_dev, ipa_mpm_vote_unvote_ipa_clk(CLK_ON, mhip_idx); status = ipa_mpm_start_stop_mhip_chan( IPA_MPM_MHIP_CHAN_DL, mhip_idx, START); mhip_idx, MPM_MHIP_START); IPA_MPM_DBG("status = %d\n", status); ipa_mpm_ctx->md[mhip_idx].in_lpm = false; } else { Loading Loading @@ -2389,12 +2385,14 @@ int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot xdci_teth_prot) if (mhip_client != IPA_MPM_MHIP_USB_DPL) /* Start UL MHIP channel for offloading teth connection */ status = ipa_mpm_start_stop_mhip_chan(IPA_MPM_MHIP_CHAN_UL, probe_id, START); probe_id, MPM_MHIP_START); switch (status) { case MHIP_STATUS_SUCCESS: case MHIP_STATUS_NO_OP: ipa_mpm_change_teth_state(probe_id, IPA_MPM_TETH_CONNECTED); ipa_mpm_start_stop_ul_mhip_data_path(probe_id, START); ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_START); pipe_idx = ipa3_get_ep_mapping(IPA_CLIENT_USB_PROD); Loading Loading @@ -2426,7 +2424,8 @@ int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot xdci_teth_prot) return ret; } int ipa_mpm_mhip_ul_data_stop(enum ipa_usb_teth_prot xdci_teth_prot) int ipa_mpm_mhip_ul_start_stop_data(enum ipa_mpm_start_stop_type start_stop, enum ipa_usb_teth_prot xdci_teth_prot) { int probe_id = IPA_MPM_MHIP_CH_ID_MAX; int i; Loading Loading @@ -2455,10 +2454,17 @@ int ipa_mpm_mhip_ul_data_stop(enum ipa_usb_teth_prot xdci_teth_prot) IPA_MPM_DBG("Map xdci prot %d to mhip_client = %d probe_id = %d\n", xdci_teth_prot, mhip_client, probe_id); ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, STOP); if (start_stop == MPM_MHIP_STOP) { ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_STOP); if (ret) IPA_MPM_ERR("Error stopping UL path, err = %d\n", ret); } else if (start_stop == MPM_MHIP_START) { ret = ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_START); if (ret) IPA_MPM_ERR("Error starting UL path, err = %d\n", ret); } return ret; } Loading Loading @@ -2495,6 +2501,13 @@ int ipa_mpm_mhip_xdci_pipe_disable(enum ipa_usb_teth_prot xdci_teth_prot) switch (mhip_client) { case IPA_MPM_MHIP_USB_RMNET: ret = ipa_mpm_reset_dma_mode(IPA_CLIENT_USB_PROD, IPA_CLIENT_MHI_PRIME_RMNET_CONS); if (ret) { IPA_MPM_ERR("failed to reset dma mode\n"); return ret; } break; case IPA_MPM_MHIP_TETH: IPA_MPM_DBG("Teth Disconnecting for prot %d\n", mhip_client); break; Loading @@ -2513,14 +2526,14 @@ int ipa_mpm_mhip_xdci_pipe_disable(enum ipa_usb_teth_prot xdci_teth_prot) } status = ipa_mpm_start_stop_mhip_chan(IPA_MPM_MHIP_CHAN_UL, probe_id, STOP); probe_id, MPM_MHIP_STOP); switch (status) { case MHIP_STATUS_SUCCESS: case MHIP_STATUS_NO_OP: case MHIP_STATUS_EP_NOT_READY: ipa_mpm_change_teth_state(probe_id, IPA_MPM_TETH_INIT); ipa_mpm_start_stop_ul_mhip_data_path(probe_id, STOP); ipa_mpm_start_stop_ul_mhip_data_path(probe_id, MPM_MHIP_STOP); break; case MHIP_STATUS_FAIL: case MHIP_STATUS_BAD_STATE: Loading