Loading drivers/platform/msm/gsi/gsi.c +8 −5 Original line number Diff line number Diff line Loading @@ -2228,12 +2228,15 @@ int gsi_alloc_channel(struct gsi_chan_props *props, unsigned long dev_hdl, } erindex = props->evt_ring_hdl != ~0 ? props->evt_ring_hdl : GSI_NO_EVT_ERINDEX; if (erindex != GSI_NO_EVT_ERINDEX) { if (erindex == GSI_NO_EVT_ERINDEX || erindex >= GSI_EVT_RING_MAX) { GSIERR("invalid erindex %u\n", erindex); devm_kfree(gsi_ctx->dev, user_data); return -GSI_STATUS_INVALID_PARAMS; } ctx->evtr = &gsi_ctx->evtr[erindex]; atomic_inc(&ctx->evtr->chan_ref_cnt); if (ctx->evtr->props.exclusive) ctx->evtr->chan = ctx; } gsi_program_chan_ctx(props, gsi_ctx->per.ee, erindex); Loading drivers/platform/msm/ipa/ipa_v3/ipa.c +16 −3 Original line number Diff line number Diff line Loading @@ -1796,6 +1796,7 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return -ENOTTY; } if (!IS_ERR(param)) kfree(param); IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); Loading Loading @@ -4908,7 +4909,8 @@ static void ipa3_load_ipa_fw(struct work_struct *work) IPA_ACTIVE_CLIENTS_INC_SIMPLE(); if (ipa3_ctx->ipa3_hw_mode != IPA_HW_MODE_EMULATION && (ipa3_is_msm_device() || (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_5))) ((ipa3_ctx->platform_type != IPA_PLAT_TYPE_MDM) || (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_5))) result = ipa3_pil_load_ipa_fws(); else result = ipa3_manual_load_ipa_fws(); Loading Loading @@ -4953,7 +4955,7 @@ static ssize_t ipa3_write(struct file *file, const char __user *buf, return count; /* Check MHI configuration on MDM devices */ if (!ipa3_is_msm_device()) { if (ipa3_ctx->platform_type == IPA_PLAT_TYPE_MDM) { if (strnstr(dbg_buff, "vlan", strlen(dbg_buff))) { if (strnstr(dbg_buff, "eth", strlen(dbg_buff))) Loading Loading @@ -5167,6 +5169,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, ipa3_ctx->ipa_wrapper_size = resource_p->ipa_mem_size; ipa3_ctx->ipa_hw_type = resource_p->ipa_hw_type; ipa3_ctx->ipa3_hw_mode = resource_p->ipa3_hw_mode; ipa3_ctx->platform_type = resource_p->platform_type; ipa3_ctx->use_ipa_teth_bridge = resource_p->use_ipa_teth_bridge; ipa3_ctx->modem_cfg_emb_pipe_flt = resource_p->modem_cfg_emb_pipe_flt; ipa3_ctx->ipa_wdi2 = resource_p->ipa_wdi2; Loading Loading @@ -5753,6 +5756,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev, ipa_drv_res->ipa_pipe_mem_size = IPA_PIPE_MEM_SIZE; ipa_drv_res->ipa_hw_type = 0; ipa_drv_res->ipa3_hw_mode = 0; ipa_drv_res->platform_type = 0; ipa_drv_res->modem_cfg_emb_pipe_flt = false; ipa_drv_res->ipa_wdi2 = false; ipa_drv_res->ipa_wdi2_over_gsi = false; Loading Loading @@ -5797,6 +5801,15 @@ static int get_ipa_dts_configuration(struct platform_device *pdev, IPADBG(": found ipa_drv_res->ipa3_hw_mode = %d", ipa_drv_res->ipa3_hw_mode); /* Get Platform Type */ result = of_property_read_u32(pdev->dev.of_node, "qcom,platform-type", &ipa_drv_res->platform_type); if (result) IPADBG("using default (IPA_PLAT_TYPE_MDM) for platform-type\n"); else IPADBG(": found ipa_drv_res->platform_type = %d", ipa_drv_res->platform_type); /* Get IPA WAN / LAN RX pool size */ result = of_property_read_u32(pdev->dev.of_node, "qcom,wan-rx-ring-size", Loading drivers/platform/msm/ipa/ipa_v3/ipa_dp.c +2 −2 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ int ipa3_send(struct ipa3_sys_context *sys, struct ipa3_desc *desc, bool in_atomic) { struct ipa3_tx_pkt_wrapper *tx_pkt, *tx_pkt_first; struct ipa3_tx_pkt_wrapper *tx_pkt, *tx_pkt_first = NULL; struct ipahal_imm_cmd_pyld *tag_pyld_ret = NULL; struct ipa3_tx_pkt_wrapper *next_pkt; struct gsi_xfer_elem gsi_xfer[IPA_SEND_MAX_DESC]; Loading Loading @@ -4118,7 +4118,7 @@ static uint64_t pointer_to_tag_wa(struct ipa3_tx_pkt_wrapper *tx_pkt) { u16 temp; /* Add the check but it might have throughput issue */ if (ipa3_is_msm_device()) { if (BITS_PER_LONG == 64) { temp = (u16) (~((unsigned long) tx_pkt & 0xFFFF000000000000) >> 48); if (temp) { Loading drivers/platform/msm/ipa/ipa_v3/ipa_flt.c +24 −5 Original line number Diff line number Diff line Loading @@ -1094,13 +1094,17 @@ static int __ipa_add_ep_flt_rule(enum ipa_ip_type ip, enum ipa_client_type ep, if (rule == NULL || rule_hdl == NULL || ep >= IPA_CLIENT_MAX) { IPAERR_RL("bad parms rule=%pK rule_hdl=%pK ep=%d\n", rule, rule_hdl, ep); return -EINVAL; } if (__ipa_add_flt_get_ep_idx(ep, &ipa_ep_idx)) return -EINVAL; if (ipa_ep_idx >= IPA3_MAX_NUM_PIPES) { IPAERR_RL("invalid ipa_ep_idx=%d\n", ipa_ep_idx); return -EINVAL; } tbl = &ipa3_ctx->flt_tbl[ipa_ep_idx][ip]; IPADBG_LOW("add ep flt rule ip=%d ep=%d\n", ip, ep); Loading Loading @@ -1220,6 +1224,12 @@ int ipa3_add_flt_rule_after(struct ipa_ioc_add_flt_rule_after *rules) goto bail; } if (ipa_ep_idx >= IPA3_MAX_NUM_PIPES) { IPAERR_RL("invalid ipa_ep_idx=%u\n", ipa_ep_idx); result = -EINVAL; goto bail; } tbl = &ipa3_ctx->flt_tbl[ipa_ep_idx][rules->ip]; entry = ipa3_id_find(rules->add_after_hdl); Loading Loading @@ -1481,9 +1491,17 @@ int ipa3_reset_flt(enum ipa_ip_type ip, bool user_only) void ipa3_install_dflt_flt_rules(u32 ipa_ep_idx) { struct ipa3_flt_tbl *tbl; struct ipa3_ep_context *ep = &ipa3_ctx->ep[ipa_ep_idx]; struct ipa3_ep_context *ep; struct ipa_flt_rule rule; if (ipa_ep_idx >= IPA3_MAX_NUM_PIPES) { IPAERR("invalid ipa_ep_idx=%u\n", ipa_ep_idx); ipa_assert(); return; } ep = &ipa3_ctx->ep[ipa_ep_idx]; if (!ipa_is_ep_support_flt(ipa_ep_idx)) { IPADBG("cannot add flt rules to non filtering pipe num %d\n", ipa_ep_idx); Loading Loading @@ -1622,9 +1640,10 @@ int ipa3_flt_read_tbl_from_hw(u32 pipe_idx, enum ipa_ip_type ip_type, return 0; } if (pipe_idx >= ipa3_ctx->ipa_num_pipes || ip_type >= IPA_IP_MAX || if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx >= IPA3_MAX_NUM_PIPES || ip_type >= IPA_IP_MAX || !entry || !num_entry) { IPAERR_RL("Invalid params\n"); IPAERR_RL("Invalid pipe_idx=%u\n", pipe_idx); return -EFAULT; } Loading drivers/platform/msm/ipa/ipa_v3/ipa_i.h +14 −1 Original line number Diff line number Diff line Loading @@ -1127,6 +1127,18 @@ enum ipa3_hw_mode { IPA_HW_MODE_EMULATION = 3, }; /* * enum ipa3_platform_type - Platform type * @IPA_PLAT_TYPE_MDM: MDM platform (usually 32bit single core CPU platform) * @IPA_PLAT_TYPE_MSM: MSM SOC platform (usually 64bit multi-core platform) * @IPA_PLAT_TYPE_APQ: Similar to MSM but without modem */ enum ipa3_platform_type { IPA_PLAT_TYPE_MDM = 0, IPA_PLAT_TYPE_MSM = 1, IPA_PLAT_TYPE_APQ = 2, }; enum ipa3_config_this_ep { IPA_CONFIGURE_THIS_EP, IPA_DO_NOT_CONFIGURE_THIS_EP, Loading Loading @@ -1577,6 +1589,7 @@ struct ipa3_context { wait_queue_head_t msg_waitq; enum ipa_hw_type ipa_hw_type; enum ipa3_hw_mode ipa3_hw_mode; enum ipa3_platform_type platform_type; bool ipa_config_is_mhi; bool use_ipa_teth_bridge; bool modem_cfg_emb_pipe_flt; Loading Loading @@ -1664,6 +1677,7 @@ struct ipa3_plat_drv_res { u32 ipa_pipe_mem_size; enum ipa_hw_type ipa_hw_type; enum ipa3_hw_mode ipa3_hw_mode; enum ipa3_platform_type platform_type; u32 ee; bool modem_cfg_emb_pipe_flt; bool ipa_wdi2; Loading Loading @@ -2630,7 +2644,6 @@ void ipa3_reset_freeze_vote(void); int ipa3_ntn_init(void); int ipa3_get_ntn_stats(struct Ipa3HwStatsNTNInfoData_t *stats); struct dentry *ipa_debugfs_get_root(void); bool ipa3_is_msm_device(void); struct device *ipa3_get_pdev(void); void ipa3_enable_dcd(void); void ipa3_disable_prefetch(enum ipa_client_type client); Loading Loading
drivers/platform/msm/gsi/gsi.c +8 −5 Original line number Diff line number Diff line Loading @@ -2228,12 +2228,15 @@ int gsi_alloc_channel(struct gsi_chan_props *props, unsigned long dev_hdl, } erindex = props->evt_ring_hdl != ~0 ? props->evt_ring_hdl : GSI_NO_EVT_ERINDEX; if (erindex != GSI_NO_EVT_ERINDEX) { if (erindex == GSI_NO_EVT_ERINDEX || erindex >= GSI_EVT_RING_MAX) { GSIERR("invalid erindex %u\n", erindex); devm_kfree(gsi_ctx->dev, user_data); return -GSI_STATUS_INVALID_PARAMS; } ctx->evtr = &gsi_ctx->evtr[erindex]; atomic_inc(&ctx->evtr->chan_ref_cnt); if (ctx->evtr->props.exclusive) ctx->evtr->chan = ctx; } gsi_program_chan_ctx(props, gsi_ctx->per.ee, erindex); Loading
drivers/platform/msm/ipa/ipa_v3/ipa.c +16 −3 Original line number Diff line number Diff line Loading @@ -1796,6 +1796,7 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return -ENOTTY; } if (!IS_ERR(param)) kfree(param); IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); Loading Loading @@ -4908,7 +4909,8 @@ static void ipa3_load_ipa_fw(struct work_struct *work) IPA_ACTIVE_CLIENTS_INC_SIMPLE(); if (ipa3_ctx->ipa3_hw_mode != IPA_HW_MODE_EMULATION && (ipa3_is_msm_device() || (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_5))) ((ipa3_ctx->platform_type != IPA_PLAT_TYPE_MDM) || (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_5))) result = ipa3_pil_load_ipa_fws(); else result = ipa3_manual_load_ipa_fws(); Loading Loading @@ -4953,7 +4955,7 @@ static ssize_t ipa3_write(struct file *file, const char __user *buf, return count; /* Check MHI configuration on MDM devices */ if (!ipa3_is_msm_device()) { if (ipa3_ctx->platform_type == IPA_PLAT_TYPE_MDM) { if (strnstr(dbg_buff, "vlan", strlen(dbg_buff))) { if (strnstr(dbg_buff, "eth", strlen(dbg_buff))) Loading Loading @@ -5167,6 +5169,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, ipa3_ctx->ipa_wrapper_size = resource_p->ipa_mem_size; ipa3_ctx->ipa_hw_type = resource_p->ipa_hw_type; ipa3_ctx->ipa3_hw_mode = resource_p->ipa3_hw_mode; ipa3_ctx->platform_type = resource_p->platform_type; ipa3_ctx->use_ipa_teth_bridge = resource_p->use_ipa_teth_bridge; ipa3_ctx->modem_cfg_emb_pipe_flt = resource_p->modem_cfg_emb_pipe_flt; ipa3_ctx->ipa_wdi2 = resource_p->ipa_wdi2; Loading Loading @@ -5753,6 +5756,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev, ipa_drv_res->ipa_pipe_mem_size = IPA_PIPE_MEM_SIZE; ipa_drv_res->ipa_hw_type = 0; ipa_drv_res->ipa3_hw_mode = 0; ipa_drv_res->platform_type = 0; ipa_drv_res->modem_cfg_emb_pipe_flt = false; ipa_drv_res->ipa_wdi2 = false; ipa_drv_res->ipa_wdi2_over_gsi = false; Loading Loading @@ -5797,6 +5801,15 @@ static int get_ipa_dts_configuration(struct platform_device *pdev, IPADBG(": found ipa_drv_res->ipa3_hw_mode = %d", ipa_drv_res->ipa3_hw_mode); /* Get Platform Type */ result = of_property_read_u32(pdev->dev.of_node, "qcom,platform-type", &ipa_drv_res->platform_type); if (result) IPADBG("using default (IPA_PLAT_TYPE_MDM) for platform-type\n"); else IPADBG(": found ipa_drv_res->platform_type = %d", ipa_drv_res->platform_type); /* Get IPA WAN / LAN RX pool size */ result = of_property_read_u32(pdev->dev.of_node, "qcom,wan-rx-ring-size", Loading
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c +2 −2 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ int ipa3_send(struct ipa3_sys_context *sys, struct ipa3_desc *desc, bool in_atomic) { struct ipa3_tx_pkt_wrapper *tx_pkt, *tx_pkt_first; struct ipa3_tx_pkt_wrapper *tx_pkt, *tx_pkt_first = NULL; struct ipahal_imm_cmd_pyld *tag_pyld_ret = NULL; struct ipa3_tx_pkt_wrapper *next_pkt; struct gsi_xfer_elem gsi_xfer[IPA_SEND_MAX_DESC]; Loading Loading @@ -4118,7 +4118,7 @@ static uint64_t pointer_to_tag_wa(struct ipa3_tx_pkt_wrapper *tx_pkt) { u16 temp; /* Add the check but it might have throughput issue */ if (ipa3_is_msm_device()) { if (BITS_PER_LONG == 64) { temp = (u16) (~((unsigned long) tx_pkt & 0xFFFF000000000000) >> 48); if (temp) { Loading
drivers/platform/msm/ipa/ipa_v3/ipa_flt.c +24 −5 Original line number Diff line number Diff line Loading @@ -1094,13 +1094,17 @@ static int __ipa_add_ep_flt_rule(enum ipa_ip_type ip, enum ipa_client_type ep, if (rule == NULL || rule_hdl == NULL || ep >= IPA_CLIENT_MAX) { IPAERR_RL("bad parms rule=%pK rule_hdl=%pK ep=%d\n", rule, rule_hdl, ep); return -EINVAL; } if (__ipa_add_flt_get_ep_idx(ep, &ipa_ep_idx)) return -EINVAL; if (ipa_ep_idx >= IPA3_MAX_NUM_PIPES) { IPAERR_RL("invalid ipa_ep_idx=%d\n", ipa_ep_idx); return -EINVAL; } tbl = &ipa3_ctx->flt_tbl[ipa_ep_idx][ip]; IPADBG_LOW("add ep flt rule ip=%d ep=%d\n", ip, ep); Loading Loading @@ -1220,6 +1224,12 @@ int ipa3_add_flt_rule_after(struct ipa_ioc_add_flt_rule_after *rules) goto bail; } if (ipa_ep_idx >= IPA3_MAX_NUM_PIPES) { IPAERR_RL("invalid ipa_ep_idx=%u\n", ipa_ep_idx); result = -EINVAL; goto bail; } tbl = &ipa3_ctx->flt_tbl[ipa_ep_idx][rules->ip]; entry = ipa3_id_find(rules->add_after_hdl); Loading Loading @@ -1481,9 +1491,17 @@ int ipa3_reset_flt(enum ipa_ip_type ip, bool user_only) void ipa3_install_dflt_flt_rules(u32 ipa_ep_idx) { struct ipa3_flt_tbl *tbl; struct ipa3_ep_context *ep = &ipa3_ctx->ep[ipa_ep_idx]; struct ipa3_ep_context *ep; struct ipa_flt_rule rule; if (ipa_ep_idx >= IPA3_MAX_NUM_PIPES) { IPAERR("invalid ipa_ep_idx=%u\n", ipa_ep_idx); ipa_assert(); return; } ep = &ipa3_ctx->ep[ipa_ep_idx]; if (!ipa_is_ep_support_flt(ipa_ep_idx)) { IPADBG("cannot add flt rules to non filtering pipe num %d\n", ipa_ep_idx); Loading Loading @@ -1622,9 +1640,10 @@ int ipa3_flt_read_tbl_from_hw(u32 pipe_idx, enum ipa_ip_type ip_type, return 0; } if (pipe_idx >= ipa3_ctx->ipa_num_pipes || ip_type >= IPA_IP_MAX || if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx >= IPA3_MAX_NUM_PIPES || ip_type >= IPA_IP_MAX || !entry || !num_entry) { IPAERR_RL("Invalid params\n"); IPAERR_RL("Invalid pipe_idx=%u\n", pipe_idx); return -EFAULT; } Loading
drivers/platform/msm/ipa/ipa_v3/ipa_i.h +14 −1 Original line number Diff line number Diff line Loading @@ -1127,6 +1127,18 @@ enum ipa3_hw_mode { IPA_HW_MODE_EMULATION = 3, }; /* * enum ipa3_platform_type - Platform type * @IPA_PLAT_TYPE_MDM: MDM platform (usually 32bit single core CPU platform) * @IPA_PLAT_TYPE_MSM: MSM SOC platform (usually 64bit multi-core platform) * @IPA_PLAT_TYPE_APQ: Similar to MSM but without modem */ enum ipa3_platform_type { IPA_PLAT_TYPE_MDM = 0, IPA_PLAT_TYPE_MSM = 1, IPA_PLAT_TYPE_APQ = 2, }; enum ipa3_config_this_ep { IPA_CONFIGURE_THIS_EP, IPA_DO_NOT_CONFIGURE_THIS_EP, Loading Loading @@ -1577,6 +1589,7 @@ struct ipa3_context { wait_queue_head_t msg_waitq; enum ipa_hw_type ipa_hw_type; enum ipa3_hw_mode ipa3_hw_mode; enum ipa3_platform_type platform_type; bool ipa_config_is_mhi; bool use_ipa_teth_bridge; bool modem_cfg_emb_pipe_flt; Loading Loading @@ -1664,6 +1677,7 @@ struct ipa3_plat_drv_res { u32 ipa_pipe_mem_size; enum ipa_hw_type ipa_hw_type; enum ipa3_hw_mode ipa3_hw_mode; enum ipa3_platform_type platform_type; u32 ee; bool modem_cfg_emb_pipe_flt; bool ipa_wdi2; Loading Loading @@ -2630,7 +2644,6 @@ void ipa3_reset_freeze_vote(void); int ipa3_ntn_init(void); int ipa3_get_ntn_stats(struct Ipa3HwStatsNTNInfoData_t *stats); struct dentry *ipa_debugfs_get_root(void); bool ipa3_is_msm_device(void); struct device *ipa3_get_pdev(void); void ipa3_enable_dcd(void); void ipa3_disable_prefetch(enum ipa_client_type client); Loading