diff options
| author | Skylar Chang <chiaweic@codeaurora.org> | 2016-03-28 15:51:20 -0700 |
|---|---|---|
| committer | Jeevan Shriram <jshriram@codeaurora.org> | 2016-04-13 11:07:18 -0700 |
| commit | 2668ff4e5436d5c72dad607d3f278d73cf1e6573 (patch) | |
| tree | 9af7467299b833ff922085903155f4e16fd45739 /drivers/platform | |
| parent | 5576240badcdda37af31fd4e8944a8a08d661c6d (diff) | |
msm: ipa: add common internal header
Add a common internal header for ipa_v2 and ipa_v3.
Common definitions should go to this header.
CRs-Fixed: 995821
Change-Id: I39539cf661d9e0e0bb59236c92b169d3054485a9
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Diffstat (limited to 'drivers/platform')
22 files changed, 581 insertions, 553 deletions
diff --git a/drivers/platform/msm/ipa/ipa_api.c b/drivers/platform/msm/ipa/ipa_api.c index 04054fe1211f..a8ccba973776 100644 --- a/drivers/platform/msm/ipa/ipa_api.c +++ b/drivers/platform/msm/ipa/ipa_api.c @@ -76,6 +76,78 @@ static enum ipa_hw_type ipa_api_hw_type; static struct ipa_api_controller *ipa_api_ctrl; +const char *ipa_clients_strings[IPA_CLIENT_MAX] = { + __stringify(IPA_CLIENT_HSIC1_PROD), + __stringify(IPA_CLIENT_WLAN1_PROD), + __stringify(IPA_CLIENT_HSIC2_PROD), + __stringify(IPA_CLIENT_USB2_PROD), + __stringify(IPA_CLIENT_HSIC3_PROD), + __stringify(IPA_CLIENT_USB3_PROD), + __stringify(IPA_CLIENT_HSIC4_PROD), + __stringify(IPA_CLIENT_USB4_PROD), + __stringify(IPA_CLIENT_HSIC5_PROD), + __stringify(IPA_CLIENT_USB_PROD), + __stringify(IPA_CLIENT_A5_WLAN_AMPDU_PROD), + __stringify(IPA_CLIENT_A2_EMBEDDED_PROD), + __stringify(IPA_CLIENT_A2_TETHERED_PROD), + __stringify(IPA_CLIENT_APPS_LAN_WAN_PROD), + __stringify(IPA_CLIENT_APPS_CMD_PROD), + __stringify(IPA_CLIENT_ODU_PROD), + __stringify(IPA_CLIENT_MHI_PROD), + __stringify(IPA_CLIENT_Q6_LAN_PROD), + __stringify(IPA_CLIENT_Q6_WAN_PROD), + __stringify(IPA_CLIENT_Q6_CMD_PROD), + __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_PROD), + __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD), + __stringify(IPA_CLIENT_Q6_DECOMP_PROD), + __stringify(IPA_CLIENT_Q6_DECOMP2_PROD), + __stringify(IPA_CLIENT_UC_USB_PROD), + + /* Below PROD client type is only for test purpose */ + __stringify(IPA_CLIENT_TEST_PROD), + __stringify(IPA_CLIENT_TEST1_PROD), + __stringify(IPA_CLIENT_TEST2_PROD), + __stringify(IPA_CLIENT_TEST3_PROD), + __stringify(IPA_CLIENT_TEST4_PROD), + + __stringify(IPA_CLIENT_HSIC1_CONS), + __stringify(IPA_CLIENT_WLAN1_CONS), + __stringify(IPA_CLIENT_HSIC2_CONS), + __stringify(IPA_CLIENT_USB2_CONS), + __stringify(IPA_CLIENT_WLAN2_CONS), + __stringify(IPA_CLIENT_HSIC3_CONS), + __stringify(IPA_CLIENT_USB3_CONS), + __stringify(IPA_CLIENT_WLAN3_CONS), + __stringify(IPA_CLIENT_HSIC4_CONS), + __stringify(IPA_CLIENT_USB4_CONS), + __stringify(IPA_CLIENT_WLAN4_CONS), + __stringify(IPA_CLIENT_HSIC5_CONS), + __stringify(IPA_CLIENT_USB_CONS), + __stringify(IPA_CLIENT_USB_DPL_CONS), + __stringify(IPA_CLIENT_A2_EMBEDDED_CONS), + __stringify(IPA_CLIENT_A2_TETHERED_CONS), + __stringify(IPA_CLIENT_A5_LAN_WAN_CONS), + __stringify(IPA_CLIENT_APPS_LAN_CONS), + __stringify(IPA_CLIENT_APPS_WAN_CONS), + __stringify(IPA_CLIENT_ODU_EMB_CONS), + __stringify(IPA_CLIENT_ODU_TETH_CONS), + __stringify(IPA_CLIENT_MHI_CONS), + __stringify(IPA_CLIENT_Q6_LAN_CONS), + __stringify(IPA_CLIENT_Q6_WAN_CONS), + __stringify(IPA_CLIENT_Q6_DUN_CONS), + __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_CONS), + __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS), + __stringify(IPA_CLIENT_Q6_DECOMP_CONS), + __stringify(IPA_CLIENT_Q6_DECOMP2_CONS), + __stringify(IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS), + /* Below CONS client type is only for test purpose */ + __stringify(IPA_CLIENT_TEST_CONS), + __stringify(IPA_CLIENT_TEST1_CONS), + __stringify(IPA_CLIENT_TEST2_CONS), + __stringify(IPA_CLIENT_TEST3_CONS), + __stringify(IPA_CLIENT_TEST4_CONS), +}; + /** * ipa_connect() - low-level IPA client connect @@ -2634,6 +2706,136 @@ int ipa_register_ipa_ready_cb(void (*ipa_ready_cb)(void *user_data), } EXPORT_SYMBOL(ipa_register_ipa_ready_cb); +/** + * ipa_inc_client_enable_clks() - Increase active clients counter, and + * enable ipa clocks if necessary + * + * Please do not use this API, use the wrapper macros instead (ipa_i.h) + * IPA_ACTIVE_CLIENTS_INC_XXX(); + * + * Return codes: + * None +*/ +void ipa_inc_client_enable_clks(struct ipa_active_client_logging_info *id) +{ + IPA_API_DISPATCH(ipa_inc_client_enable_clks, id); +} +EXPORT_SYMBOL(ipa_inc_client_enable_clks); + +/** + * ipa_dec_client_disable_clks() - Increase active clients counter, and + * enable ipa clocks if necessary + * + * Please do not use this API, use the wrapper macros instead (ipa_i.h) + * IPA_ACTIVE_CLIENTS_DEC_XXX(); + * + * Return codes: + * None +*/ +void ipa_dec_client_disable_clks(struct ipa_active_client_logging_info *id) +{ + IPA_API_DISPATCH(ipa_dec_client_disable_clks, id); +} +EXPORT_SYMBOL(ipa_dec_client_disable_clks); + +/** + * ipa_inc_client_enable_clks_no_block() - Only increment the number of active + * clients if no asynchronous actions should be done.Asynchronous actions are + * locking a mutex and waking up IPA HW. + * + * Please do not use this API, use the wrapper macros instead(ipa_i.h) + * + * + * Return codes : 0 for success + * -EPERM if an asynchronous action should have been done + */ +int ipa_inc_client_enable_clks_no_block( + struct ipa_active_client_logging_info *id) +{ + int ret; + + IPA_API_DISPATCH_RETURN(ipa_inc_client_enable_clks_no_block, id); + + return ret; +} +EXPORT_SYMBOL(ipa_inc_client_enable_clks_no_block); + +/** +* ipa_suspend_resource_no_block() - suspend client endpoints related to the +* IPA_RM resource and decrement active clients counter. This function is +* guaranteed to avoid sleeping. +* +* @resource: [IN] IPA Resource Manager resource +* +* Return codes: 0 on success, negative on failure. +*/ +int ipa_suspend_resource_no_block(enum ipa_rm_resource_name resource) +{ + int ret; + + IPA_API_DISPATCH_RETURN(ipa_suspend_resource_no_block, resource); + + return ret; +} +EXPORT_SYMBOL(ipa_suspend_resource_no_block); +/** + * ipa_resume_resource() - resume client endpoints related to the IPA_RM + * resource. + * + * @resource: [IN] IPA Resource Manager resource + * + * Return codes: 0 on success, negative on failure. + */ +int ipa_resume_resource(enum ipa_rm_resource_name resource) +{ + int ret; + + IPA_API_DISPATCH_RETURN(ipa_resume_resource, resource); + + return ret; +} +EXPORT_SYMBOL(ipa_resume_resource); + +/** + * ipa_suspend_resource_sync() - suspend client endpoints related to the IPA_RM + * resource and decrement active clients counter, which may result in clock + * gating of IPA clocks. + * + * @resource: [IN] IPA Resource Manager resource + * + * Return codes: 0 on success, negative on failure. + */ +int ipa_suspend_resource_sync(enum ipa_rm_resource_name resource) +{ + int ret; + + IPA_API_DISPATCH_RETURN(ipa_suspend_resource_sync, resource); + + return ret; +} +EXPORT_SYMBOL(ipa_suspend_resource_sync); + +/** + * ipa_set_required_perf_profile() - set IPA to the specified performance + * profile based on the bandwidth, unless minimum voltage required is + * higher. In this case the floor_voltage specified will be used. + * @floor_voltage: minimum voltage to operate + * @bandwidth_mbps: needed bandwidth from IPA + * + * Return codes: 0 on success, negative on failure. + */ +int ipa_set_required_perf_profile(enum ipa_voltage_level floor_voltage, + u32 bandwidth_mbps) +{ + int ret; + + IPA_API_DISPATCH_RETURN(ipa_set_required_perf_profile, floor_voltage, + bandwidth_mbps); + + return ret; +} +EXPORT_SYMBOL(ipa_set_required_perf_profile); + static const struct dev_pm_ops ipa_pm_ops = { .suspend_noirq = ipa_ap_suspend, .resume_noirq = ipa_ap_resume, diff --git a/drivers/platform/msm/ipa/ipa_api.h b/drivers/platform/msm/ipa/ipa_api.h index 04b7ba64a6aa..6cab1273e7e9 100644 --- a/drivers/platform/msm/ipa/ipa_api.h +++ b/drivers/platform/msm/ipa/ipa_api.h @@ -10,6 +10,8 @@ * GNU General Public License for more details. */ +#include "ipa_common_i.h" + #ifndef _IPA_API_H_ #define _IPA_API_H_ @@ -325,6 +327,25 @@ struct ipa_api_controller { int (*ipa_register_ipa_ready_cb)(void (*ipa_ready_cb)(void *user_data), void *user_data); + void (*ipa_inc_client_enable_clks)( + struct ipa_active_client_logging_info *id); + + void (*ipa_dec_client_disable_clks)( + struct ipa_active_client_logging_info *id); + + int (*ipa_inc_client_enable_clks_no_block)( + struct ipa_active_client_logging_info *id); + + int (*ipa_suspend_resource_no_block)( + enum ipa_rm_resource_name resource); + + int (*ipa_resume_resource)(enum ipa_rm_resource_name name); + + int (*ipa_suspend_resource_sync)(enum ipa_rm_resource_name resource); + + int (*ipa_set_required_perf_profile)( + enum ipa_voltage_level floor_voltage, u32 bandwidth_mbps); + }; #ifdef CONFIG_IPA diff --git a/drivers/platform/msm/ipa/ipa_common_i.h b/drivers/platform/msm/ipa/ipa_common_i.h new file mode 100644 index 000000000000..8149837b2de0 --- /dev/null +++ b/drivers/platform/msm/ipa/ipa_common_i.h @@ -0,0 +1,128 @@ +/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _IPA_COMMON_I_H_ +#define _IPA_COMMON_I_H_ + +#define __FILENAME__ \ + (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) + +#define IPA_ACTIVE_CLIENTS_PREP_EP(log_info, client) \ + log_info.file = __FILENAME__; \ + log_info.line = __LINE__; \ + log_info.type = EP; \ + log_info.id_string = ipa_clients_strings[client] + +#define IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info) \ + log_info.file = __FILENAME__; \ + log_info.line = __LINE__; \ + log_info.type = SIMPLE; \ + log_info.id_string = __func__ + +#define IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name) \ + log_info.file = __FILENAME__; \ + log_info.line = __LINE__; \ + log_info.type = RESOURCE; \ + log_info.id_string = resource_name + +#define IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str) \ + log_info.file = __FILENAME__; \ + log_info.line = __LINE__; \ + log_info.type = SPECIAL; \ + log_info.id_string = id_str + +#define IPA_ACTIVE_CLIENTS_INC_EP(client) \ + do { \ + struct ipa_active_client_logging_info log_info; \ + IPA_ACTIVE_CLIENTS_PREP_EP(log_info, client); \ + ipa_inc_client_enable_clks(&log_info); \ + } while (0) + +#define IPA_ACTIVE_CLIENTS_DEC_EP(client) \ + do { \ + struct ipa_active_client_logging_info log_info; \ + IPA_ACTIVE_CLIENTS_PREP_EP(log_info, client); \ + ipa_dec_client_disable_clks(&log_info); \ + } while (0) + +#define IPA_ACTIVE_CLIENTS_INC_SIMPLE() \ + do { \ + struct ipa_active_client_logging_info log_info; \ + IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); \ + ipa_inc_client_enable_clks(&log_info); \ + } while (0) + +#define IPA_ACTIVE_CLIENTS_DEC_SIMPLE() \ + do { \ + struct ipa_active_client_logging_info log_info; \ + IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); \ + ipa_dec_client_disable_clks(&log_info); \ + } while (0) + +#define IPA_ACTIVE_CLIENTS_INC_RESOURCE(resource_name) \ + do { \ + struct ipa_active_client_logging_info log_info; \ + IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name); \ + ipa_inc_client_enable_clks(&log_info); \ + } while (0) + +#define IPA_ACTIVE_CLIENTS_DEC_RESOURCE(resource_name) \ + do { \ + struct ipa_active_client_logging_info log_info; \ + IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name); \ + ipa_dec_client_disable_clks(&log_info); \ + } while (0) + +#define IPA_ACTIVE_CLIENTS_INC_SPECIAL(id_str) \ + do { \ + struct ipa_active_client_logging_info log_info; \ + IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str); \ + ipa_inc_client_enable_clks(&log_info); \ + } while (0) + +#define IPA_ACTIVE_CLIENTS_DEC_SPECIAL(id_str) \ + do { \ + struct ipa_active_client_logging_info log_info; \ + IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str); \ + ipa_dec_client_disable_clks(&log_info); \ + } while (0) + + +enum ipa_active_client_log_type { + EP, + SIMPLE, + RESOURCE, + SPECIAL, + INVALID +}; + +struct ipa_active_client_logging_info { + const char *id_string; + char *file; + int line; + enum ipa_active_client_log_type type; +}; + +extern const char *ipa_clients_strings[]; + +void ipa_inc_client_enable_clks(struct ipa_active_client_logging_info *id); +void ipa_dec_client_disable_clks(struct ipa_active_client_logging_info *id); +int ipa_inc_client_enable_clks_no_block( + struct ipa_active_client_logging_info *id); +int ipa_suspend_resource_no_block(enum ipa_rm_resource_name resource); +int ipa_resume_resource(enum ipa_rm_resource_name name); +int ipa_suspend_resource_sync(enum ipa_rm_resource_name resource); +int ipa_set_required_perf_profile(enum ipa_voltage_level floor_voltage, + u32 bandwidth_mbps); + + +#endif /* _IPA_COMMON_I_H_ */ diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa.c b/drivers/platform/msm/ipa/ipa_v2/ipa.c index 8c825d1f4749..2e82d04f56ec 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa.c @@ -206,78 +206,6 @@ static bool smmu_disable_htw; static char *active_clients_table_buf; -const char *ipa2_clients_strings[IPA_CLIENT_MAX] = { - __stringify(IPA_CLIENT_HSIC1_PROD), - __stringify(IPA_CLIENT_WLAN1_PROD), - __stringify(IPA_CLIENT_USB2_PROD), - __stringify(IPA_CLIENT_HSIC3_PROD), - __stringify(IPA_CLIENT_HSIC2_PROD), - __stringify(IPA_CLIENT_USB3_PROD), - __stringify(IPA_CLIENT_HSIC4_PROD), - __stringify(IPA_CLIENT_USB4_PROD), - __stringify(IPA_CLIENT_HSIC5_PROD), - __stringify(IPA_CLIENT_USB_PROD), - __stringify(IPA_CLIENT_A5_WLAN_AMPDU_PROD), - __stringify(IPA_CLIENT_A2_EMBEDDED_PROD), - __stringify(IPA_CLIENT_A2_TETHERED_PROD), - __stringify(IPA_CLIENT_APPS_LAN_WAN_PROD), - __stringify(IPA_CLIENT_APPS_CMD_PROD), - __stringify(IPA_CLIENT_ODU_PROD), - __stringify(IPA_CLIENT_MHI_PROD), - __stringify(IPA_CLIENT_Q6_LAN_PROD), - __stringify(IPA_CLIENT_Q6_WAN_PROD), - __stringify(IPA_CLIENT_Q6_CMD_PROD), - __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_PROD), - __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD), - __stringify(IPA_CLIENT_Q6_DECOMP_PROD), - __stringify(IPA_CLIENT_Q6_DECOMP2_PROD), - __stringify(IPA_CLIENT_UC_USB_PROD), - - /* Below PROD client type is only for test purpose */ - __stringify(IPA_CLIENT_TEST_PROD), - __stringify(IPA_CLIENT_TEST1_PROD), - __stringify(IPA_CLIENT_TEST2_PROD), - __stringify(IPA_CLIENT_TEST3_PROD), - __stringify(IPA_CLIENT_TEST4_PROD), - - __stringify(IPA_CLIENT_HSIC1_CONS), - __stringify(IPA_CLIENT_WLAN1_CONS), - __stringify(IPA_CLIENT_HSIC2_CONS), - __stringify(IPA_CLIENT_USB2_CONS), - __stringify(IPA_CLIENT_WLAN2_CONS), - __stringify(IPA_CLIENT_HSIC3_CONS), - __stringify(IPA_CLIENT_USB3_CONS), - __stringify(IPA_CLIENT_WLAN3_CONS), - __stringify(IPA_CLIENT_HSIC4_CONS), - __stringify(IPA_CLIENT_USB4_CONS), - __stringify(IPA_CLIENT_WLAN4_CONS), - __stringify(IPA_CLIENT_HSIC5_CONS), - __stringify(IPA_CLIENT_USB_CONS), - __stringify(IPA_CLIENT_USB_DPL_CONS), - __stringify(IPA_CLIENT_A2_EMBEDDED_CONS), - __stringify(IPA_CLIENT_A2_TETHERED_CONS), - __stringify(IPA_CLIENT_A5_LAN_WAN_CONS), - __stringify(IPA_CLIENT_APPS_LAN_CONS), - __stringify(IPA_CLIENT_APPS_WAN_CONS), - __stringify(IPA_CLIENT_ODU_EMB_CONS), - __stringify(IPA_CLIENT_ODU_TETH_CONS), - __stringify(IPA_CLIENT_MHI_CONS), - __stringify(IPA_CLIENT_Q6_LAN_CONS), - __stringify(IPA_CLIENT_Q6_WAN_CONS), - __stringify(IPA_CLIENT_Q6_DUN_CONS), - __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_CONS), - __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS), - __stringify(IPA_CLIENT_Q6_DECOMP_CONS), - __stringify(IPA_CLIENT_Q6_DECOMP2_CONS), - __stringify(IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS), - /* Below CONS client type is only for test purpose */ - __stringify(IPA_CLIENT_TEST_CONS), - __stringify(IPA_CLIENT_TEST1_CONS), - __stringify(IPA_CLIENT_TEST2_CONS), - __stringify(IPA_CLIENT_TEST3_CONS), - __stringify(IPA_CLIENT_TEST4_CONS), -}; - int ipa2_active_clients_log_print_buffer(char *buf, int size) { int i; @@ -626,7 +554,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) if (_IOC_NR(cmd) >= IPA_IOCTL_MAX) return -ENOTTY; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); switch (cmd) { case IPA_IOC_ALLOC_NAT_MEM: @@ -1329,12 +1257,12 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; default: /* redundant, as cmd was checked against MAXNR */ - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return -ENOTTY; } kfree(param); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return retval; } @@ -1521,7 +1449,7 @@ int ipa_init_q6_smem(void) { int rc; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); if (ipa_ctx->ipa_hw_type == IPA_HW_v2_0) rc = ipa_init_smem_region(IPA_MEM_PART(modem_size) - @@ -1533,7 +1461,7 @@ int ipa_init_q6_smem(void) if (rc) { IPAERR("failed to initialize Modem RAM memory\n"); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return rc; } @@ -1541,7 +1469,7 @@ int ipa_init_q6_smem(void) IPA_MEM_PART(modem_hdr_ofst)); if (rc) { IPAERR("failed to initialize Modem HDRs RAM memory\n"); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return rc; } @@ -1549,7 +1477,7 @@ int ipa_init_q6_smem(void) IPA_MEM_PART(modem_hdr_proc_ctx_ofst)); if (rc) { IPAERR("failed to initialize Modem proc ctx RAM memory\n"); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return rc; } @@ -1557,11 +1485,11 @@ int ipa_init_q6_smem(void) IPA_MEM_PART(modem_comp_decomp_ofst)); if (rc) { IPAERR("failed to initialize Modem Comp/Decomp RAM memory\n"); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return rc; } - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return rc; } @@ -1609,7 +1537,7 @@ int ipa_q6_monitor_holb_mitigation(bool enable) int ep_idx; int client_idx; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); for (client_idx = 0; client_idx < IPA_CLIENT_MAX; client_idx++) { if (IPA_CLIENT_IS_Q6_NON_ZIP_CONS(client_idx)) { ep_idx = ipa2_get_ep_mapping(client_idx); @@ -1621,7 +1549,7 @@ int ipa_q6_monitor_holb_mitigation(bool enable) ipa_uc_monitor_holb(client_idx, enable); } } - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return 0; } @@ -1957,7 +1885,7 @@ int ipa_q6_pre_shutdown_cleanup(void) if (ipa_ctx->uc_ctx.uc_zip_error) BUG(); - IPA2_ACTIVE_CLIENTS_INC_SPECIAL("Q6"); + IPA_ACTIVE_CLIENTS_INC_SPECIAL("Q6"); /* * pipe delay and holb discard for ZIP pipes are handled * in post shutdown callback. @@ -3010,7 +2938,7 @@ static void ipa_start_tag_process(struct work_struct *work) if (res) IPAERR("ipa_tag_aggr_force_close failed %d\n", res); - IPA2_ACTIVE_CLIENTS_DEC_SPECIAL("TAG_PROCESS"); + IPA_ACTIVE_CLIENTS_DEC_SPECIAL("TAG_PROCESS"); IPADBG("TAG process done\n"); } @@ -3038,7 +2966,7 @@ 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 ipa2_active_client_logging_info *id, +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]; @@ -3094,13 +3022,13 @@ void ipa2_active_clients_log_mod(struct ipa2_active_client_logging_info *id, } } -void ipa2_active_clients_log_dec(struct ipa2_active_client_logging_info *id, +void ipa2_active_clients_log_dec(struct ipa_active_client_logging_info *id, bool int_ctx) { ipa2_active_clients_log_mod(id, false, int_ctx); } -void ipa2_active_clients_log_inc(struct ipa2_active_client_logging_info *id, +void ipa2_active_clients_log_inc(struct ipa_active_client_logging_info *id, bool int_ctx) { ipa2_active_clients_log_mod(id, true, int_ctx); @@ -3116,7 +3044,7 @@ void ipa2_active_clients_log_inc(struct ipa2_active_client_logging_info *id, * Return codes: * None */ -void ipa2_inc_client_enable_clks(struct ipa2_active_client_logging_info *id) +void ipa2_inc_client_enable_clks(struct ipa_active_client_logging_info *id) { ipa_active_clients_lock(); ipa2_active_clients_log_inc(id, false); @@ -3138,7 +3066,7 @@ void ipa2_inc_client_enable_clks(struct ipa2_active_client_logging_info *id) * Return codes: 0 for success * -EPERM if an asynchronous action should have been done */ -int ipa2_inc_client_enable_clks_no_block(struct ipa2_active_client_logging_info +int ipa2_inc_client_enable_clks_no_block(struct ipa_active_client_logging_info *id) { int res = 0; @@ -3176,9 +3104,9 @@ bail: * Return codes: * None */ -void ipa2_dec_client_disable_clks(struct ipa2_active_client_logging_info *id) +void ipa2_dec_client_disable_clks(struct ipa_active_client_logging_info *id) { - struct ipa2_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; ipa_active_clients_lock(); ipa2_active_clients_log_dec(id, false); @@ -3186,7 +3114,7 @@ void ipa2_dec_client_disable_clks(struct ipa2_active_client_logging_info *id) IPADBG("active clients = %d\n", ipa_ctx->ipa_active_clients.cnt); if (ipa_ctx->ipa_active_clients.cnt == 0) { if (ipa_ctx->tag_process_before_gating) { - IPA2_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, + IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, "TAG_PROCESS"); ipa2_active_clients_log_inc(&log_info, false); ipa_ctx->tag_process_before_gating = false; @@ -3282,7 +3210,7 @@ fail: return retval; } -int ipa_set_required_perf_profile(enum ipa_voltage_level floor_voltage, +int ipa2_set_required_perf_profile(enum ipa_voltage_level floor_voltage, u32 bandwidth_mbps) { enum ipa_voltage_level needed_voltage; @@ -3474,7 +3402,7 @@ void ipa_suspend_handler(enum ipa_irq_type interrupt, if (!atomic_read( &ipa_ctx->sps_pm.dec_clients) ) { - IPA2_ACTIVE_CLIENTS_INC_EP( + IPA_ACTIVE_CLIENTS_INC_EP( ipa_ctx->ep[i].client); IPADBG("Pipes un-suspended.\n"); IPADBG("Enter poll mode.\n"); @@ -3551,7 +3479,7 @@ static void ipa_sps_release_resource(struct work_struct *work) ipa_sps_process_irq_schedule_rel(); } else { atomic_set(&ipa_ctx->sps_pm.dec_clients, 0); - IPA2_ACTIVE_CLIENTS_DEC_SPECIAL("SPS_RESOURCE"); + IPA_ACTIVE_CLIENTS_DEC_SPECIAL("SPS_RESOURCE"); } } atomic_set(&ipa_ctx->sps_pm.eot_activity, 0); @@ -3622,7 +3550,7 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, struct sps_bam_props bam_props = { 0 }; struct ipa_flt_tbl *flt_tbl; struct ipa_rt_tbl_set *rset; - struct ipa2_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; IPADBG("IPA Driver initialization started\n"); @@ -3746,7 +3674,7 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, mutex_init(&ipa_ctx->ipa_active_clients.mutex); spin_lock_init(&ipa_ctx->ipa_active_clients.spinlock); - IPA2_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, "PROXY_CLK_VOTE"); + IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, "PROXY_CLK_VOTE"); ipa2_active_clients_log_inc(&log_info, false); ipa_ctx->ipa_active_clients.cnt = 1; diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_client.c b/drivers/platform/msm/ipa/ipa_v2/ipa_client.c index b3f50dd52528..f1742e05c598 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_client.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_client.c @@ -289,7 +289,7 @@ int ipa2_connect(const struct ipa_connect_params *in, } memset(&ipa_ctx->ep[ipa_ep_idx], 0, sizeof(struct ipa_ep_context)); - IPA2_ACTIVE_CLIENTS_INC_EP(in->client); + IPA_ACTIVE_CLIENTS_INC_EP(in->client); ep->skip_ep_cfg = in->skip_ep_cfg; @@ -432,7 +432,7 @@ int ipa2_connect(const struct ipa_connect_params *in, ipa_install_dflt_flt_rules(ipa_ep_idx); if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_DEC_EP(in->client); + IPA_ACTIVE_CLIENTS_DEC_EP(in->client); IPADBG("client %d (ep: %d) connected\n", in->client, ipa_ep_idx); @@ -486,7 +486,7 @@ desc_mem_alloc_fail: sps_free_endpoint(ep->ep_hdl); ipa_cfg_ep_fail: memset(&ipa_ctx->ep[ipa_ep_idx], 0, sizeof(struct ipa_ep_context)); - IPA2_ACTIVE_CLIENTS_DEC_EP(in->client); + IPA_ACTIVE_CLIENTS_DEC_EP(in->client); fail: return result; } @@ -556,7 +556,7 @@ int ipa2_disconnect(u32 clnt_hdl) ep = &ipa_ctx->ep[clnt_hdl]; client_type = ipa2_get_client_mapping(clnt_hdl); if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_INC_EP(client_type); + IPA_ACTIVE_CLIENTS_INC_EP(client_type); /* Set Disconnect in Progress flag. */ spin_lock(&ipa_ctx->disconnect_lock); @@ -663,7 +663,7 @@ int ipa2_disconnect(u32 clnt_hdl) memset(&ipa_ctx->ep[clnt_hdl], 0, sizeof(struct ipa_ep_context)); spin_unlock(&ipa_ctx->disconnect_lock); - IPA2_ACTIVE_CLIENTS_DEC_EP(client_type); + IPA_ACTIVE_CLIENTS_DEC_EP(client_type); IPADBG("client (ep: %d) disconnected\n", clnt_hdl); @@ -694,7 +694,7 @@ int ipa2_reset_endpoint(u32 clnt_hdl) } ep = &ipa_ctx->ep[clnt_hdl]; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); res = sps_disconnect(ep->ep_hdl); if (res) { IPAERR("sps_disconnect() failed, res=%d.\n", res); @@ -709,7 +709,7 @@ int ipa2_reset_endpoint(u32 clnt_hdl) } bail: - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return res; } @@ -761,7 +761,7 @@ int ipa2_clear_endpoint_delay(u32 clnt_hdl) ep->qmi_request_sent = true; } - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); /* Set disconnect in progress flag so further flow control events are * not honored. */ @@ -774,7 +774,7 @@ int ipa2_clear_endpoint_delay(u32 clnt_hdl) ep_ctrl.ipa_ep_suspend = false; ipa2_cfg_ep_ctrl(clnt_hdl, &ep_ctrl); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); IPADBG("client (ep: %d) removed ep delay\n", clnt_hdl); diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c b/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c index daf6091aad67..756bd7be9bb9 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -158,9 +158,9 @@ static ssize_t ipa_read_gen_reg(struct file *file, char __user *ubuf, { int nbytes; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); nbytes = ipa_ctx->ctrl->ipa_read_gen_reg(dbg_buff, IPA_MAX_MSG_LEN); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return simple_read_from_buffer(ubuf, count, ppos, dbg_buff, nbytes); } @@ -328,7 +328,7 @@ static ssize_t ipa_read_ep_reg(struct file *file, char __user *ubuf, end_idx = start_idx + 1; } pos = *ppos; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); for (i = start_idx; i < end_idx; i++) { nbytes = ipa_ctx->ctrl->ipa_read_ep_reg(dbg_buff, @@ -338,7 +338,7 @@ static ssize_t ipa_read_ep_reg(struct file *file, char __user *ubuf, ret = simple_read_from_buffer(ubuf, count, ppos, dbg_buff, nbytes); if (ret < 0) { - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return ret; } @@ -346,7 +346,7 @@ static ssize_t ipa_read_ep_reg(struct file *file, char __user *ubuf, ubuf += nbytes; count -= nbytes; } - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); *ppos = pos + size; return size; @@ -370,9 +370,9 @@ static ssize_t ipa_write_keep_awake(struct file *file, const char __user *buf, return -EFAULT; if (option == 1) - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); else if (option == 0) - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); else return -EFAULT; @@ -1230,9 +1230,9 @@ static ssize_t ipa_write_dbg_cnt(struct file *file, const char __user *buf, if (kstrtou32(dbg_buff, 0, &option)) return -EFAULT; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); ipa_ctx->ctrl->ipa_write_dbg_cnt(option); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return count; } @@ -1264,9 +1264,9 @@ static ssize_t ipa_read_dbg_cnt(struct file *file, char __user *ubuf, { int nbytes; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); nbytes = ipa_ctx->ctrl->ipa_read_dbg_cnt(dbg_buff, IPA_MAX_MSG_LEN); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return simple_read_from_buffer(ubuf, count, ppos, dbg_buff, nbytes); } diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_dma.c b/drivers/platform/msm/ipa/ipa_v2/ipa_dma.c index 90d3bb4c5e95..e08f281b1864 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_dma.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_dma.c @@ -274,7 +274,7 @@ int ipa2_dma_enable(void) mutex_unlock(&ipa_dma_ctx->enable_lock); return -EPERM; } - IPA2_ACTIVE_CLIENTS_INC_SPECIAL("DMA"); + IPA_ACTIVE_CLIENTS_INC_SPECIAL("DMA"); ipa_dma_ctx->is_enabled = true; mutex_unlock(&ipa_dma_ctx->enable_lock); @@ -337,7 +337,7 @@ int ipa2_dma_disable(void) } ipa_dma_ctx->is_enabled = false; spin_unlock_irqrestore(&ipa_dma_ctx->pending_lock, flags); - IPA2_ACTIVE_CLIENTS_DEC_SPECIAL("DMA"); + IPA_ACTIVE_CLIENTS_DEC_SPECIAL("DMA"); mutex_unlock(&ipa_dma_ctx->enable_lock); IPADMA_FUNC_EXIT(); return 0; diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v2/ipa_dp.c index 5929bfc8f96e..25b29cdb3e32 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_dp.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_dp.c @@ -254,7 +254,7 @@ static void ipa_handle_tx(struct ipa_sys_context *sys) int inactive_cycles = 0; int cnt; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); do { cnt = ipa_handle_tx_core(sys, true, true); if (cnt == 0) { @@ -267,7 +267,7 @@ static void ipa_handle_tx(struct ipa_sys_context *sys) } while (inactive_cycles <= POLLING_INACTIVITY_TX); ipa_tx_switch_to_intr_mode(sys); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); } static void ipa_wq_handle_tx(struct work_struct *work) @@ -653,7 +653,7 @@ int ipa_send_cmd(u16 num_desc, struct ipa_desc *descr) } sys = ipa_ctx->ep[ep_idx].sys; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); if (num_desc == 1) { init_completion(&descr->xfer_done); @@ -687,7 +687,7 @@ int ipa_send_cmd(u16 num_desc, struct ipa_desc *descr) } bail: - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return result; } @@ -1002,7 +1002,7 @@ static void ipa_handle_rx(struct ipa_sys_context *sys) int inactive_cycles = 0; int cnt; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); do { cnt = ipa_handle_rx_core(sys, true, true); if (cnt == 0) { @@ -1026,7 +1026,7 @@ static void ipa_handle_rx(struct ipa_sys_context *sys) trace_poll_to_intr(sys->ep->client); ipa_rx_switch_to_intr_mode(sys); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); } static void switch_to_intr_rx_work_func(struct work_struct *work) @@ -1118,7 +1118,7 @@ int ipa2_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl) ep = &ipa_ctx->ep[ipa_ep_idx]; - IPA2_ACTIVE_CLIENTS_INC_EP(sys_in->client); + IPA_ACTIVE_CLIENTS_INC_EP(sys_in->client); if (ep->valid == 1) { if (sys_in->client != IPA_CLIENT_APPS_LAN_WAN_PROD) { @@ -1143,7 +1143,7 @@ int ipa2_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl) ep->priv = sys_in->priv; *clnt_hdl = ipa_ep_idx; if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_DEC_EP(sys_in->client); + IPA_ACTIVE_CLIENTS_DEC_EP(sys_in->client); return 0; } @@ -1357,7 +1357,7 @@ int ipa2_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl) } if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_DEC_EP(sys_in->client); + IPA_ACTIVE_CLIENTS_DEC_EP(sys_in->client); IPADBG("client %d (ep: %d) connected sys=%p\n", sys_in->client, ipa_ep_idx, ep->sys); @@ -1380,7 +1380,7 @@ fail_wq: kfree(ep->sys); memset(&ipa_ctx->ep[ipa_ep_idx], 0, sizeof(struct ipa_ep_context)); fail_and_disable_clocks: - IPA2_ACTIVE_CLIENTS_DEC_EP(sys_in->client); + IPA_ACTIVE_CLIENTS_DEC_EP(sys_in->client); fail_gen: return result; } @@ -1410,7 +1410,7 @@ int ipa2_teardown_sys_pipe(u32 clnt_hdl) ep = &ipa_ctx->ep[clnt_hdl]; if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_disable_data_path(clnt_hdl); ep->valid = 0; @@ -1456,7 +1456,7 @@ int ipa2_teardown_sys_pipe(u32 clnt_hdl) if (!atomic_read(&ipa_ctx->wc_memb.active_clnt_cnt)) ipa_cleanup_wlan_rx_common_cache(); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); IPADBG("client (ep: %d) disconnected\n", clnt_hdl); @@ -2065,9 +2065,9 @@ static void replenish_rx_work_func(struct work_struct *work) dwork = container_of(work, struct delayed_work, work); sys = container_of(dwork, struct ipa_sys_context, replenish_rx_work); - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); sys->repl_hdlr(sys); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); } /** @@ -3295,7 +3295,7 @@ int ipa2_sys_setup(struct ipa_sys_connect_params *sys_in, ep = &ipa_ctx->ep[ipa_ep_idx]; - IPA2_ACTIVE_CLIENTS_INC_EP(sys_in->client); + IPA_ACTIVE_CLIENTS_INC_EP(sys_in->client); if (ep->valid == 1) { if (sys_in->client != IPA_CLIENT_APPS_LAN_WAN_PROD) { @@ -3322,7 +3322,7 @@ int ipa2_sys_setup(struct ipa_sys_connect_params *sys_in, ep->priv = sys_in->priv; *clnt_hdl = ipa_ep_idx; if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_DEC_EP(sys_in->client); + IPA_ACTIVE_CLIENTS_DEC_EP(sys_in->client); return 0; } @@ -3363,7 +3363,7 @@ int ipa2_sys_setup(struct ipa_sys_connect_params *sys_in, *ipa_bam_hdl = ipa_ctx->bam_handle; if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_DEC_EP(sys_in->client); + IPA_ACTIVE_CLIENTS_DEC_EP(sys_in->client); ipa_ctx->skip_ep_cfg_shadow[ipa_ep_idx] = ep->skip_ep_cfg; IPADBG("client %d (ep: %d) connected sys=%p\n", sys_in->client, @@ -3373,7 +3373,7 @@ int ipa2_sys_setup(struct ipa_sys_connect_params *sys_in, fail_gen2: fail_and_disable_clocks: - IPA2_ACTIVE_CLIENTS_DEC_EP(sys_in->client); + IPA_ACTIVE_CLIENTS_DEC_EP(sys_in->client); fail_gen: return result; } @@ -3391,12 +3391,12 @@ int ipa2_sys_teardown(u32 clnt_hdl) ep = &ipa_ctx->ep[clnt_hdl]; if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_disable_data_path(clnt_hdl); ep->valid = 0; - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); IPADBG("client (ep: %d) disconnected\n", clnt_hdl); diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_i.h b/drivers/platform/msm/ipa/ipa_v2/ipa_i.h index 3f538a3ed8cf..8d7b300d0aef 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_i.h +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_i.h @@ -31,6 +31,7 @@ #include "ipa_reg.h" #include "ipa_qmi_service.h" #include "../ipa_api.h" +#include "../ipa_common_i.h" #define DRV_NAME "ipa" #define NAT_DEV_NAME "ipaNatTable" @@ -150,117 +151,16 @@ #define IPA_SMMU_UC_VA_SIZE 0x20000000 #define IPA_SMMU_UC_VA_END (IPA_SMMU_UC_VA_START + IPA_SMMU_UC_VA_SIZE) -#define __FILENAME__ \ - (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) - - -#define IPA2_ACTIVE_CLIENTS_PREP_EP(log_info, client) \ - log_info.file = __FILENAME__; \ - log_info.line = __LINE__; \ - log_info.type = EP; \ - log_info.id_string = ipa2_clients_strings[client] - -#define IPA2_ACTIVE_CLIENTS_PREP_SIMPLE(log_info) \ - log_info.file = __FILENAME__; \ - log_info.line = __LINE__; \ - log_info.type = SIMPLE; \ - log_info.id_string = __func__ - -#define IPA2_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name) \ - log_info.file = __FILENAME__; \ - log_info.line = __LINE__; \ - log_info.type = RESOURCE; \ - log_info.id_string = resource_name - -#define IPA2_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str) \ - log_info.file = __FILENAME__; \ - log_info.line = __LINE__; \ - log_info.type = SPECIAL; \ - log_info.id_string = id_str - -#define IPA2_ACTIVE_CLIENTS_INC_EP(client) \ - do { \ - struct ipa2_active_client_logging_info log_info; \ - IPA2_ACTIVE_CLIENTS_PREP_EP(log_info, client); \ - ipa2_inc_client_enable_clks(&log_info); \ - } while (0) - -#define IPA2_ACTIVE_CLIENTS_DEC_EP(client) \ - do { \ - struct ipa2_active_client_logging_info log_info; \ - IPA2_ACTIVE_CLIENTS_PREP_EP(log_info, client); \ - ipa2_dec_client_disable_clks(&log_info); \ - } while (0) - -#define IPA2_ACTIVE_CLIENTS_INC_SIMPLE() \ - do { \ - struct ipa2_active_client_logging_info log_info; \ - IPA2_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); \ - ipa2_inc_client_enable_clks(&log_info); \ - } while (0) - -#define IPA2_ACTIVE_CLIENTS_DEC_SIMPLE() \ - do { \ - struct ipa2_active_client_logging_info log_info; \ - IPA2_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); \ - ipa2_dec_client_disable_clks(&log_info); \ - } while (0) - -#define IPA2_ACTIVE_CLIENTS_INC_RESOURCE(resource_name) \ - do { \ - struct ipa2_active_client_logging_info log_info; \ - IPA2_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name); \ - ipa2_inc_client_enable_clks(&log_info); \ - } while (0) - -#define IPA2_ACTIVE_CLIENTS_DEC_RESOURCE(resource_name) \ - do { \ - struct ipa2_active_client_logging_info log_info; \ - IPA2_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name); \ - ipa2_dec_client_disable_clks(&log_info); \ - } while (0) - -#define IPA2_ACTIVE_CLIENTS_INC_SPECIAL(id_str) \ - do { \ - struct ipa2_active_client_logging_info log_info; \ - IPA2_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str); \ - ipa2_inc_client_enable_clks(&log_info); \ - } while (0) - -#define IPA2_ACTIVE_CLIENTS_DEC_SPECIAL(id_str) \ - do { \ - struct ipa2_active_client_logging_info log_info; \ - IPA2_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str); \ - ipa2_dec_client_disable_clks(&log_info); \ - } while (0) - #define IPA2_ACTIVE_CLIENTS_LOG_BUFFER_SIZE_LINES 120 #define IPA2_ACTIVE_CLIENTS_LOG_LINE_LEN 96 #define IPA2_ACTIVE_CLIENTS_LOG_HASHTABLE_SIZE 50 #define IPA2_ACTIVE_CLIENTS_LOG_NAME_LEN 40 -extern const char *ipa2_clients_strings[]; - -enum ipa2_active_client_log_type { - EP, - SIMPLE, - RESOURCE, - SPECIAL, - INVALID -}; - -struct ipa2_active_client_logging_info { - const char *id_string; - char *file; - int line; - enum ipa2_active_client_log_type type; -}; - struct ipa2_active_client_htable_entry { struct hlist_node list; char id_string[IPA2_ACTIVE_CLIENTS_LOG_NAME_LEN]; int count; - enum ipa2_active_client_log_type type; + enum ipa_active_client_log_type type; }; struct ipa2_active_clients_log_ctx { @@ -1952,13 +1852,13 @@ int ipa_straddle_boundary(u32 start, u32 end, u32 boundary); struct ipa_context *ipa_get_ctx(void); void ipa_enable_clks(void); void ipa_disable_clks(void); -void ipa2_inc_client_enable_clks(struct ipa2_active_client_logging_info *id); -int ipa2_inc_client_enable_clks_no_block(struct ipa2_active_client_logging_info +void ipa2_inc_client_enable_clks(struct ipa_active_client_logging_info *id); +int ipa2_inc_client_enable_clks_no_block(struct ipa_active_client_logging_info *id); -void ipa2_dec_client_disable_clks(struct ipa2_active_client_logging_info *id); -void ipa2_active_clients_log_dec(struct ipa2_active_client_logging_info *id, +void ipa2_dec_client_disable_clks(struct ipa_active_client_logging_info *id); +void ipa2_active_clients_log_dec(struct ipa_active_client_logging_info *id, bool int_ctx); -void ipa2_active_clients_log_inc(struct ipa2_active_client_logging_info *id, +void ipa2_active_clients_log_inc(struct ipa_active_client_logging_info *id, bool int_ctx); int ipa2_active_clients_log_print_buffer(char *buf, int size); int ipa2_active_clients_log_print_table(char *buf, int size); @@ -2052,7 +1952,7 @@ int ipa_id_alloc(void *ptr); void *ipa_id_find(u32 id); void ipa_id_remove(u32 id); -int ipa_set_required_perf_profile(enum ipa_voltage_level floor_voltage, +int ipa2_set_required_perf_profile(enum ipa_voltage_level floor_voltage, u32 bandwidth_mbps); int ipa2_cfg_ep_status(u32 clnt_hdl, @@ -2060,9 +1960,9 @@ int ipa2_cfg_ep_status(u32 clnt_hdl, int ipa_cfg_aggr_cntr_granularity(u8 aggr_granularity); int ipa_cfg_eot_coal_cntr_granularity(u8 eot_coal_granularity); -int ipa_suspend_resource_no_block(enum ipa_rm_resource_name name); -int ipa_suspend_resource_sync(enum ipa_rm_resource_name name); -int ipa_resume_resource(enum ipa_rm_resource_name name); +int ipa2_suspend_resource_no_block(enum ipa_rm_resource_name name); +int ipa2_suspend_resource_sync(enum ipa_rm_resource_name name); +int ipa2_resume_resource(enum ipa_rm_resource_name name); bool ipa_should_pipe_be_suspended(enum ipa_client_type client); int ipa_tag_aggr_force_close(int pipe_num); diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_interrupts.c b/drivers/platform/msm/ipa/ipa_v2/ipa_interrupts.c index e3797a48c010..f30fd4c60171 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_interrupts.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_interrupts.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -184,9 +184,9 @@ static void ipa_process_interrupts(bool isr_context) static void ipa_interrupt_defer(struct work_struct *work) { IPADBG("processing interrupts in wq\n"); - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); ipa_process_interrupts(false); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); IPADBG("Done\n"); } diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_mhi.c b/drivers/platform/msm/ipa/ipa_v2/ipa_mhi.c index a389802de33f..e7032f339405 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_mhi.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_mhi.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1240,7 +1240,7 @@ int ipa2_mhi_connect_pipe(struct ipa_mhi_connect_params *in, u32 *clnt_hdl) IPA_MHI_DBG("client %d channelHandle %d channelIndex %d\n", channel->client, channel->hdl, channel->id); - IPA2_ACTIVE_CLIENTS_INC_EP(in->sys.client); + IPA_ACTIVE_CLIENTS_INC_EP(in->sys.client); if (ep->valid == 1) { IPA_MHI_ERR("EP already allocated.\n"); @@ -1310,7 +1310,7 @@ int ipa2_mhi_connect_pipe(struct ipa_mhi_connect_params *in, u32 *clnt_hdl) ipa_install_dflt_flt_rules(ipa_ep_idx); if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_DEC_EP(in->sys.client); + IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client); ipa_ctx->skip_ep_cfg_shadow[ipa_ep_idx] = ep->skip_ep_cfg; IPA_MHI_DBG("client %d (ep: %d) connected\n", in->sys.client, @@ -1328,7 +1328,7 @@ fail_enable_dp: fail_init_channel: memset(ep, 0, offsetof(struct ipa_ep_context, sys)); fail_ep_exists: - IPA2_ACTIVE_CLIENTS_DEC_EP(in->sys.client); + IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client); return -EPERM; } @@ -1379,7 +1379,7 @@ int ipa2_mhi_disconnect_pipe(u32 clnt_hdl) ep = &ipa_ctx->ep[clnt_hdl]; if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); res = ipa_mhi_reset_channel(channel); if (res) { @@ -1390,7 +1390,7 @@ int ipa2_mhi_disconnect_pipe(u32 clnt_hdl) ep->valid = 0; ipa_delete_dflt_flt_rules(clnt_hdl); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); IPA_MHI_DBG("client (ep: %d) disconnected\n", clnt_hdl); IPA_MHI_FUNC_EXIT(); @@ -1398,7 +1398,7 @@ int ipa2_mhi_disconnect_pipe(u32 clnt_hdl) fail_reset_channel: if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return res; } @@ -1653,7 +1653,7 @@ int ipa2_mhi_suspend(bool force) * IPA RM resource are released to make sure tag process will not start */ if (!bam_empty) - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); IPA_MHI_DBG("release prod\n"); res = ipa_mhi_release_prod(); @@ -1696,7 +1696,7 @@ int ipa2_mhi_suspend(bool force) if (!bam_empty) { ipa_ctx->tag_process_before_gating = false; - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); } res = ipa_mhi_set_state(IPA_MHI_STATE_SUSPENDED); diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_rm.c b/drivers/platform/msm/ipa/ipa_v2/ipa_rm.c index ff93394a9363..3e47d1d5e150 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_rm.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_rm.c @@ -707,7 +707,7 @@ static void ipa_rm_wq_resume_handler(struct work_struct *work) IPA_RM_ERR("resource is not CONS\n"); return; } - IPA2_ACTIVE_CLIENTS_INC_RESOURCE(ipa_rm_resource_str( + IPA_ACTIVE_CLIENTS_INC_RESOURCE(ipa_rm_resource_str( ipa_rm_work->resource_name)); spin_lock_irqsave(&ipa_rm_ctx->ipa_rm_lock, flags); if (ipa_rm_dep_graph_get_resource(ipa_rm_ctx->dep_graph, @@ -715,7 +715,7 @@ static void ipa_rm_wq_resume_handler(struct work_struct *work) &resource) != 0){ IPA_RM_ERR("resource does not exists\n"); spin_unlock_irqrestore(&ipa_rm_ctx->ipa_rm_lock, flags); - IPA2_ACTIVE_CLIENTS_DEC_RESOURCE(ipa_rm_resource_str( + IPA_ACTIVE_CLIENTS_DEC_RESOURCE(ipa_rm_resource_str( ipa_rm_work->resource_name)); goto bail; } @@ -1000,7 +1000,7 @@ void ipa_rm_perf_profile_change(enum ipa_rm_resource_name resource_name) bw_ptr = &ipa_rm_ctx->prof_vote.bw_cons[ resource_name - IPA_RM_RESOURCE_PROD_MAX]; } else { - IPAERR("Invalid resource_name\n"); + IPA_RM_ERR("Invalid resource_name\n"); return; } diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_rm_resource.c b/drivers/platform/msm/ipa/ipa_v2/ipa_rm_resource.c index c22bd3b670bd..66e086768294 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_rm_resource.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_rm_resource.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -147,7 +147,7 @@ int ipa_rm_resource_consumer_request( { int result = 0; enum ipa_rm_resource_state prev_state; - struct ipa2_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; IPA_RM_DBG("%s state: %d\n", ipa_rm_resource_str(consumer->resource.name), @@ -160,7 +160,7 @@ int ipa_rm_resource_consumer_request( case IPA_RM_RELEASE_IN_PROGRESS: reinit_completion(&consumer->request_consumer_in_progress); consumer->resource.state = IPA_RM_REQUEST_IN_PROGRESS; - IPA2_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, + IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, ipa_rm_resource_str(consumer->resource.name)); if (prev_state == IPA_RM_RELEASE_IN_PROGRESS || ipa2_inc_client_enable_clks_no_block(&log_info) != 0) { diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_uc.c b/drivers/platform/msm/ipa/ipa_v2/ipa_uc.c index 0142dace47d8..b49815b24bc2 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_uc.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_uc.c @@ -329,7 +329,7 @@ static void ipa_uc_event_handler(enum ipa_irq_type interrupt, WARN_ON(private_data != ipa_ctx); - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); IPADBG("uC evt opcode=%u\n", ipa_ctx->uc_ctx.uc_sram_mmio->eventOp); @@ -340,7 +340,7 @@ static void ipa_uc_event_handler(enum ipa_irq_type interrupt, if (0 > feature || IPA_HW_FEATURE_MAX <= feature) { IPAERR("Invalid feature %u for event %u\n", feature, ipa_ctx->uc_ctx.uc_sram_mmio->eventOp); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return; } /* Feature specific handling */ @@ -370,7 +370,7 @@ static void ipa_uc_event_handler(enum ipa_irq_type interrupt, IPADBG("unsupported uC evt opcode=%u\n", ipa_ctx->uc_ctx.uc_sram_mmio->eventOp); } - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); } @@ -378,14 +378,14 @@ static int ipa_uc_panic_notifier(struct notifier_block *this, unsigned long event, void *ptr) { int result = 0; - struct ipa2_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; IPADBG("this=%p evt=%lu ptr=%p\n", this, event, ptr); result = ipa_uc_state_check(); if (result) goto fail; - IPA2_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); + IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); if (ipa2_inc_client_enable_clks_no_block(&log_info)) goto fail; @@ -397,7 +397,7 @@ static int ipa_uc_panic_notifier(struct notifier_block *this, /* give uc enough time to save state */ udelay(IPA_PKT_FLUSH_TO_US); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); IPADBG("err_fatal issued\n"); fail: @@ -425,7 +425,7 @@ static void ipa_uc_response_hdlr(enum ipa_irq_type interrupt, WARN_ON(private_data != ipa_ctx); - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); IPADBG("uC rsp opcode=%u\n", ipa_ctx->uc_ctx.uc_sram_mmio->responseOp); @@ -434,7 +434,7 @@ static void ipa_uc_response_hdlr(enum ipa_irq_type interrupt, if (0 > feature || IPA_HW_FEATURE_MAX <= feature) { IPAERR("Invalid feature %u for event %u\n", feature, ipa_ctx->uc_ctx.uc_sram_mmio->eventOp); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return; } @@ -447,7 +447,7 @@ static void ipa_uc_response_hdlr(enum ipa_irq_type interrupt, IPADBG("feature %d specific response handler\n", feature); complete_all(&ipa_ctx->uc_ctx.uc_completion); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return; } } @@ -490,7 +490,7 @@ static void ipa_uc_response_hdlr(enum ipa_irq_type interrupt, IPAERR("Unsupported uC rsp opcode = %u\n", ipa_ctx->uc_ctx.uc_sram_mmio->responseOp); } - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); } /** @@ -816,9 +816,9 @@ EXPORT_SYMBOL(ipa_uc_monitor_holb); static void ipa_start_monitor_holb(struct work_struct *work) { IPADBG("starting holb monitoring on IPA_CLIENT_USB_CONS\n"); - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); ipa_uc_monitor_holb(IPA_CLIENT_USB_CONS, true); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); } diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_uc_mhi.c b/drivers/platform/msm/ipa/ipa_v2/ipa_uc_mhi.c index 1588fea23ddc..ec3814b4e747 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_uc_mhi.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_uc_mhi.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -614,7 +614,7 @@ int ipa_uc_mhi_init_engine(struct ipa_mhi_msi_info *msi, u32 mmio_addr, return -EFAULT; } - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); res = ipa_uc_update_hw_flags(0); if (res) { @@ -677,7 +677,7 @@ int ipa_uc_mhi_init_engine(struct ipa_mhi_msi_info *msi, u32 mmio_addr, res = 0; disable_clks: - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return res; } @@ -700,7 +700,7 @@ int ipa_uc_mhi_init_channel(int ipa_ep_idx, int channelHandle, return -EINVAL; } - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); memset(&uc_rsp, 0, sizeof(uc_rsp)); uc_rsp.params.state = IPA_HW_MHI_CHANNEL_STATE_RUN; @@ -725,7 +725,7 @@ int ipa_uc_mhi_init_channel(int ipa_ep_idx, int channelHandle, res = 0; disable_clks: - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return res; } @@ -741,7 +741,7 @@ int ipa_uc_mhi_reset_channel(int channelHandle) return -EFAULT; } - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); memset(&uc_rsp, 0, sizeof(uc_rsp)); uc_rsp.params.state = IPA_HW_MHI_CHANNEL_STATE_DISABLE; @@ -763,7 +763,7 @@ int ipa_uc_mhi_reset_channel(int channelHandle) res = 0; disable_clks: - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return res; } @@ -778,7 +778,7 @@ int ipa_uc_mhi_suspend_channel(int channelHandle) return -EFAULT; } - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); memset(&uc_rsp, 0, sizeof(uc_rsp)); uc_rsp.params.state = IPA_HW_MHI_CHANNEL_STATE_SUSPEND; @@ -800,7 +800,7 @@ int ipa_uc_mhi_suspend_channel(int channelHandle) res = 0; disable_clks: - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return res; } @@ -815,7 +815,7 @@ int ipa_uc_mhi_resume_channel(int channelHandle, bool LPTransitionRejected) return -EFAULT; } - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); memset(&uc_rsp, 0, sizeof(uc_rsp)); uc_rsp.params.state = IPA_HW_MHI_CHANNEL_STATE_RUN; @@ -838,7 +838,7 @@ int ipa_uc_mhi_resume_channel(int channelHandle, bool LPTransitionRejected) res = 0; disable_clks: - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return res; } @@ -852,7 +852,7 @@ int ipa_uc_mhi_stop_event_update_channel(int channelHandle) return -EFAULT; } - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); memset(&cmd, 0, sizeof(cmd)); cmd.params.channelHandle = channelHandle; @@ -870,7 +870,7 @@ int ipa_uc_mhi_stop_event_update_channel(int channelHandle) res = 0; disable_clks: - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return res; } @@ -888,7 +888,7 @@ int ipa_uc_mhi_send_dl_ul_sync_info(union IpaHwMhiDlUlSyncCmdData_t cmd) IPADBG("ulMsiEventThreshold=0x%x dlMsiEventThreshold=0x%x\n", cmd.params.ulMsiEventThreshold, cmd.params.dlMsiEventThreshold); - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); res = ipa_uc_send_cmd(cmd.raw32b, IPA_CPU_2_HW_CMD_MHI_DL_UL_SYNC_INFO, 0, false, HZ); @@ -899,7 +899,7 @@ int ipa_uc_mhi_send_dl_ul_sync_info(union IpaHwMhiDlUlSyncCmdData_t cmd) res = 0; disable_clks: - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return res; } diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_uc_wdi.c b/drivers/platform/msm/ipa/ipa_v2/ipa_uc_wdi.c index 496e77bceb59..df52018f6193 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_uc_wdi.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_uc_wdi.c @@ -407,7 +407,7 @@ int ipa2_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats) return -EINVAL; } - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); TX_STATS(num_pkts_processed); TX_STATS(copy_engine_doorbell_value); @@ -449,7 +449,7 @@ int ipa2_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats) RX_STATS(reserved1); RX_STATS(reserved2); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return 0; } @@ -756,7 +756,7 @@ int ipa2_connect_wdi_pipe(struct ipa_wdi_in_params *in, } memset(&ipa_ctx->ep[ipa_ep_idx], 0, sizeof(struct ipa_ep_context)); - IPA2_ACTIVE_CLIENTS_INC_EP(in->sys.client); + IPA_ACTIVE_CLIENTS_INC_EP(in->sys.client); IPADBG("client=%d ep=%d\n", in->sys.client, ipa_ep_idx); if (IPA_CLIENT_IS_CONS(in->sys.client)) { @@ -960,7 +960,7 @@ int ipa2_connect_wdi_pipe(struct ipa_wdi_in_params *in, ipa_install_dflt_flt_rules(ipa_ep_idx); if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_DEC_EP(in->sys.client); + IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client); dma_free_coherent(ipa_ctx->uc_pdev, cmd.size, cmd.base, cmd.phys_base); ep->wdi_state |= IPA_WDI_CONNECTED; @@ -974,7 +974,7 @@ uc_timeout: ipa_release_uc_smmu_mappings(in->sys.client); dma_free_coherent(ipa_ctx->uc_pdev, cmd.size, cmd.base, cmd.phys_base); dma_alloc_fail: - IPA2_ACTIVE_CLIENTS_DEC_EP(in->sys.client); + IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client); fail: return result; } @@ -1019,7 +1019,7 @@ int ipa2_disconnect_wdi_pipe(u32 clnt_hdl) } if (!ep->keep_ipa_awake) - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); tear.params.ipa_pipe_number = clnt_hdl; @@ -1037,7 +1037,7 @@ int ipa2_disconnect_wdi_pipe(u32 clnt_hdl) ipa_release_uc_smmu_mappings(ep->client); memset(&ipa_ctx->ep[clnt_hdl], 0, sizeof(struct ipa_ep_context)); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); IPADBG("client (ep: %d) disconnected\n", clnt_hdl); @@ -1084,7 +1084,7 @@ int ipa2_enable_wdi_pipe(u32 clnt_hdl) return -EFAULT; } - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); enable.params.ipa_pipe_number = clnt_hdl; result = ipa_uc_send_cmd(enable.raw32b, @@ -1104,7 +1104,7 @@ int ipa2_enable_wdi_pipe(u32 clnt_hdl) result = ipa2_cfg_ep_holb(clnt_hdl, &holb_cfg); } - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); ep->wdi_state |= IPA_WDI_ENABLED; IPADBG("client (ep: %d) enabled\n", clnt_hdl); @@ -1152,7 +1152,7 @@ int ipa2_disable_wdi_pipe(u32 clnt_hdl) return -EFAULT; } - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); result = ipa_disable_data_path(clnt_hdl); if (result) { @@ -1205,7 +1205,7 @@ int ipa2_disable_wdi_pipe(u32 clnt_hdl) ipa2_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); } - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); ep->wdi_state &= ~IPA_WDI_ENABLED; IPADBG("client (ep: %d) disabled\n", clnt_hdl); @@ -1252,7 +1252,7 @@ int ipa2_resume_wdi_pipe(u32 clnt_hdl) return -EFAULT; } - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); resume.params.ipa_pipe_number = clnt_hdl; result = ipa_uc_send_cmd(resume.raw32b, @@ -1368,7 +1368,7 @@ int ipa2_suspend_wdi_pipe(u32 clnt_hdl) } ipa_ctx->tag_process_before_gating = true; - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); ep->wdi_state &= ~IPA_WDI_RESUMED; IPADBG("client (ep: %d) suspended\n", clnt_hdl); @@ -1401,7 +1401,7 @@ int ipa_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id) return -EFAULT; } - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); qmap.params.ipa_pipe_number = clnt_hdl; qmap.params.qmap_id = qmap_id; @@ -1415,7 +1415,7 @@ int ipa_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id) goto uc_timeout; } - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); IPADBG("client (ep: %d) qmap_id %d updated\n", clnt_hdl, qmap_id); diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_utils.c b/drivers/platform/msm/ipa/ipa_v2/ipa_utils.c index 888345a23ba5..421b737ddfeb 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_utils.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_utils.c @@ -495,7 +495,7 @@ bool ipa_should_pipe_be_suspended(enum ipa_client_type client) } /** - * ipa_suspend_resource_sync() - suspend client endpoints related to the IPA_RM + * ipa2_suspend_resource_sync() - suspend client endpoints related to the IPA_RM * resource and decrement active clients counter, which may result in clock * gating of IPA clocks. * @@ -503,7 +503,7 @@ bool ipa_should_pipe_be_suspended(enum ipa_client_type client) * * Return codes: 0 on success, negative on failure. */ -int ipa_suspend_resource_sync(enum ipa_rm_resource_name resource) +int ipa2_suspend_resource_sync(enum ipa_rm_resource_name resource) { struct ipa_client_names clients; int res; @@ -546,13 +546,13 @@ int ipa_suspend_resource_sync(enum ipa_rm_resource_name resource) /* before gating IPA clocks do TAG process */ ipa_ctx->tag_process_before_gating = true; - IPA2_ACTIVE_CLIENTS_DEC_RESOURCE(ipa_rm_resource_str(resource)); + IPA_ACTIVE_CLIENTS_DEC_RESOURCE(ipa_rm_resource_str(resource)); return 0; } /** - * ipa_suspend_resource_no_block() - suspend client endpoints related to the + * ipa2_suspend_resource_no_block() - suspend client endpoints related to the * IPA_RM resource and decrement active clients counter. This function is * guaranteed to avoid sleeping. * @@ -560,7 +560,7 @@ int ipa_suspend_resource_sync(enum ipa_rm_resource_name resource) * * Return codes: 0 on success, negative on failure. */ -int ipa_suspend_resource_no_block(enum ipa_rm_resource_name resource) +int ipa2_suspend_resource_no_block(enum ipa_rm_resource_name resource) { int res; struct ipa_client_names clients; @@ -569,7 +569,7 @@ int ipa_suspend_resource_no_block(enum ipa_rm_resource_name resource) struct ipa_ep_cfg_ctrl suspend; int ipa_ep_idx; unsigned long flags; - struct ipa2_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; if (ipa_active_clients_trylock(&flags) == 0) return -EPERM; @@ -607,7 +607,7 @@ int ipa_suspend_resource_no_block(enum ipa_rm_resource_name resource) } if (res == 0) { - IPA2_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, + IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, ipa_rm_resource_str(resource)); ipa2_active_clients_log_dec(&log_info, true); ipa_ctx->ipa_active_clients.cnt--; @@ -621,14 +621,14 @@ bail: } /** - * ipa_resume_resource() - resume client endpoints related to the IPA_RM + * ipa2_resume_resource() - resume client endpoints related to the IPA_RM * resource. * * @resource: [IN] IPA Resource Manager resource * * Return codes: 0 on success, negative on failure. */ -int ipa_resume_resource(enum ipa_rm_resource_name resource) +int ipa2_resume_resource(enum ipa_rm_resource_name resource) { struct ipa_client_names clients; @@ -821,11 +821,11 @@ int ipa_cfg_route(struct ipa_route *route) route->route_def_hdr_ofst, route->route_frag_def_pipe); - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); ipa_ctx->ctrl->ipa_cfg_route(route); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return 0; } @@ -841,12 +841,12 @@ int ipa_cfg_filter(u32 disable) { u32 ipa_filter_ofst = IPA_FILTER_OFST_v1_1; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); ipa_write_reg(ipa_ctx->mmio, ipa_filter_ofst, IPA_SETFIELD(!disable, IPA_FILTER_FILTER_EN_SHFT, IPA_FILTER_FILTER_EN_BMSK)); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return 0; } @@ -2496,11 +2496,11 @@ int ipa2_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ep_nat) /* copy over EP cfg */ ipa_ctx->ep[clnt_hdl].cfg.nat = *ep_nat; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_nat(clnt_hdl, ep_nat); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -2556,11 +2556,11 @@ int ipa2_cfg_ep_status(u32 clnt_hdl, const struct ipa_ep_cfg_status *ep_status) /* copy over EP cfg */ ipa_ctx->ep[clnt_hdl].status = *ep_status; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_status(clnt_hdl, ep_status); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -2618,11 +2618,11 @@ int ipa2_cfg_ep_cfg(u32 clnt_hdl, const struct ipa_ep_cfg_cfg *cfg) /* copy over EP cfg */ ipa_ctx->ep[clnt_hdl].cfg.cfg = *cfg; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_cfg(clnt_hdl, cfg); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -2674,11 +2674,11 @@ int ipa2_cfg_ep_metadata_mask(u32 clnt_hdl, /* copy over EP cfg */ ipa_ctx->ep[clnt_hdl].cfg.metadata_mask = *metadata_mask; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_metadata_mask(clnt_hdl, metadata_mask); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -2797,11 +2797,11 @@ int ipa2_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ep_hdr) /* copy over EP cfg */ ep->cfg.hdr = *ep_hdr; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_hdr(clnt_hdl, &ep->cfg.hdr); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -2923,11 +2923,11 @@ int ipa2_cfg_ep_hdr_ext(u32 clnt_hdl, /* copy over EP cfg */ ep->cfg.hdr_ext = *ep_hdr_ext; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_hdr_ext(clnt_hdl, &ep->cfg.hdr_ext); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -3138,13 +3138,13 @@ int ipa2_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ep_mode) ipa_ctx->ep[clnt_hdl].cfg.mode = *ep_mode; ipa_ctx->ep[clnt_hdl].dst_pipe_index = ep; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_mode(clnt_hdl, ipa_ctx->ep[clnt_hdl].dst_pipe_index, ep_mode); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -3270,11 +3270,11 @@ int ipa2_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ep_aggr) /* copy over EP cfg */ ipa_ctx->ep[clnt_hdl].cfg.aggr = *ep_aggr; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_aggr(clnt_hdl, ep_aggr); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -3353,12 +3353,12 @@ int ipa2_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ep_route) else ipa_ctx->ep[clnt_hdl].rt_tbl_idx = 0; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_route(clnt_hdl, ipa_ctx->ep[clnt_hdl].rt_tbl_idx); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -3447,11 +3447,11 @@ int ipa2_cfg_ep_holb(u32 clnt_hdl, const struct ipa_ep_cfg_holb *ep_holb) ipa_ctx->ep[clnt_hdl].holb = *ep_holb; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_holb(clnt_hdl, ep_holb); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); IPADBG("cfg holb %u ep=%d tmr=%d\n", ep_holb->en, clnt_hdl, ep_holb->tmr_val); @@ -3548,11 +3548,11 @@ int ipa2_cfg_ep_deaggr(u32 clnt_hdl, /* copy over EP cfg */ ep->cfg.deaggr = *ep_deaggr; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_deaggr(clnt_hdl, &ep->cfg.deaggr); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -3600,13 +3600,13 @@ int ipa2_cfg_ep_metadata(u32 clnt_hdl, const struct ipa_ep_cfg_metadata *ep_md) /* copy over EP cfg */ ipa_ctx->ep[clnt_hdl].cfg.meta = *ep_md; - IPA2_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(ipa2_get_client_mapping(clnt_hdl)); ipa_ctx->ctrl->ipa_cfg_ep_metadata(clnt_hdl, ep_md); ipa_ctx->ep[clnt_hdl].cfg.hdr.hdr_metadata_reg_valid = 1; ipa_ctx->ctrl->ipa_cfg_ep_hdr(clnt_hdl, &ipa_ctx->ep[clnt_hdl].cfg.hdr); - IPA2_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(ipa2_get_client_mapping(clnt_hdl)); return 0; } @@ -3788,11 +3788,11 @@ int ipa2_set_aggr_mode(enum ipa_aggr_mode mode) { u32 reg_val; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); reg_val = ipa_read_reg(ipa_ctx->mmio, IPA_QCNCM_OFST); ipa_write_reg(ipa_ctx->mmio, IPA_QCNCM_OFST, (mode & 0x1) | (reg_val & 0xfffffffe)); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return 0; } @@ -3816,12 +3816,12 @@ int ipa2_set_qcncm_ndp_sig(char sig[3]) IPAERR("bad argument for ipa_set_qcncm_ndp_sig/n"); return -EINVAL; } - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); reg_val = ipa_read_reg(ipa_ctx->mmio, IPA_QCNCM_OFST); ipa_write_reg(ipa_ctx->mmio, IPA_QCNCM_OFST, sig[0] << 20 | (sig[1] << 12) | (sig[2] << 4) | (reg_val & 0xf000000f)); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return 0; } @@ -3837,11 +3837,11 @@ int ipa2_set_single_ndp_per_mbim(bool enable) { u32 reg_val; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); reg_val = ipa_read_reg(ipa_ctx->mmio, IPA_SINGLE_NDP_MODE_OFST); ipa_write_reg(ipa_ctx->mmio, IPA_SINGLE_NDP_MODE_OFST, (enable & 0x1) | (reg_val & 0xfffffffe)); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return 0; } @@ -3857,12 +3857,12 @@ int ipa_set_hw_timer_fix_for_mbim_aggr(bool enable) { u32 reg_val; - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); reg_val = ipa_read_reg(ipa_ctx->mmio, IPA_AGGREGATION_SPARE_REG_1_OFST); ipa_write_reg(ipa_ctx->mmio, IPA_AGGREGATION_SPARE_REG_1_OFST, (enable << IPA_AGGREGATION_HW_TIMER_FIX_MBIM_AGGR_SHFT) | (reg_val & ~IPA_AGGREGATION_HW_TIMER_FIX_MBIM_AGGR_BMSK)); - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return 0; } EXPORT_SYMBOL(ipa_set_hw_timer_fix_for_mbim_aggr); @@ -3905,7 +3905,7 @@ void ipa2_bam_reg_dump(void) { static DEFINE_RATELIMIT_STATE(_rs, 500*HZ, 1); if (__ratelimit(&_rs)) { - IPA2_ACTIVE_CLIENTS_INC_SIMPLE(); + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); pr_err("IPA BAM START\n"); if (ipa_ctx->ipa_hw_type < IPA_HW_v2_0) { sps_get_bam_debug_info(ipa_ctx->bam_handle, 5, @@ -3919,7 +3919,7 @@ void ipa2_bam_reg_dump(void) SPS_BAM_PIPE(ipa_get_ep_mapping(IPA_CLIENT_USB_PROD))), 0, 2); } - IPA2_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); } } @@ -4821,7 +4821,7 @@ bool ipa2_is_client_handle_valid(u32 clnt_hdl) void ipa2_proxy_clk_unvote(void) { if (ipa2_is_ready() && ipa_ctx->q6_proxy_clk_vote_valid) { - IPA2_ACTIVE_CLIENTS_DEC_SPECIAL("PROXY_CLK_VOTE"); + IPA_ACTIVE_CLIENTS_DEC_SPECIAL("PROXY_CLK_VOTE"); ipa_ctx->q6_proxy_clk_vote_valid = false; } } @@ -4834,7 +4834,7 @@ void ipa2_proxy_clk_unvote(void) void ipa2_proxy_clk_vote(void) { if (ipa2_is_ready() && !ipa_ctx->q6_proxy_clk_vote_valid) { - IPA2_ACTIVE_CLIENTS_INC_SPECIAL("PROXY_CLK_VOTE"); + IPA_ACTIVE_CLIENTS_INC_SPECIAL("PROXY_CLK_VOTE"); ipa_ctx->q6_proxy_clk_vote_valid = true; } } @@ -5077,6 +5077,16 @@ int ipa2_bind_api_controller(enum ipa_hw_type ipa_hw_type, api_ctrl->ipa_get_dma_dev = ipa2_get_dma_dev; api_ctrl->ipa_get_gsi_ep_info = ipa2_get_gsi_ep_info; api_ctrl->ipa_stop_gsi_channel = ipa2_stop_gsi_channel; + api_ctrl->ipa_inc_client_enable_clks = ipa2_inc_client_enable_clks; + api_ctrl->ipa_dec_client_disable_clks = ipa2_dec_client_disable_clks; + api_ctrl->ipa_inc_client_enable_clks_no_block = + ipa2_inc_client_enable_clks_no_block; + api_ctrl->ipa_suspend_resource_no_block = + ipa2_suspend_resource_no_block; + api_ctrl->ipa_resume_resource = ipa2_resume_resource; + api_ctrl->ipa_suspend_resource_sync = ipa2_suspend_resource_sync; + api_ctrl->ipa_set_required_perf_profile = + ipa2_set_required_perf_profile; return 0; } diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c index d09363b725de..dcec51d4f3c7 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c @@ -219,78 +219,6 @@ static bool smmu_disable_htw; static char *active_clients_table_buf; -const char *ipa3_clients_strings[IPA_CLIENT_MAX] = { - __stringify(IPA_CLIENT_HSIC1_PROD), - __stringify(IPA_CLIENT_WLAN1_PROD), - __stringify(IPA_CLIENT_USB2_PROD), - __stringify(IPA_CLIENT_HSIC3_PROD), - __stringify(IPA_CLIENT_HSIC2_PROD), - __stringify(IPA_CLIENT_USB3_PROD), - __stringify(IPA_CLIENT_HSIC4_PROD), - __stringify(IPA_CLIENT_USB4_PROD), - __stringify(IPA_CLIENT_HSIC5_PROD), - __stringify(IPA_CLIENT_USB_PROD), - __stringify(IPA_CLIENT_A5_WLAN_AMPDU_PROD), - __stringify(IPA_CLIENT_A2_EMBEDDED_PROD), - __stringify(IPA_CLIENT_A2_TETHERED_PROD), - __stringify(IPA_CLIENT_APPS_LAN_WAN_PROD), - __stringify(IPA_CLIENT_APPS_CMD_PROD), - __stringify(IPA_CLIENT_ODU_PROD), - __stringify(IPA_CLIENT_MHI_PROD), - __stringify(IPA_CLIENT_Q6_LAN_PROD), - __stringify(IPA_CLIENT_Q6_WAN_PROD), - __stringify(IPA_CLIENT_Q6_CMD_PROD), - __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_PROD), - __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD), - __stringify(IPA_CLIENT_Q6_DECOMP_PROD), - __stringify(IPA_CLIENT_Q6_DECOMP2_PROD), - __stringify(IPA_CLIENT_UC_USB_PROD), - - /* Below PROD client type is only for test purpose */ - __stringify(IPA_CLIENT_TEST_PROD), - __stringify(IPA_CLIENT_TEST1_PROD), - __stringify(IPA_CLIENT_TEST2_PROD), - __stringify(IPA_CLIENT_TEST3_PROD), - __stringify(IPA_CLIENT_TEST4_PROD), - - __stringify(IPA_CLIENT_HSIC1_CONS), - __stringify(IPA_CLIENT_WLAN1_CONS), - __stringify(IPA_CLIENT_HSIC2_CONS), - __stringify(IPA_CLIENT_USB2_CONS), - __stringify(IPA_CLIENT_WLAN2_CONS), - __stringify(IPA_CLIENT_HSIC3_CONS), - __stringify(IPA_CLIENT_USB3_CONS), - __stringify(IPA_CLIENT_WLAN3_CONS), - __stringify(IPA_CLIENT_HSIC4_CONS), - __stringify(IPA_CLIENT_USB4_CONS), - __stringify(IPA_CLIENT_WLAN4_CONS), - __stringify(IPA_CLIENT_HSIC5_CONS), - __stringify(IPA_CLIENT_USB_CONS), - __stringify(IPA_CLIENT_USB_DPL_CONS), - __stringify(IPA_CLIENT_A2_EMBEDDED_CONS), - __stringify(IPA_CLIENT_A2_TETHERED_CONS), - __stringify(IPA_CLIENT_A5_LAN_WAN_CONS), - __stringify(IPA_CLIENT_APPS_LAN_CONS), - __stringify(IPA_CLIENT_APPS_WAN_CONS), - __stringify(IPA_CLIENT_ODU_EMB_CONS), - __stringify(IPA_CLIENT_ODU_TETH_CONS), - __stringify(IPA_CLIENT_MHI_CONS), - __stringify(IPA_CLIENT_Q6_LAN_CONS), - __stringify(IPA_CLIENT_Q6_WAN_CONS), - __stringify(IPA_CLIENT_Q6_DUN_CONS), - __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_CONS), - __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS), - __stringify(IPA_CLIENT_Q6_DECOMP_CONS), - __stringify(IPA_CLIENT_Q6_DECOMP2_CONS), - __stringify(IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS), - /* Below CONS client type is only for test purpose */ - __stringify(IPA_CLIENT_TEST_CONS), - __stringify(IPA_CLIENT_TEST1_CONS), - __stringify(IPA_CLIENT_TEST2_CONS), - __stringify(IPA_CLIENT_TEST3_CONS), - __stringify(IPA_CLIENT_TEST4_CONS), -}; - int ipa3_active_clients_log_print_buffer(char *buf, int size) { int i; @@ -3149,7 +3077,7 @@ static void ipa3_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 ipa3_active_clients_log_mod(struct ipa3_active_client_logging_info *id, +void ipa3_active_clients_log_mod(struct ipa_active_client_logging_info *id, bool inc, bool int_ctx) { char temp_str[IPA3_ACTIVE_CLIENTS_LOG_LINE_LEN]; @@ -3205,13 +3133,13 @@ void ipa3_active_clients_log_mod(struct ipa3_active_client_logging_info *id, } } -void ipa3_active_clients_log_dec(struct ipa3_active_client_logging_info *id, +void ipa3_active_clients_log_dec(struct ipa_active_client_logging_info *id, bool int_ctx) { ipa3_active_clients_log_mod(id, false, int_ctx); } -void ipa3_active_clients_log_inc(struct ipa3_active_client_logging_info *id, +void ipa3_active_clients_log_inc(struct ipa_active_client_logging_info *id, bool int_ctx) { ipa3_active_clients_log_mod(id, true, int_ctx); @@ -3224,7 +3152,7 @@ void ipa3_active_clients_log_inc(struct ipa3_active_client_logging_info *id, * Return codes: * None */ -void ipa3_inc_client_enable_clks(struct ipa3_active_client_logging_info *id) +void ipa3_inc_client_enable_clks(struct ipa_active_client_logging_info *id) { ipa3_active_clients_lock(); ipa3_active_clients_log_inc(id, false); @@ -3243,7 +3171,7 @@ void ipa3_inc_client_enable_clks(struct ipa3_active_client_logging_info *id) * Return codes: 0 for success * -EPERM if an asynchronous action should have been done */ -int ipa3_inc_client_enable_clks_no_block(struct ipa3_active_client_logging_info +int ipa3_inc_client_enable_clks_no_block(struct ipa_active_client_logging_info *id) { int res = 0; @@ -3276,9 +3204,9 @@ bail: * Return codes: * None */ -void ipa3_dec_client_disable_clks(struct ipa3_active_client_logging_info *id) +void ipa3_dec_client_disable_clks(struct ipa_active_client_logging_info *id) { - struct ipa3_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; ipa3_active_clients_lock(); ipa3_active_clients_log_dec(id, false); @@ -3622,7 +3550,7 @@ static void ipa3_freeze_clock_vote_and_notify_modem(void) { int res; u32 ipa_clk_state; - struct ipa3_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; if (ipa3_ctx->smp2p_info.res_sent) return; @@ -4012,7 +3940,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, int i; struct ipa3_flt_tbl *flt_tbl; struct ipa3_rt_tbl_set *rset; - struct ipa3_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; IPADBG("IPA Driver initialization started\n"); @@ -5111,7 +5039,7 @@ static void ipa_gsi_request_resource(struct work_struct *work) void ipa_gsi_req_res_cb(void *user_data, bool *granted) { unsigned long flags; - struct ipa3_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; spin_lock_irqsave(&ipa3_ctx->transport_pm.lock, flags); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h index 3fa7d4121a1b..a7ba4ca49ecf 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h @@ -35,6 +35,7 @@ #include "../ipa_api.h" #include "ipahal/ipahal_reg.h" #include "ipahal/ipahal.h" +#include "../ipa_common_i.h" #define DRV_NAME "ipa" #define NAT_DEV_NAME "ipaNatTable" @@ -54,9 +55,6 @@ #define IPA_UC_WAII_MAX_SLEEP 1200 #define IPA_MAX_STATUS_STAT_NUM 30 -#define __FILENAME__ \ - (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) - #define IPA_IPC_LOGGING(buf, fmt, args...) \ ipc_log_string((buf), \ @@ -213,113 +211,16 @@ #define IPA_SLEEP_CLK_RATE_KHZ (32) -#define IPA_ACTIVE_CLIENTS_PREP_EP(log_info, client) \ - log_info.file = __FILENAME__; \ - log_info.line = __LINE__; \ - log_info.type = EP; \ - log_info.id_string = ipa3_clients_strings[client] - -#define IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info) \ - log_info.file = __FILENAME__; \ - log_info.line = __LINE__; \ - log_info.type = SIMPLE; \ - log_info.id_string = __func__ - -#define IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name) \ - log_info.file = __FILENAME__; \ - log_info.line = __LINE__; \ - log_info.type = RESOURCE; \ - log_info.id_string = resource_name - -#define IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str) \ - log_info.file = __FILENAME__; \ - log_info.line = __LINE__; \ - log_info.type = SPECIAL; \ - log_info.id_string = id_str - -#define IPA_ACTIVE_CLIENTS_INC_EP(client) \ - do { \ - struct ipa3_active_client_logging_info log_info; \ - IPA_ACTIVE_CLIENTS_PREP_EP(log_info, client); \ - ipa3_inc_client_enable_clks(&log_info); \ - } while (0) - -#define IPA_ACTIVE_CLIENTS_DEC_EP(client) \ - do { \ - struct ipa3_active_client_logging_info log_info; \ - IPA_ACTIVE_CLIENTS_PREP_EP(log_info, client); \ - ipa3_dec_client_disable_clks(&log_info); \ - } while (0) - -#define IPA_ACTIVE_CLIENTS_INC_SIMPLE() \ - do { \ - struct ipa3_active_client_logging_info log_info; \ - IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); \ - ipa3_inc_client_enable_clks(&log_info); \ - } while (0) - -#define IPA_ACTIVE_CLIENTS_DEC_SIMPLE() \ - do { \ - struct ipa3_active_client_logging_info log_info; \ - IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); \ - ipa3_dec_client_disable_clks(&log_info); \ - } while (0) - -#define IPA_ACTIVE_CLIENTS_INC_RESOURCE(resource_name) \ - do { \ - struct ipa3_active_client_logging_info log_info; \ - IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name); \ - ipa3_inc_client_enable_clks(&log_info); \ - } while (0) - -#define IPA_ACTIVE_CLIENTS_DEC_RESOURCE(resource_name) \ - do { \ - struct ipa3_active_client_logging_info log_info; \ - IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name); \ - ipa3_dec_client_disable_clks(&log_info); \ - } while (0) - -#define IPA_ACTIVE_CLIENTS_INC_SPECIAL(id_str) \ - do { \ - struct ipa3_active_client_logging_info log_info; \ - IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str); \ - ipa3_inc_client_enable_clks(&log_info); \ - } while (0) - -#define IPA_ACTIVE_CLIENTS_DEC_SPECIAL(id_str) \ - do { \ - struct ipa3_active_client_logging_info log_info; \ - IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str); \ - ipa3_dec_client_disable_clks(&log_info); \ - } while (0) - #define IPA3_ACTIVE_CLIENTS_LOG_BUFFER_SIZE_LINES 120 #define IPA3_ACTIVE_CLIENTS_LOG_LINE_LEN 96 #define IPA3_ACTIVE_CLIENTS_LOG_HASHTABLE_SIZE 50 #define IPA3_ACTIVE_CLIENTS_LOG_NAME_LEN 40 -extern const char *ipa3_clients_strings[]; - -enum ipa3_active_client_log_type { - EP, - SIMPLE, - RESOURCE, - SPECIAL, - INVALID -}; - -struct ipa3_active_client_logging_info { - const char *id_string; - char *file; - int line; - enum ipa3_active_client_log_type type; -}; - struct ipa3_active_client_htable_entry { struct hlist_node list; char id_string[IPA3_ACTIVE_CLIENTS_LOG_NAME_LEN]; int count; - enum ipa3_active_client_log_type type; + enum ipa_active_client_log_type type; }; struct ipa3_active_clients_log_ctx { @@ -2228,13 +2129,13 @@ int ipa3_straddle_boundary(u32 start, u32 end, u32 boundary); struct ipa3_context *ipa3_get_ctx(void); void ipa3_enable_clks(void); void ipa3_disable_clks(void); -void ipa3_inc_client_enable_clks(struct ipa3_active_client_logging_info *id); -int ipa3_inc_client_enable_clks_no_block(struct ipa3_active_client_logging_info +void ipa3_inc_client_enable_clks(struct ipa_active_client_logging_info *id); +int ipa3_inc_client_enable_clks_no_block(struct ipa_active_client_logging_info *id); -void ipa3_dec_client_disable_clks(struct ipa3_active_client_logging_info *id); -void ipa3_active_clients_log_dec(struct ipa3_active_client_logging_info *id, +void ipa3_dec_client_disable_clks(struct ipa_active_client_logging_info *id); +void ipa3_active_clients_log_dec(struct ipa_active_client_logging_info *id, bool int_ctx); -void ipa3_active_clients_log_inc(struct ipa3_active_client_logging_info *id, +void ipa3_active_clients_log_inc(struct ipa_active_client_logging_info *id, bool int_ctx); int ipa3_active_clients_log_print_buffer(char *buf, int size); int ipa3_active_clients_log_print_table(char *buf, int size); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_rm_resource.c b/drivers/platform/msm/ipa/ipa_v3/ipa_rm_resource.c index 4566b8c4ea84..426836bb6363 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_rm_resource.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_rm_resource.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -151,7 +151,7 @@ int ipa3_rm_resource_consumer_request( { int result = 0; enum ipa3_rm_resource_state prev_state; - struct ipa3_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; IPA_RM_DBG("%s state: %d\n", ipa3_rm_resource_str(consumer->resource.name), diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c b/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c index 1e03e6497ad6..7bc11a339633 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c @@ -383,7 +383,7 @@ int ipa3_uc_panic_notifier(struct notifier_block *this, unsigned long event, void *ptr) { int result = 0; - struct ipa3_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; IPADBG("this=%p evt=%lu ptr=%p\n", this, event, ptr); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c index 1c4f812bc40f..38837bbfe09d 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c @@ -631,7 +631,7 @@ int ipa3_suspend_resource_no_block(enum ipa_rm_resource_name resource) struct ipa_ep_cfg_ctrl suspend; int ipa_ep_idx; unsigned long flags; - struct ipa3_active_client_logging_info log_info; + struct ipa_active_client_logging_info log_info; if (ipa3_active_clients_trylock(&flags) == 0) return -EPERM; @@ -4584,6 +4584,16 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type, api_ctrl->ipa_get_gsi_ep_info = ipa3_get_gsi_ep_info; api_ctrl->ipa_stop_gsi_channel = ipa3_stop_gsi_channel; api_ctrl->ipa_register_ipa_ready_cb = ipa3_register_ipa_ready_cb; + api_ctrl->ipa_inc_client_enable_clks = ipa3_inc_client_enable_clks; + api_ctrl->ipa_dec_client_disable_clks = ipa3_dec_client_disable_clks; + api_ctrl->ipa_inc_client_enable_clks_no_block = + ipa3_inc_client_enable_clks_no_block; + api_ctrl->ipa_suspend_resource_no_block = + ipa3_suspend_resource_no_block; + api_ctrl->ipa_resume_resource = ipa3_resume_resource; + api_ctrl->ipa_suspend_resource_sync = ipa3_suspend_resource_sync; + api_ctrl->ipa_set_required_perf_profile = + ipa3_set_required_perf_profile; return 0; } |
