Merge 87cc58c2eaaa7edd0f7c4d428aa120c4f2629cf3 on remote branch

Change-Id: I94bdb8e3ee6f0c226e8772524ede0a94eb0e41e0
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c
index 5ffed59..d20b59e 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c
@@ -8593,7 +8593,7 @@
 	if (ipa3_ctx->platform_type == IPA_PLAT_TYPE_APQ &&
 		ipa3_ctx->ipa3_hw_mode != IPA_HW_MODE_VIRTUAL &&
 		ipa3_ctx->ipa3_hw_mode != IPA_HW_MODE_EMULATION &&
-		ipa3_ctx->ipa_config_is_apq_uc_load) {
+		!ipa3_ctx->ipa_config_is_apq_no_uc_load) {
 
 		IPADBG("Loading IPA uC via PIL or MDT\n");
 
@@ -8622,6 +8622,10 @@
 		IPADBG("IPA uC loading succeeded\n");
 		ipa3_proxy_clk_unvote();
 	}
+
+	/*In case of no modem and no uc loading in apq, remove the proxy vote here.*/
+	if(ipa3_ctx->ipa_config_is_apq_no_uc_load)
+		ipa3_proxy_clk_unvote();
 }
 
 static void ipa_fw_load_sm_handle_event(enum ipa_fw_load_event ev)
@@ -9299,7 +9303,7 @@
                         resource_p->ipa_gen_rx_cmn_temp_pool_sz_factor);
 	ipa3_ctx->ipa_config_is_auto = resource_p->ipa_config_is_auto;
 	ipa3_ctx->ipa_config_is_apq_dma = resource_p->ipa_config_is_apq_dma;
-	ipa3_ctx->ipa_config_is_apq_uc_load = resource_p->ipa_config_is_apq_uc_load;
+	ipa3_ctx->ipa_config_is_apq_no_uc_load = resource_p->ipa_config_is_apq_no_uc_load;
 	ipa3_ctx->ipa_mhi_proxy = resource_p->ipa_mhi_proxy;
 	ipa3_ctx->max_num_smmu_cb = resource_p->max_num_smmu_cb;
 	ipa3_ctx->hw_type_index = ipa3_get_hw_type_index();
@@ -10265,7 +10269,7 @@
 	ipa_drv_res->ipa_gpi_event_rp_ddr = false;
 	ipa_drv_res->ipa_config_is_auto = false;
 	ipa_drv_res->ipa_config_is_apq_dma = false;
-	ipa_drv_res->ipa_config_is_apq_uc_load = false;
+	ipa_drv_res->ipa_config_is_apq_no_uc_load = false;
 	ipa_drv_res->max_num_smmu_cb = IPA_SMMU_CB_MAX;
 	ipa_drv_res->ipa_endp_delay_wa_v2 = false;
 	ipa_drv_res->use_tput_est_ep = false;
@@ -10418,11 +10422,11 @@
 		ipa_drv_res->ipa_config_is_apq_dma
 		? "True" : "False");
 
-	ipa_drv_res->ipa_config_is_apq_uc_load =
+	ipa_drv_res->ipa_config_is_apq_no_uc_load =
 		of_property_read_bool(pdev->dev.of_node,
-		"qcom,ipa-config-is-apq-uc-load");
-	IPADBG(": ipa-config-is-apq-uc-load = %s\n",
-		ipa_drv_res->ipa_config_is_apq_uc_load
+		"qcom,ipa-config-is-apq-no-uc-load");
+	IPADBG(": ipa-config-is-apq-no-uc-load = %s\n",
+		ipa_drv_res->ipa_config_is_apq_no_uc_load
 		? "True" : "False");
 
 	ipa_drv_res->ipa_wan_skb_page =
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
index 28a9dab..e2fc6ff 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
@@ -2273,7 +2273,7 @@
  * @ipa_wdi2: using wdi-2.0
  * @ipa_config_is_auto: is this AUTO use case
  * @ipa_config_is_apq_dma: this is for APQ DMA use case
- * @ipa_config_is_apq_uc_load: this is for APQ uC load use case
+ * @ipa_config_is_apq_no_uc_load: flag which configures to load uC or not in APQ
  * @ipa_fltrt_not_hashable: filter/route rules not hashable
  * @use_xbl_boot: use xbl loading for IPA FW
  * @use_64_bit_dma_mask: using 64bits dma mask
@@ -2411,7 +2411,7 @@
 	bool ipa_wdi2;
 	bool ipa_config_is_auto;
 	bool ipa_config_is_apq_dma;
-	bool ipa_config_is_apq_uc_load;
+	bool ipa_config_is_apq_no_uc_load;
 	bool ipa_wdi2_over_gsi;
 	bool ipa_wdi3_over_gsi;
 	bool ipa_endp_delay_wa;
@@ -2629,7 +2629,7 @@
 	bool ipa_wdi2;
 	bool ipa_config_is_auto;
 	bool ipa_config_is_apq_dma;
-	bool ipa_config_is_apq_uc_load;
+	bool ipa_config_is_apq_no_uc_load;
 	bool ipa_wdi2_over_gsi;
 	bool ipa_wdi3_over_gsi;
 	bool ipa_fltrt_not_hashable;
diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
index d663da6..5b9218b 100644
--- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
@@ -6302,6 +6302,10 @@
 	int rmnet_index;
 
 	mux_channel = rmnet_ipa3_ctx->mux_channel;
+
+	/* prevent string buffer overflows */
+	data->if_name[IPA_RESOURCE_NAME_MAX-1] = '\0';
+
 	rmnet_index =
 		find_vchannel_name_index(data->if_name);