Loading drivers/platform/msm/Kconfig +24 −2 Original line number Diff line number Diff line Loading @@ -87,6 +87,28 @@ config IPA3 Kernel and user-space processes can call the IPA driver to configure IPA core. config IPA tristate "IPA support" depends on SPS && NET help This driver supports the Internet Packet Accelerator (IPA3) core. IPA is a programmable protocol processor HW block. It is designed to support generic HW processing of UL/DL IP packets for various use cases independent of radio technology. The driver support client connection and configuration for the IPA core. Kernel and user-space processes can call the IPA driver to configure IPA core. config RMNET_IPA tristate "IPA RMNET WWAN Network Device" depends on IPA && QCOM_QMI_HELPERS help This WWAN Network Driver implements network stack class device. It supports Embedded data transfer from A7 to Q6. Configures IPA HW for RmNet Data Driver and also exchange of QMI messages between A7 and Q6 IPA-driver. config IPA_DEBUG bool "IPA DEBUG for non-perf build" depends on IPA3 Loading Loading @@ -117,7 +139,7 @@ config RMNET_IPA3 config ECM_IPA tristate "STD ECM LAN Driver support" depends on IPA3 depends on IPA || IPA3 help Enables LAN between applications processor and a tethered host using the STD ECM protocol. Loading @@ -126,7 +148,7 @@ config ECM_IPA config RNDIS_IPA tristate "RNDIS_IPA Network Interface Driver support" depends on IPA3 depends on IPA || IPA3 help Enables LAN between applications processor and a tethered host using the RNDIS protocol. Loading drivers/platform/msm/ipa/ipa_api.c +5 −1 Original line number Diff line number Diff line Loading @@ -335,7 +335,7 @@ u8 *ipa_pad_to_32(u8 *dest) return dest; } i = (long)dest & 0x7; i = (long)dest & 0x3; if (i) for (j = 0; j < (4 - i); j++) Loading Loading @@ -3187,6 +3187,10 @@ static int ipa_generic_plat_drv_probe(struct platform_device *pdev_p) /* call probe based on IPA HW version */ switch (ipa_api_hw_type) { case IPA_HW_v2_6L: result = ipa_plat_drv_probe(pdev_p, ipa_api_ctrl, ipa_plat_drv_match); break; case IPA_HW_v3_0: case IPA_HW_v3_1: case IPA_HW_v3_5: Loading drivers/platform/msm/ipa/ipa_api.h +20 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. */ #include <linux/ipa_mhi.h> Loading @@ -12,6 +12,12 @@ #define _IPA_API_H_ struct ipa_api_controller { int (*ipa_connect)(const struct ipa_connect_params *in, struct ipa_sps_params *sps, u32 *clnt_hdl); int (*ipa_disconnect)(u32 clnt_hdl); int (*ipa_reset_endpoint)(u32 clnt_hdl); int (*ipa_clear_endpoint_delay)(u32 clnt_hdl); Loading Loading @@ -484,6 +490,19 @@ struct ipa_api_controller { int (*ipa_get_prot_id)(enum ipa_client_type client); }; #ifdef CONFIG_IPA int ipa_plat_drv_probe(struct platform_device *pdev_p, struct ipa_api_controller *api_ctrl, const struct of_device_id *pdrv_match); #else static inline int ipa_plat_drv_probe(struct platform_device *pdev_p, struct ipa_api_controller *api_ctrl, const struct of_device_id *pdrv_match) { return -ENODEV; } #endif /* (CONFIG_IPA) */ #ifdef CONFIG_IPA3 int ipa3_plat_drv_probe(struct platform_device *pdev_p, struct ipa_api_controller *api_ctrl, Loading drivers/platform/msm/ipa/ipa_common_i.h +1 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. */ #include <linux/ipa_mhi.h> Loading drivers/platform/msm/ipa/ipa_v2/ipa.c +130 −122 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ static DECLARE_DELAYED_WORK(ipa_sps_release_resource_work, static struct ipa_plat_drv_res ipa_res = {0, }; struct msm_bus_scale_pdata *bus_scale_table; static struct msm_bus_scale_pdata *bus_scale_table; static struct clk *ipa_clk_src; static struct clk *ipa_clk; Loading @@ -195,7 +195,7 @@ static struct clk *ipa_inactivity_clk; struct ipa_context *ipa_ctx; static struct device *master_dev; struct platform_device *ipa_pdev; static struct platform_device *ipa_pdev; static struct { bool present; bool arm_smmu; Loading @@ -207,6 +207,8 @@ static struct { static char *active_clients_table_buf; static u32 register_ipa_bus_hdl; int ipa2_active_clients_log_print_buffer(char *buf, int size) { int i; Loading Loading @@ -561,7 +563,7 @@ static int ipa_send_wan_msg(unsigned long usr_param, uint8_t msg_type, return -ENOMEM; } if (copy_from_user((u8 *)wan_msg, (u8 *)usr_param, if (copy_from_user(wan_msg, (const void __user *)usr_param, sizeof(struct ipa_wan_msg))) { kfree(wan_msg); return -EFAULT; Loading Loading @@ -606,7 +608,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { int retval = 0; u32 pyld_sz; u8 header[128] = { 0 }; u8 header[192] = { 0 }; u8 *param = NULL; struct ipa_ioc_nat_alloc_mem nat_mem; struct ipa_ioc_v4_nat_init nat_init; Loading @@ -624,7 +626,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) switch (cmd) { case IPA_IOC_ALLOC_NAT_MEM: if (copy_from_user((u8 *)&nat_mem, (u8 *)arg, if (copy_from_user(&nat_mem, (const void __user *)arg, sizeof(struct ipa_ioc_nat_alloc_mem))) { retval = -EFAULT; break; Loading @@ -636,14 +638,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, (u8 *)&nat_mem, if (copy_to_user((void __user *)arg, &nat_mem, sizeof(struct ipa_ioc_nat_alloc_mem))) { retval = -EFAULT; break; } break; case IPA_IOC_V4_INIT_NAT: if (copy_from_user((u8 *)&nat_init, (u8 *)arg, if (copy_from_user(&nat_init, (const void __user *)arg, sizeof(struct ipa_ioc_v4_nat_init))) { retval = -EFAULT; break; Loading @@ -655,7 +657,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; case IPA_IOC_NAT_DMA: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_nat_dma_cmd))) { retval = -EFAULT; break; Loading @@ -671,7 +673,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -691,7 +693,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; case IPA_IOC_V4_DEL_NAT: if (copy_from_user((u8 *)&nat_del, (u8 *)arg, if (copy_from_user(&nat_del, (const void __user *)arg, sizeof(struct ipa_ioc_v4_nat_del))) { retval = -EFAULT; break; Loading @@ -703,7 +705,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; case IPA_IOC_ADD_HDR: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_add_hdr))) { retval = -EFAULT; break; Loading @@ -718,7 +720,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -736,14 +738,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_DEL_HDR: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_del_hdr))) { retval = -EFAULT; break; Loading @@ -758,7 +760,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -776,14 +778,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_ADD_RT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_add_rt_rule))) { retval = -EFAULT; break; Loading @@ -798,7 +800,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -817,14 +819,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_MDFY_RT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_mdfy_rt_rule))) { retval = -EFAULT; break; Loading @@ -839,7 +841,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -857,14 +859,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_DEL_RT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_del_rt_rule))) { retval = -EFAULT; break; Loading @@ -879,7 +881,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -896,14 +898,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_ADD_FLT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_add_flt_rule))) { retval = -EFAULT; break; Loading @@ -918,7 +920,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -937,14 +939,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_DEL_FLT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_del_flt_rule))) { retval = -EFAULT; break; Loading @@ -959,7 +961,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -977,14 +979,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_MDFY_FLT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_mdfy_flt_rule))) { retval = -EFAULT; break; Loading @@ -999,7 +1001,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1017,7 +1019,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1042,7 +1044,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = ipa2_reset_flt(arg, false); break; case IPA_IOC_GET_RT_TBL: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_get_rt_tbl))) { retval = -EFAULT; break; Loading @@ -1051,7 +1053,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_get_rt_tbl))) { retval = -EFAULT; break; Loading @@ -1061,7 +1063,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = ipa2_put_rt_tbl(arg); break; case IPA_IOC_GET_HDR: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_get_hdr))) { retval = -EFAULT; break; Loading @@ -1070,7 +1072,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_get_hdr))) { retval = -EFAULT; break; Loading @@ -1083,7 +1085,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = ipa_cfg_filter(arg); break; case IPA_IOC_COPY_HDR: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_copy_hdr))) { retval = -EFAULT; break; Loading @@ -1092,14 +1094,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_copy_hdr))) { retval = -EFAULT; break; } break; case IPA_IOC_QUERY_INTF: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_query_intf))) { retval = -EFAULT; break; Loading @@ -1108,7 +1110,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_query_intf))) { retval = -EFAULT; break; Loading @@ -1116,7 +1118,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; case IPA_IOC_QUERY_INTF_TX_PROPS: sz = sizeof(struct ipa_ioc_query_intf_tx_props); if (copy_from_user(header, (u8 *)arg, sz)) { if (copy_from_user(header, (const void __user *)arg, sz)) { retval = -EFAULT; break; } Loading @@ -1136,7 +1138,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1155,14 +1157,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_QUERY_INTF_RX_PROPS: sz = sizeof(struct ipa_ioc_query_intf_rx_props); if (copy_from_user(header, (u8 *)arg, sz)) { if (copy_from_user(header, (const void __user *)arg, sz)) { retval = -EFAULT; break; } Loading @@ -1182,7 +1184,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1200,14 +1202,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_QUERY_INTF_EXT_PROPS: sz = sizeof(struct ipa_ioc_query_intf_ext_props); if (copy_from_user(header, (u8 *)arg, sz)) { if (copy_from_user(header, (const void __user *)arg, sz)) { retval = -EFAULT; break; } Loading @@ -1227,7 +1229,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1245,13 +1247,13 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_PULL_MSG: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_msg_meta))) { retval = -EFAULT; break; Loading @@ -1265,7 +1267,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1285,13 +1287,13 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_RM_ADD_DEPENDENCY: if (copy_from_user((u8 *)&rm_depend, (u8 *)arg, if (copy_from_user(&rm_depend, (const void __user *)arg, sizeof(struct ipa_ioc_rm_dependency))) { retval = -EFAULT; break; Loading @@ -1300,7 +1302,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) rm_depend.resource_name, rm_depend.depends_on_name); break; case IPA_IOC_RM_DEL_DEPENDENCY: if (copy_from_user((u8 *)&rm_depend, (u8 *)arg, if (copy_from_user(&rm_depend, (const void __user *)arg, sizeof(struct ipa_ioc_rm_dependency))) { retval = -EFAULT; break; Loading @@ -1312,7 +1314,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct ipa_ioc_generate_flt_eq flt_eq; if (copy_from_user(&flt_eq, (u8 *)arg, if (copy_from_user(&flt_eq, (const void __user *)arg, sizeof(struct ipa_ioc_generate_flt_eq))) { retval = -EFAULT; break; Loading @@ -1322,7 +1324,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, &flt_eq, if (copy_to_user((void __user *)arg, &flt_eq, sizeof(struct ipa_ioc_generate_flt_eq))) { retval = -EFAULT; break; Loading @@ -1335,7 +1337,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; } case IPA_IOC_QUERY_RT_TBL_INDEX: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_get_rt_tbl_indx))) { retval = -EFAULT; break; Loading @@ -1345,14 +1347,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_get_rt_tbl_indx))) { retval = -EFAULT; break; } break; case IPA_IOC_WRITE_QMAPID: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_write_qmapid))) { retval = -EFAULT; break; Loading @@ -1361,7 +1363,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_write_qmapid))) { retval = -EFAULT; break; Loading Loading @@ -1389,7 +1391,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } break; case IPA_IOC_ADD_HDR_PROC_CTX: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_add_hdr_proc_ctx))) { retval = -EFAULT; break; Loading @@ -1405,7 +1407,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1423,13 +1425,13 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_DEL_HDR_PROC_CTX: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_del_hdr_proc_ctx))) { retval = -EFAULT; break; Loading @@ -1444,7 +1446,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1463,7 +1465,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1477,7 +1479,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; } memcpy(param, &ipa_ctx->ipa_hw_type, pyld_sz); if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } Loading Loading @@ -1517,7 +1519,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) * -ENOMEM: failed to allocate memory * -EPERM: failed to add the tables */ int ipa_setup_dflt_rt_tables(void) static int ipa_setup_dflt_rt_tables(void) { struct ipa_ioc_add_rt_rule *rt_rule; struct ipa_rt_rule_add *rt_rule_entry; Loading Loading @@ -1750,39 +1752,6 @@ static void ipa_free_buffer(void *user1, int user2) kfree(user1); } int ipa_q6_pipe_delay(bool zip_pipes) { u32 reg_val = 0; int client_idx; int ep_idx; /* For ZIP pipes, processing is done in AFTER_SHUTDOWN callback. */ for (client_idx = 0; client_idx < IPA_CLIENT_MAX; client_idx++) { /* Skip the processing for non Q6 pipes. */ if (!IPA_CLIENT_IS_Q6_PROD(client_idx)) continue; /* Skip the processing for NON-ZIP pipes. */ else if (zip_pipes && IPA_CLIENT_IS_Q6_NON_ZIP_PROD(client_idx)) continue; /* Skip the processing for ZIP pipes. */ else if (!zip_pipes && IPA_CLIENT_IS_Q6_ZIP_PROD(client_idx)) continue; ep_idx = ipa2_get_ep_mapping(client_idx); if (ep_idx == -1) continue; IPA_SETFIELD_IN_REG(reg_val, 1, IPA_ENDP_INIT_CTRL_N_ENDP_DELAY_SHFT, IPA_ENDP_INIT_CTRL_N_ENDP_DELAY_BMSK); ipa_write_reg(ipa_ctx->mmio, IPA_ENDP_INIT_CTRL_N_OFST(ep_idx), reg_val); } return 0; } int ipa_q6_monitor_holb_mitigation(bool enable) { int ep_idx; Loading Loading @@ -1886,7 +1855,7 @@ static int ipa_q6_clean_q6_tables(void) int num_cmds = 0; int index; int retval; struct ipa_mem_buffer mem = { 0 }; struct ipa_mem_buffer mem = { NULL }; u32 *entry; u32 max_cmds = ipa_get_max_flt_rt_cmds(ipa_ctx->ipa_num_pipes); gfp_t flag = GFP_KERNEL | (ipa_ctx->use_dma_zone ? GFP_DMA : 0); Loading Loading @@ -2217,7 +2186,7 @@ int ipa_q6_post_shutdown_cleanup(void) int _ipa_init_sram_v2(void) { u32 *ipa_sram_mmio; void __iomem *ipa_sram_mmio; unsigned long phys_addr; struct ipa_hw_imm_cmd_dma_shared_mem *cmd = NULL; struct ipa_desc desc = {0}; Loading @@ -2237,7 +2206,7 @@ int _ipa_init_sram_v2(void) return -ENOMEM; } #define IPA_SRAM_SET(ofst, val) (ipa_sram_mmio[(ofst - 4) / 4] = val) #define IPA_SRAM_SET(ofst, val) iowrite32(val, ipa_sram_mmio + (ofst - 4)) IPA_SRAM_SET(IPA_MEM_PART(v6_flt_ofst) - 4, IPA_MEM_CANARY_VAL); IPA_SRAM_SET(IPA_MEM_PART(v6_flt_ofst), IPA_MEM_CANARY_VAL); Loading @@ -2249,6 +2218,7 @@ int _ipa_init_sram_v2(void) IPA_SRAM_SET(IPA_MEM_PART(apps_v4_flt_ofst), IPA_MEM_CANARY_VAL); IPA_SRAM_SET(IPA_MEM_PART(uc_info_ofst), IPA_MEM_CANARY_VAL); iounmap(ipa_sram_mmio); mem.size = IPA_STATUS_CLEAR_SIZE; Loading Loading @@ -2287,7 +2257,7 @@ int _ipa_init_sram_v2(void) int _ipa_init_sram_v2_5(void) { u32 *ipa_sram_mmio; void __iomem *ipa_sram_mmio; unsigned long phys_addr; phys_addr = ipa_ctx->ipa_wrapper_base + Loading @@ -2301,7 +2271,7 @@ int _ipa_init_sram_v2_5(void) return -ENOMEM; } #define IPA_SRAM_SET(ofst, val) (ipa_sram_mmio[(ofst - 4) / 4] = val) #define IPA_SRAM_SET(ofst, val) iowrite32(val, ipa_sram_mmio + (ofst - 4)) IPA_SRAM_SET(IPA_MEM_PART(v4_flt_ofst) - 4, IPA_MEM_CANARY_VAL); IPA_SRAM_SET(IPA_MEM_PART(v4_flt_ofst), IPA_MEM_CANARY_VAL); Loading @@ -2322,15 +2292,15 @@ int _ipa_init_sram_v2_5(void) return 0; } static inline void ipa_sram_set_canary(u32 *sram_mmio, int offset) static inline void ipa_sram_set_canary(void __iomem *sram_mmio, int offset) { /* Set 4 bytes of CANARY before the offset */ sram_mmio[(offset - 4) / 4] = IPA_MEM_CANARY_VAL; iowrite32(IPA_MEM_CANARY_VAL, sram_mmio + (offset - 4)); } int _ipa_init_sram_v2_6L(void) { u32 *ipa_sram_mmio; void __iomem *ipa_sram_mmio; unsigned long phys_addr; phys_addr = ipa_ctx->ipa_wrapper_base + Loading Loading @@ -2877,7 +2847,8 @@ static void ipa_teardown_apps_pipes(void) } #ifdef CONFIG_COMPAT long compat_ipa_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static long compat_ipa_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int retval = 0; struct ipa_ioc_nat_alloc_mem32 nat_mem32; Loading Loading @@ -2924,7 +2895,7 @@ long compat_ipa_ioctl(struct file *file, unsigned int cmd, unsigned long arg) cmd = IPA_IOC_GET_HDR; break; case IPA_IOC_ALLOC_NAT_MEM32: if (copy_from_user((u8 *)&nat_mem32, (u8 *)arg, if (copy_from_user(&nat_mem32, (const void __user *)arg, sizeof(struct ipa_ioc_nat_alloc_mem32))) { retval = -EFAULT; goto ret; Loading @@ -2942,7 +2913,7 @@ long compat_ipa_ioctl(struct file *file, unsigned int cmd, unsigned long arg) goto ret; } nat_mem32.offset = (compat_off_t)nat_mem.offset; if (copy_to_user((u8 *)arg, (u8 *)&nat_mem32, if (copy_to_user((void __user *)arg, (u8 *)&nat_mem32, sizeof(struct ipa_ioc_nat_alloc_mem32))) { retval = -EFAULT; } Loading Loading @@ -3297,7 +3268,8 @@ static void ipa_start_tag_process(struct work_struct *work) * - Remove and deallocate unneeded data structure * - Log the call in the circular history buffer (unless it is a simple call) */ void ipa2_active_clients_log_mod(struct ipa_active_client_logging_info *id, static void ipa2_active_clients_log_mod( struct ipa_active_client_logging_info *id, bool inc, bool int_ctx) { char temp_str[IPA2_ACTIVE_CLIENTS_LOG_LINE_LEN]; Loading Loading @@ -3512,7 +3484,7 @@ void ipa_dec_release_wakelock(enum ipa_wakelock_ref_client ref_client) static int ipa_setup_bam_cfg(const struct ipa_plat_drv_res *res) { void *ipa_bam_mmio; void __iomem *ipa_bam_mmio; int reg_val; int retval = 0; Loading Loading @@ -3842,7 +3814,7 @@ static void ipa_sps_release_resource(struct work_struct *work) mutex_unlock(&ipa_ctx->sps_pm.sps_pm_lock); } int ipa_create_apps_resource(void) static int ipa_create_apps_resource(void) { struct ipa_rm_create_params apps_cons_create_params; struct ipa_rm_perf_profile profile; Loading Loading @@ -3996,9 +3968,14 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, if (ipa_ctx->ipa_hw_mode != IPA_HW_MODE_VIRTUAL) { /* get BUS handle */ /* Check if bus handle is already registered */ if (!register_ipa_bus_hdl) ipa_ctx->ipa_bus_hdl = msm_bus_scale_register_client( ipa_ctx->ctrl->msm_bus_data_ptr); else ipa_ctx->ipa_bus_hdl = register_ipa_bus_hdl; if (!ipa_ctx->ipa_bus_hdl) { IPAERR("fail to register with bus mgr!\n"); result = -EPROBE_DEFER; Loading Loading @@ -4464,6 +4441,7 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, if (bus_scale_table) { msm_bus_cl_clear_pdata(bus_scale_table); bus_scale_table = NULL; register_ipa_bus_hdl = 0; } fail_bus_reg: fail_bind: Loading Loading @@ -4973,6 +4951,36 @@ int ipa_plat_drv_probe(struct platform_device *pdev_p, IPADBG("IPA driver probing started\n"); /* * Due to late initialization of msm_bus in kernel >= 4.14, add * mechanism to defer IPA probing until msm_bus is initialized * successfully. */ if (of_device_is_compatible(dev->of_node, "qcom,ipa")) { if (!ipa_pdev) ipa_pdev = pdev_p; if (!bus_scale_table) bus_scale_table = msm_bus_cl_get_pdata(ipa_pdev); } if (bus_scale_table != NULL) { if (of_device_is_compatible(dev->of_node, "qcom,ipa")) { /* * Register with bus client to check if msm_bus * is completely initialized. */ register_ipa_bus_hdl = msm_bus_scale_register_client( bus_scale_table); if (!register_ipa_bus_hdl) { IPAERR("fail to register with bus mgr!\n"); bus_scale_table = NULL; return -EPROBE_DEFER; } } } else { return -EPROBE_DEFER; } if (of_device_is_compatible(dev->of_node, "qcom,ipa-smmu-ap-cb")) return ipa_smmu_ap_cb_probe(dev); Loading Loading
drivers/platform/msm/Kconfig +24 −2 Original line number Diff line number Diff line Loading @@ -87,6 +87,28 @@ config IPA3 Kernel and user-space processes can call the IPA driver to configure IPA core. config IPA tristate "IPA support" depends on SPS && NET help This driver supports the Internet Packet Accelerator (IPA3) core. IPA is a programmable protocol processor HW block. It is designed to support generic HW processing of UL/DL IP packets for various use cases independent of radio technology. The driver support client connection and configuration for the IPA core. Kernel and user-space processes can call the IPA driver to configure IPA core. config RMNET_IPA tristate "IPA RMNET WWAN Network Device" depends on IPA && QCOM_QMI_HELPERS help This WWAN Network Driver implements network stack class device. It supports Embedded data transfer from A7 to Q6. Configures IPA HW for RmNet Data Driver and also exchange of QMI messages between A7 and Q6 IPA-driver. config IPA_DEBUG bool "IPA DEBUG for non-perf build" depends on IPA3 Loading Loading @@ -117,7 +139,7 @@ config RMNET_IPA3 config ECM_IPA tristate "STD ECM LAN Driver support" depends on IPA3 depends on IPA || IPA3 help Enables LAN between applications processor and a tethered host using the STD ECM protocol. Loading @@ -126,7 +148,7 @@ config ECM_IPA config RNDIS_IPA tristate "RNDIS_IPA Network Interface Driver support" depends on IPA3 depends on IPA || IPA3 help Enables LAN between applications processor and a tethered host using the RNDIS protocol. Loading
drivers/platform/msm/ipa/ipa_api.c +5 −1 Original line number Diff line number Diff line Loading @@ -335,7 +335,7 @@ u8 *ipa_pad_to_32(u8 *dest) return dest; } i = (long)dest & 0x7; i = (long)dest & 0x3; if (i) for (j = 0; j < (4 - i); j++) Loading Loading @@ -3187,6 +3187,10 @@ static int ipa_generic_plat_drv_probe(struct platform_device *pdev_p) /* call probe based on IPA HW version */ switch (ipa_api_hw_type) { case IPA_HW_v2_6L: result = ipa_plat_drv_probe(pdev_p, ipa_api_ctrl, ipa_plat_drv_match); break; case IPA_HW_v3_0: case IPA_HW_v3_1: case IPA_HW_v3_5: Loading
drivers/platform/msm/ipa/ipa_api.h +20 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. */ #include <linux/ipa_mhi.h> Loading @@ -12,6 +12,12 @@ #define _IPA_API_H_ struct ipa_api_controller { int (*ipa_connect)(const struct ipa_connect_params *in, struct ipa_sps_params *sps, u32 *clnt_hdl); int (*ipa_disconnect)(u32 clnt_hdl); int (*ipa_reset_endpoint)(u32 clnt_hdl); int (*ipa_clear_endpoint_delay)(u32 clnt_hdl); Loading Loading @@ -484,6 +490,19 @@ struct ipa_api_controller { int (*ipa_get_prot_id)(enum ipa_client_type client); }; #ifdef CONFIG_IPA int ipa_plat_drv_probe(struct platform_device *pdev_p, struct ipa_api_controller *api_ctrl, const struct of_device_id *pdrv_match); #else static inline int ipa_plat_drv_probe(struct platform_device *pdev_p, struct ipa_api_controller *api_ctrl, const struct of_device_id *pdrv_match) { return -ENODEV; } #endif /* (CONFIG_IPA) */ #ifdef CONFIG_IPA3 int ipa3_plat_drv_probe(struct platform_device *pdev_p, struct ipa_api_controller *api_ctrl, Loading
drivers/platform/msm/ipa/ipa_common_i.h +1 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. */ #include <linux/ipa_mhi.h> Loading
drivers/platform/msm/ipa/ipa_v2/ipa.c +130 −122 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ static DECLARE_DELAYED_WORK(ipa_sps_release_resource_work, static struct ipa_plat_drv_res ipa_res = {0, }; struct msm_bus_scale_pdata *bus_scale_table; static struct msm_bus_scale_pdata *bus_scale_table; static struct clk *ipa_clk_src; static struct clk *ipa_clk; Loading @@ -195,7 +195,7 @@ static struct clk *ipa_inactivity_clk; struct ipa_context *ipa_ctx; static struct device *master_dev; struct platform_device *ipa_pdev; static struct platform_device *ipa_pdev; static struct { bool present; bool arm_smmu; Loading @@ -207,6 +207,8 @@ static struct { static char *active_clients_table_buf; static u32 register_ipa_bus_hdl; int ipa2_active_clients_log_print_buffer(char *buf, int size) { int i; Loading Loading @@ -561,7 +563,7 @@ static int ipa_send_wan_msg(unsigned long usr_param, uint8_t msg_type, return -ENOMEM; } if (copy_from_user((u8 *)wan_msg, (u8 *)usr_param, if (copy_from_user(wan_msg, (const void __user *)usr_param, sizeof(struct ipa_wan_msg))) { kfree(wan_msg); return -EFAULT; Loading Loading @@ -606,7 +608,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { int retval = 0; u32 pyld_sz; u8 header[128] = { 0 }; u8 header[192] = { 0 }; u8 *param = NULL; struct ipa_ioc_nat_alloc_mem nat_mem; struct ipa_ioc_v4_nat_init nat_init; Loading @@ -624,7 +626,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) switch (cmd) { case IPA_IOC_ALLOC_NAT_MEM: if (copy_from_user((u8 *)&nat_mem, (u8 *)arg, if (copy_from_user(&nat_mem, (const void __user *)arg, sizeof(struct ipa_ioc_nat_alloc_mem))) { retval = -EFAULT; break; Loading @@ -636,14 +638,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, (u8 *)&nat_mem, if (copy_to_user((void __user *)arg, &nat_mem, sizeof(struct ipa_ioc_nat_alloc_mem))) { retval = -EFAULT; break; } break; case IPA_IOC_V4_INIT_NAT: if (copy_from_user((u8 *)&nat_init, (u8 *)arg, if (copy_from_user(&nat_init, (const void __user *)arg, sizeof(struct ipa_ioc_v4_nat_init))) { retval = -EFAULT; break; Loading @@ -655,7 +657,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; case IPA_IOC_NAT_DMA: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_nat_dma_cmd))) { retval = -EFAULT; break; Loading @@ -671,7 +673,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -691,7 +693,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; case IPA_IOC_V4_DEL_NAT: if (copy_from_user((u8 *)&nat_del, (u8 *)arg, if (copy_from_user(&nat_del, (const void __user *)arg, sizeof(struct ipa_ioc_v4_nat_del))) { retval = -EFAULT; break; Loading @@ -703,7 +705,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; case IPA_IOC_ADD_HDR: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_add_hdr))) { retval = -EFAULT; break; Loading @@ -718,7 +720,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -736,14 +738,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_DEL_HDR: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_del_hdr))) { retval = -EFAULT; break; Loading @@ -758,7 +760,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -776,14 +778,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_ADD_RT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_add_rt_rule))) { retval = -EFAULT; break; Loading @@ -798,7 +800,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -817,14 +819,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_MDFY_RT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_mdfy_rt_rule))) { retval = -EFAULT; break; Loading @@ -839,7 +841,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -857,14 +859,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_DEL_RT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_del_rt_rule))) { retval = -EFAULT; break; Loading @@ -879,7 +881,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -896,14 +898,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_ADD_FLT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_add_flt_rule))) { retval = -EFAULT; break; Loading @@ -918,7 +920,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -937,14 +939,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_DEL_FLT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_del_flt_rule))) { retval = -EFAULT; break; Loading @@ -959,7 +961,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -977,14 +979,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_MDFY_FLT_RULE: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_mdfy_flt_rule))) { retval = -EFAULT; break; Loading @@ -999,7 +1001,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1017,7 +1019,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1042,7 +1044,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = ipa2_reset_flt(arg, false); break; case IPA_IOC_GET_RT_TBL: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_get_rt_tbl))) { retval = -EFAULT; break; Loading @@ -1051,7 +1053,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_get_rt_tbl))) { retval = -EFAULT; break; Loading @@ -1061,7 +1063,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = ipa2_put_rt_tbl(arg); break; case IPA_IOC_GET_HDR: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_get_hdr))) { retval = -EFAULT; break; Loading @@ -1070,7 +1072,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_get_hdr))) { retval = -EFAULT; break; Loading @@ -1083,7 +1085,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = ipa_cfg_filter(arg); break; case IPA_IOC_COPY_HDR: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_copy_hdr))) { retval = -EFAULT; break; Loading @@ -1092,14 +1094,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_copy_hdr))) { retval = -EFAULT; break; } break; case IPA_IOC_QUERY_INTF: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_query_intf))) { retval = -EFAULT; break; Loading @@ -1108,7 +1110,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_query_intf))) { retval = -EFAULT; break; Loading @@ -1116,7 +1118,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; case IPA_IOC_QUERY_INTF_TX_PROPS: sz = sizeof(struct ipa_ioc_query_intf_tx_props); if (copy_from_user(header, (u8 *)arg, sz)) { if (copy_from_user(header, (const void __user *)arg, sz)) { retval = -EFAULT; break; } Loading @@ -1136,7 +1138,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1155,14 +1157,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_QUERY_INTF_RX_PROPS: sz = sizeof(struct ipa_ioc_query_intf_rx_props); if (copy_from_user(header, (u8 *)arg, sz)) { if (copy_from_user(header, (const void __user *)arg, sz)) { retval = -EFAULT; break; } Loading @@ -1182,7 +1184,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1200,14 +1202,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_QUERY_INTF_EXT_PROPS: sz = sizeof(struct ipa_ioc_query_intf_ext_props); if (copy_from_user(header, (u8 *)arg, sz)) { if (copy_from_user(header, (const void __user *)arg, sz)) { retval = -EFAULT; break; } Loading @@ -1227,7 +1229,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1245,13 +1247,13 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_PULL_MSG: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_msg_meta))) { retval = -EFAULT; break; Loading @@ -1265,7 +1267,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1285,13 +1287,13 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -1; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_RM_ADD_DEPENDENCY: if (copy_from_user((u8 *)&rm_depend, (u8 *)arg, if (copy_from_user(&rm_depend, (const void __user *)arg, sizeof(struct ipa_ioc_rm_dependency))) { retval = -EFAULT; break; Loading @@ -1300,7 +1302,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) rm_depend.resource_name, rm_depend.depends_on_name); break; case IPA_IOC_RM_DEL_DEPENDENCY: if (copy_from_user((u8 *)&rm_depend, (u8 *)arg, if (copy_from_user(&rm_depend, (const void __user *)arg, sizeof(struct ipa_ioc_rm_dependency))) { retval = -EFAULT; break; Loading @@ -1312,7 +1314,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct ipa_ioc_generate_flt_eq flt_eq; if (copy_from_user(&flt_eq, (u8 *)arg, if (copy_from_user(&flt_eq, (const void __user *)arg, sizeof(struct ipa_ioc_generate_flt_eq))) { retval = -EFAULT; break; Loading @@ -1322,7 +1324,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, &flt_eq, if (copy_to_user((void __user *)arg, &flt_eq, sizeof(struct ipa_ioc_generate_flt_eq))) { retval = -EFAULT; break; Loading @@ -1335,7 +1337,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; } case IPA_IOC_QUERY_RT_TBL_INDEX: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_get_rt_tbl_indx))) { retval = -EFAULT; break; Loading @@ -1345,14 +1347,14 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_get_rt_tbl_indx))) { retval = -EFAULT; break; } break; case IPA_IOC_WRITE_QMAPID: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_write_qmapid))) { retval = -EFAULT; break; Loading @@ -1361,7 +1363,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, header, if (copy_to_user((void __user *)arg, header, sizeof(struct ipa_ioc_write_qmapid))) { retval = -EFAULT; break; Loading Loading @@ -1389,7 +1391,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } break; case IPA_IOC_ADD_HDR_PROC_CTX: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_add_hdr_proc_ctx))) { retval = -EFAULT; break; Loading @@ -1405,7 +1407,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1423,13 +1425,13 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } break; case IPA_IOC_DEL_HDR_PROC_CTX: if (copy_from_user(header, (u8 *)arg, if (copy_from_user(header, (const void __user *)arg, sizeof(struct ipa_ioc_del_hdr_proc_ctx))) { retval = -EFAULT; break; Loading @@ -1444,7 +1446,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -ENOMEM; break; } if (copy_from_user(param, (u8 *)arg, pyld_sz)) { if (copy_from_user(param, (const void __user *)arg, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1463,7 +1465,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } Loading @@ -1477,7 +1479,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; } memcpy(param, &ipa_ctx->ipa_hw_type, pyld_sz); if (copy_to_user((u8 *)arg, param, pyld_sz)) { if (copy_to_user((void __user *)arg, param, pyld_sz)) { retval = -EFAULT; break; } Loading Loading @@ -1517,7 +1519,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) * -ENOMEM: failed to allocate memory * -EPERM: failed to add the tables */ int ipa_setup_dflt_rt_tables(void) static int ipa_setup_dflt_rt_tables(void) { struct ipa_ioc_add_rt_rule *rt_rule; struct ipa_rt_rule_add *rt_rule_entry; Loading Loading @@ -1750,39 +1752,6 @@ static void ipa_free_buffer(void *user1, int user2) kfree(user1); } int ipa_q6_pipe_delay(bool zip_pipes) { u32 reg_val = 0; int client_idx; int ep_idx; /* For ZIP pipes, processing is done in AFTER_SHUTDOWN callback. */ for (client_idx = 0; client_idx < IPA_CLIENT_MAX; client_idx++) { /* Skip the processing for non Q6 pipes. */ if (!IPA_CLIENT_IS_Q6_PROD(client_idx)) continue; /* Skip the processing for NON-ZIP pipes. */ else if (zip_pipes && IPA_CLIENT_IS_Q6_NON_ZIP_PROD(client_idx)) continue; /* Skip the processing for ZIP pipes. */ else if (!zip_pipes && IPA_CLIENT_IS_Q6_ZIP_PROD(client_idx)) continue; ep_idx = ipa2_get_ep_mapping(client_idx); if (ep_idx == -1) continue; IPA_SETFIELD_IN_REG(reg_val, 1, IPA_ENDP_INIT_CTRL_N_ENDP_DELAY_SHFT, IPA_ENDP_INIT_CTRL_N_ENDP_DELAY_BMSK); ipa_write_reg(ipa_ctx->mmio, IPA_ENDP_INIT_CTRL_N_OFST(ep_idx), reg_val); } return 0; } int ipa_q6_monitor_holb_mitigation(bool enable) { int ep_idx; Loading Loading @@ -1886,7 +1855,7 @@ static int ipa_q6_clean_q6_tables(void) int num_cmds = 0; int index; int retval; struct ipa_mem_buffer mem = { 0 }; struct ipa_mem_buffer mem = { NULL }; u32 *entry; u32 max_cmds = ipa_get_max_flt_rt_cmds(ipa_ctx->ipa_num_pipes); gfp_t flag = GFP_KERNEL | (ipa_ctx->use_dma_zone ? GFP_DMA : 0); Loading Loading @@ -2217,7 +2186,7 @@ int ipa_q6_post_shutdown_cleanup(void) int _ipa_init_sram_v2(void) { u32 *ipa_sram_mmio; void __iomem *ipa_sram_mmio; unsigned long phys_addr; struct ipa_hw_imm_cmd_dma_shared_mem *cmd = NULL; struct ipa_desc desc = {0}; Loading @@ -2237,7 +2206,7 @@ int _ipa_init_sram_v2(void) return -ENOMEM; } #define IPA_SRAM_SET(ofst, val) (ipa_sram_mmio[(ofst - 4) / 4] = val) #define IPA_SRAM_SET(ofst, val) iowrite32(val, ipa_sram_mmio + (ofst - 4)) IPA_SRAM_SET(IPA_MEM_PART(v6_flt_ofst) - 4, IPA_MEM_CANARY_VAL); IPA_SRAM_SET(IPA_MEM_PART(v6_flt_ofst), IPA_MEM_CANARY_VAL); Loading @@ -2249,6 +2218,7 @@ int _ipa_init_sram_v2(void) IPA_SRAM_SET(IPA_MEM_PART(apps_v4_flt_ofst), IPA_MEM_CANARY_VAL); IPA_SRAM_SET(IPA_MEM_PART(uc_info_ofst), IPA_MEM_CANARY_VAL); iounmap(ipa_sram_mmio); mem.size = IPA_STATUS_CLEAR_SIZE; Loading Loading @@ -2287,7 +2257,7 @@ int _ipa_init_sram_v2(void) int _ipa_init_sram_v2_5(void) { u32 *ipa_sram_mmio; void __iomem *ipa_sram_mmio; unsigned long phys_addr; phys_addr = ipa_ctx->ipa_wrapper_base + Loading @@ -2301,7 +2271,7 @@ int _ipa_init_sram_v2_5(void) return -ENOMEM; } #define IPA_SRAM_SET(ofst, val) (ipa_sram_mmio[(ofst - 4) / 4] = val) #define IPA_SRAM_SET(ofst, val) iowrite32(val, ipa_sram_mmio + (ofst - 4)) IPA_SRAM_SET(IPA_MEM_PART(v4_flt_ofst) - 4, IPA_MEM_CANARY_VAL); IPA_SRAM_SET(IPA_MEM_PART(v4_flt_ofst), IPA_MEM_CANARY_VAL); Loading @@ -2322,15 +2292,15 @@ int _ipa_init_sram_v2_5(void) return 0; } static inline void ipa_sram_set_canary(u32 *sram_mmio, int offset) static inline void ipa_sram_set_canary(void __iomem *sram_mmio, int offset) { /* Set 4 bytes of CANARY before the offset */ sram_mmio[(offset - 4) / 4] = IPA_MEM_CANARY_VAL; iowrite32(IPA_MEM_CANARY_VAL, sram_mmio + (offset - 4)); } int _ipa_init_sram_v2_6L(void) { u32 *ipa_sram_mmio; void __iomem *ipa_sram_mmio; unsigned long phys_addr; phys_addr = ipa_ctx->ipa_wrapper_base + Loading Loading @@ -2877,7 +2847,8 @@ static void ipa_teardown_apps_pipes(void) } #ifdef CONFIG_COMPAT long compat_ipa_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static long compat_ipa_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int retval = 0; struct ipa_ioc_nat_alloc_mem32 nat_mem32; Loading Loading @@ -2924,7 +2895,7 @@ long compat_ipa_ioctl(struct file *file, unsigned int cmd, unsigned long arg) cmd = IPA_IOC_GET_HDR; break; case IPA_IOC_ALLOC_NAT_MEM32: if (copy_from_user((u8 *)&nat_mem32, (u8 *)arg, if (copy_from_user(&nat_mem32, (const void __user *)arg, sizeof(struct ipa_ioc_nat_alloc_mem32))) { retval = -EFAULT; goto ret; Loading @@ -2942,7 +2913,7 @@ long compat_ipa_ioctl(struct file *file, unsigned int cmd, unsigned long arg) goto ret; } nat_mem32.offset = (compat_off_t)nat_mem.offset; if (copy_to_user((u8 *)arg, (u8 *)&nat_mem32, if (copy_to_user((void __user *)arg, (u8 *)&nat_mem32, sizeof(struct ipa_ioc_nat_alloc_mem32))) { retval = -EFAULT; } Loading Loading @@ -3297,7 +3268,8 @@ static void ipa_start_tag_process(struct work_struct *work) * - Remove and deallocate unneeded data structure * - Log the call in the circular history buffer (unless it is a simple call) */ void ipa2_active_clients_log_mod(struct ipa_active_client_logging_info *id, static void ipa2_active_clients_log_mod( struct ipa_active_client_logging_info *id, bool inc, bool int_ctx) { char temp_str[IPA2_ACTIVE_CLIENTS_LOG_LINE_LEN]; Loading Loading @@ -3512,7 +3484,7 @@ void ipa_dec_release_wakelock(enum ipa_wakelock_ref_client ref_client) static int ipa_setup_bam_cfg(const struct ipa_plat_drv_res *res) { void *ipa_bam_mmio; void __iomem *ipa_bam_mmio; int reg_val; int retval = 0; Loading Loading @@ -3842,7 +3814,7 @@ static void ipa_sps_release_resource(struct work_struct *work) mutex_unlock(&ipa_ctx->sps_pm.sps_pm_lock); } int ipa_create_apps_resource(void) static int ipa_create_apps_resource(void) { struct ipa_rm_create_params apps_cons_create_params; struct ipa_rm_perf_profile profile; Loading Loading @@ -3996,9 +3968,14 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, if (ipa_ctx->ipa_hw_mode != IPA_HW_MODE_VIRTUAL) { /* get BUS handle */ /* Check if bus handle is already registered */ if (!register_ipa_bus_hdl) ipa_ctx->ipa_bus_hdl = msm_bus_scale_register_client( ipa_ctx->ctrl->msm_bus_data_ptr); else ipa_ctx->ipa_bus_hdl = register_ipa_bus_hdl; if (!ipa_ctx->ipa_bus_hdl) { IPAERR("fail to register with bus mgr!\n"); result = -EPROBE_DEFER; Loading Loading @@ -4464,6 +4441,7 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, if (bus_scale_table) { msm_bus_cl_clear_pdata(bus_scale_table); bus_scale_table = NULL; register_ipa_bus_hdl = 0; } fail_bus_reg: fail_bind: Loading Loading @@ -4973,6 +4951,36 @@ int ipa_plat_drv_probe(struct platform_device *pdev_p, IPADBG("IPA driver probing started\n"); /* * Due to late initialization of msm_bus in kernel >= 4.14, add * mechanism to defer IPA probing until msm_bus is initialized * successfully. */ if (of_device_is_compatible(dev->of_node, "qcom,ipa")) { if (!ipa_pdev) ipa_pdev = pdev_p; if (!bus_scale_table) bus_scale_table = msm_bus_cl_get_pdata(ipa_pdev); } if (bus_scale_table != NULL) { if (of_device_is_compatible(dev->of_node, "qcom,ipa")) { /* * Register with bus client to check if msm_bus * is completely initialized. */ register_ipa_bus_hdl = msm_bus_scale_register_client( bus_scale_table); if (!register_ipa_bus_hdl) { IPAERR("fail to register with bus mgr!\n"); bus_scale_table = NULL; return -EPROBE_DEFER; } } } else { return -EPROBE_DEFER; } if (of_device_is_compatible(dev->of_node, "qcom,ipa-smmu-ap-cb")) return ipa_smmu_ap_cb_probe(dev); Loading