Loading drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c +14 −13 Original line number Original line Diff line number Diff line Loading @@ -1292,20 +1292,20 @@ int ipa3_connect_gsi_wdi_pipe(struct ipa_wdi_in_params *in, out->clnt_hdl = ipa_ep_idx; out->clnt_hdl = ipa_ep_idx; return 0; return 0; ipa_cfg_ep_fail: memset(&ipa3_ctx->ep[ipa_ep_idx], 0, sizeof(struct ipa3_ep_context)); fail_write_channel_scratch: fail_write_channel_scratch: gsi_dealloc_channel(ep->gsi_chan_hdl); gsi_dealloc_channel(ep->gsi_chan_hdl); gsi_timeout: ipa_release_uc_smmu_mappings(in->sys.client); fail_alloc_channel: fail_alloc_channel: if (ep->gsi_evt_ring_hdl != ~0) { if (ep->gsi_evt_ring_hdl != ~0) { gsi_dealloc_evt_ring(ep->gsi_evt_ring_hdl); gsi_dealloc_evt_ring(ep->gsi_evt_ring_hdl); ep->gsi_evt_ring_hdl = ~0; ep->gsi_evt_ring_hdl = ~0; } } fail_alloc_evt_ring: fail_alloc_evt_ring: fail: ipa_cfg_ep_fail: memset(&ipa3_ctx->ep[ipa_ep_idx], 0, sizeof(struct ipa3_ep_context)); gsi_timeout: ipa_release_uc_smmu_mappings(in->sys.client); IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client); IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client); fail: return result; return result; } } Loading Loading @@ -1931,7 +1931,6 @@ int ipa3_disconnect_wdi_pipe(u32 clnt_hdl) ipa3_delete_dflt_flt_rules(clnt_hdl); ipa3_delete_dflt_flt_rules(clnt_hdl); ipa_release_uc_smmu_mappings(ep->client); ipa_release_uc_smmu_mappings(ep->client); IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); memset(&ipa3_ctx->ep[clnt_hdl], 0, sizeof(struct ipa3_ep_context)); memset(&ipa3_ctx->ep[clnt_hdl], 0, sizeof(struct ipa3_ep_context)); IPADBG("client (ep: %d) disconnected\n", clnt_hdl); IPADBG("client (ep: %d) disconnected\n", clnt_hdl); Loading @@ -1943,6 +1942,7 @@ int ipa3_disconnect_wdi_pipe(u32 clnt_hdl) IPADBG("uc_wdi_ctx.stats_notify already null\n"); IPADBG("uc_wdi_ctx.stats_notify already null\n"); uc_timeout: uc_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } Loading @@ -1964,8 +1964,7 @@ int ipa3_enable_gsi_wdi_pipe(u32 clnt_hdl) ipa_ep_idx = ipa3_get_ep_mapping(ipa3_get_client_mapping(clnt_hdl)); ipa_ep_idx = ipa3_get_ep_mapping(ipa3_get_client_mapping(clnt_hdl)); if (ipa_ep_idx == -1) { if (ipa_ep_idx == -1) { IPAERR("fail to alloc EP.\n"); IPAERR("fail to alloc EP.\n"); result = -EPERM; return -EPERM; goto fail; } } IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); Loading @@ -1977,7 +1976,7 @@ int ipa3_enable_gsi_wdi_pipe(u32 clnt_hdl) IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); ep->gsi_offload_state |= IPA_WDI_ENABLED; ep->gsi_offload_state |= IPA_WDI_ENABLED; IPADBG("client (ep: %d) enabled\n", clnt_hdl); IPADBG("client (ep: %d) enabled\n", clnt_hdl); fail: return result; return result; } } int ipa3_disable_gsi_wdi_pipe(u32 clnt_hdl) int ipa3_disable_gsi_wdi_pipe(u32 clnt_hdl) Loading Loading @@ -2042,11 +2041,11 @@ int ipa3_disable_gsi_wdi_pipe(u32 clnt_hdl) ep_cfg_ctrl.ipa_ep_delay = true; ep_cfg_ctrl.ipa_ep_delay = true; ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); } } IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); ep->gsi_offload_state &= ~IPA_WDI_ENABLED; ep->gsi_offload_state &= ~IPA_WDI_ENABLED; IPADBG("client (ep: %d) disabled\n", clnt_hdl); IPADBG("client (ep: %d) disabled\n", clnt_hdl); gsi_timeout: gsi_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } /** /** Loading Loading @@ -2104,11 +2103,12 @@ int ipa3_enable_wdi_pipe(u32 clnt_hdl) holb_cfg.tmr_val = 0; holb_cfg.tmr_val = 0; result = ipa3_cfg_ep_holb(clnt_hdl, &holb_cfg); result = ipa3_cfg_ep_holb(clnt_hdl, &holb_cfg); } } IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); ep->uc_offload_state |= IPA_WDI_ENABLED; ep->uc_offload_state |= IPA_WDI_ENABLED; IPADBG("client (ep: %d) enabled\n", clnt_hdl); IPADBG("client (ep: %d) enabled\n", clnt_hdl); uc_timeout: uc_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } Loading Loading @@ -2209,12 +2209,12 @@ int ipa3_disable_wdi_pipe(u32 clnt_hdl) ep_cfg_ctrl.ipa_ep_delay = true; ep_cfg_ctrl.ipa_ep_delay = true; ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); } } IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); ep->uc_offload_state &= ~IPA_WDI_ENABLED; ep->uc_offload_state &= ~IPA_WDI_ENABLED; IPADBG("client (ep: %d) disabled\n", clnt_hdl); IPADBG("client (ep: %d) disabled\n", clnt_hdl); uc_timeout: uc_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } Loading Loading @@ -2312,6 +2312,7 @@ int ipa3_resume_wdi_pipe(u32 clnt_hdl) if (result) { if (result) { result = -EFAULT; result = -EFAULT; IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); goto uc_timeout; goto uc_timeout; } } Loading Loading @@ -2626,11 +2627,11 @@ int ipa3_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id) result = -EFAULT; result = -EFAULT; goto uc_timeout; goto uc_timeout; } } IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); IPADBG("client (ep: %d) qmap_id %d updated\n", clnt_hdl, qmap_id); IPADBG("client (ep: %d) qmap_id %d updated\n", clnt_hdl, qmap_id); uc_timeout: uc_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } Loading Loading
drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c +14 −13 Original line number Original line Diff line number Diff line Loading @@ -1292,20 +1292,20 @@ int ipa3_connect_gsi_wdi_pipe(struct ipa_wdi_in_params *in, out->clnt_hdl = ipa_ep_idx; out->clnt_hdl = ipa_ep_idx; return 0; return 0; ipa_cfg_ep_fail: memset(&ipa3_ctx->ep[ipa_ep_idx], 0, sizeof(struct ipa3_ep_context)); fail_write_channel_scratch: fail_write_channel_scratch: gsi_dealloc_channel(ep->gsi_chan_hdl); gsi_dealloc_channel(ep->gsi_chan_hdl); gsi_timeout: ipa_release_uc_smmu_mappings(in->sys.client); fail_alloc_channel: fail_alloc_channel: if (ep->gsi_evt_ring_hdl != ~0) { if (ep->gsi_evt_ring_hdl != ~0) { gsi_dealloc_evt_ring(ep->gsi_evt_ring_hdl); gsi_dealloc_evt_ring(ep->gsi_evt_ring_hdl); ep->gsi_evt_ring_hdl = ~0; ep->gsi_evt_ring_hdl = ~0; } } fail_alloc_evt_ring: fail_alloc_evt_ring: fail: ipa_cfg_ep_fail: memset(&ipa3_ctx->ep[ipa_ep_idx], 0, sizeof(struct ipa3_ep_context)); gsi_timeout: ipa_release_uc_smmu_mappings(in->sys.client); IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client); IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client); fail: return result; return result; } } Loading Loading @@ -1931,7 +1931,6 @@ int ipa3_disconnect_wdi_pipe(u32 clnt_hdl) ipa3_delete_dflt_flt_rules(clnt_hdl); ipa3_delete_dflt_flt_rules(clnt_hdl); ipa_release_uc_smmu_mappings(ep->client); ipa_release_uc_smmu_mappings(ep->client); IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); memset(&ipa3_ctx->ep[clnt_hdl], 0, sizeof(struct ipa3_ep_context)); memset(&ipa3_ctx->ep[clnt_hdl], 0, sizeof(struct ipa3_ep_context)); IPADBG("client (ep: %d) disconnected\n", clnt_hdl); IPADBG("client (ep: %d) disconnected\n", clnt_hdl); Loading @@ -1943,6 +1942,7 @@ int ipa3_disconnect_wdi_pipe(u32 clnt_hdl) IPADBG("uc_wdi_ctx.stats_notify already null\n"); IPADBG("uc_wdi_ctx.stats_notify already null\n"); uc_timeout: uc_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } Loading @@ -1964,8 +1964,7 @@ int ipa3_enable_gsi_wdi_pipe(u32 clnt_hdl) ipa_ep_idx = ipa3_get_ep_mapping(ipa3_get_client_mapping(clnt_hdl)); ipa_ep_idx = ipa3_get_ep_mapping(ipa3_get_client_mapping(clnt_hdl)); if (ipa_ep_idx == -1) { if (ipa_ep_idx == -1) { IPAERR("fail to alloc EP.\n"); IPAERR("fail to alloc EP.\n"); result = -EPERM; return -EPERM; goto fail; } } IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); Loading @@ -1977,7 +1976,7 @@ int ipa3_enable_gsi_wdi_pipe(u32 clnt_hdl) IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); ep->gsi_offload_state |= IPA_WDI_ENABLED; ep->gsi_offload_state |= IPA_WDI_ENABLED; IPADBG("client (ep: %d) enabled\n", clnt_hdl); IPADBG("client (ep: %d) enabled\n", clnt_hdl); fail: return result; return result; } } int ipa3_disable_gsi_wdi_pipe(u32 clnt_hdl) int ipa3_disable_gsi_wdi_pipe(u32 clnt_hdl) Loading Loading @@ -2042,11 +2041,11 @@ int ipa3_disable_gsi_wdi_pipe(u32 clnt_hdl) ep_cfg_ctrl.ipa_ep_delay = true; ep_cfg_ctrl.ipa_ep_delay = true; ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); } } IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); ep->gsi_offload_state &= ~IPA_WDI_ENABLED; ep->gsi_offload_state &= ~IPA_WDI_ENABLED; IPADBG("client (ep: %d) disabled\n", clnt_hdl); IPADBG("client (ep: %d) disabled\n", clnt_hdl); gsi_timeout: gsi_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } /** /** Loading Loading @@ -2104,11 +2103,12 @@ int ipa3_enable_wdi_pipe(u32 clnt_hdl) holb_cfg.tmr_val = 0; holb_cfg.tmr_val = 0; result = ipa3_cfg_ep_holb(clnt_hdl, &holb_cfg); result = ipa3_cfg_ep_holb(clnt_hdl, &holb_cfg); } } IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); ep->uc_offload_state |= IPA_WDI_ENABLED; ep->uc_offload_state |= IPA_WDI_ENABLED; IPADBG("client (ep: %d) enabled\n", clnt_hdl); IPADBG("client (ep: %d) enabled\n", clnt_hdl); uc_timeout: uc_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } Loading Loading @@ -2209,12 +2209,12 @@ int ipa3_disable_wdi_pipe(u32 clnt_hdl) ep_cfg_ctrl.ipa_ep_delay = true; ep_cfg_ctrl.ipa_ep_delay = true; ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); } } IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); ep->uc_offload_state &= ~IPA_WDI_ENABLED; ep->uc_offload_state &= ~IPA_WDI_ENABLED; IPADBG("client (ep: %d) disabled\n", clnt_hdl); IPADBG("client (ep: %d) disabled\n", clnt_hdl); uc_timeout: uc_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } Loading Loading @@ -2312,6 +2312,7 @@ int ipa3_resume_wdi_pipe(u32 clnt_hdl) if (result) { if (result) { result = -EFAULT; result = -EFAULT; IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); goto uc_timeout; goto uc_timeout; } } Loading Loading @@ -2626,11 +2627,11 @@ int ipa3_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id) result = -EFAULT; result = -EFAULT; goto uc_timeout; goto uc_timeout; } } IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); IPADBG("client (ep: %d) qmap_id %d updated\n", clnt_hdl, qmap_id); IPADBG("client (ep: %d) qmap_id %d updated\n", clnt_hdl, qmap_id); uc_timeout: uc_timeout: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; return result; } } Loading