ipa3: Wait for IPA post init for 1000 msec before return

If ipa receives ioctl and post init is not completed, wait for 1000
msec before timing out and returning error. The changes are made
specific to msmnile gvm target.

Change-Id: Icc63939840af469d1a79960927e6d343a336dcc9
Signed-off-by: Akshay Pandit <pandit@codeaurora.org>
tirimbino
Akshay Pandit 5 years ago committed by Gerrit - the friendly Code Review server
parent be1961a61c
commit a2fda05a29
  1. 20
      drivers/platform/msm/ipa/ipa_v3/ipa.c
  2. 3
      drivers/platform/msm/ipa/ipa_v3/ipa_i.h

@ -1014,7 +1014,16 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (!ipa3_is_ready()) {
IPAERR("IPA not ready, waiting for init completion\n");
wait_for_completion(&ipa3_ctx->init_completion_obj);
if (ipa3_ctx->manual_fw_load) {
if (!wait_for_completion_timeout(
&ipa3_ctx->init_completion_obj,
msecs_to_jiffies(1000))) {
IPAERR("IPA not ready, return\n");
return -ETIME;
}
} else {
wait_for_completion(&ipa3_ctx->init_completion_obj);
}
}
IPA_ACTIVE_CLIENTS_INC_SIMPLE();
@ -6891,6 +6900,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
ipa3_ctx->uc_act_tbl_total = 0;
ipa3_ctx->uc_act_tbl_next_index = 0;
ipa3_ctx->ipa_config_is_auto = resource_p->ipa_config_is_auto;
ipa3_ctx->manual_fw_load = resource_p->manual_fw_load;
if (ipa3_ctx->secure_debug_check_action == USE_SCM) {
if (ipa_is_mem_dump_allowed())
@ -7556,6 +7566,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
ipa_drv_res->ipa_fltrt_not_hashable = false;
ipa_drv_res->ipa_endp_delay_wa = false;
ipa_drv_res->ipa_config_is_auto = false;
ipa_drv_res->manual_fw_load = false;
/* Get IPA HW Version */
result = of_property_read_u32(pdev->dev.of_node, "qcom,ipa-hw-ver",
@ -7965,6 +7976,13 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
IPADBG(": secure-debug-check-action = %d\n",
ipa_drv_res->secure_debug_check_action);
ipa_drv_res->manual_fw_load =
of_property_read_bool(pdev->dev.of_node,
"qcom,manual-fw-load");
IPADBG(": manual-fw-load (%s)\n",
ipa_drv_res->manual_fw_load
? "True" : "False");
return 0;
}

@ -1840,6 +1840,7 @@ struct ipa3_app_clock_vote {
* @app_vote: holds userspace application clock vote count
* IPA context - holds all relevant info about IPA driver and its state
* @coal_cmd_pyld: holds the coslescing close frame command payload
* @manual_fw_load: bool,if fw load is done manually
*/
struct ipa3_context {
struct ipa3_char_device_context cdev;
@ -2019,6 +2020,7 @@ struct ipa3_context {
struct mutex act_tbl_lock;
int uc_act_tbl_total;
int uc_act_tbl_next_index;
bool manual_fw_load;
};
struct ipa3_plat_drv_res {
@ -2068,6 +2070,7 @@ struct ipa3_plat_drv_res {
u32 secure_debug_check_action;
bool ipa_mhi_proxy;
bool ipa_wan_skb_page;
bool manual_fw_load;
};
/**

Loading…
Cancel
Save