Browse Source

Merge "msm: ipa3: vote turbo when tethering on"

qctecmdr 5 years ago
parent
commit
a831d3bf2a
2 changed files with 25 additions and 13 deletions
  1. 21 12
      ipa/ipa_v3/rmnet_ipa.c
  2. 4 1
      ipa/ipa_v3/teth_bridge.c

+ 21 - 12
ipa/ipa_v3/rmnet_ipa.c

@@ -2105,13 +2105,30 @@ static int rmnet_ipa_send_coalesce_notification(uint8_t qmap_id,
 
 int ipa3_wwan_set_modem_state(struct wan_ioctl_notify_wan_state *state)
 {
+	uint32_t bw_mbps = 0;
+	int ret = 0;
+
 	if (!state)
 		return -EINVAL;
 
-	if (state->up)
-		return ipa_pm_activate_sync(rmnet_ipa3_ctx->q6_teth_pm_hdl);
-	else
-		return ipa_pm_deactivate_sync(rmnet_ipa3_ctx->q6_teth_pm_hdl);
+	if (state->up) {
+		bw_mbps = 5200;
+		ret = ipa3_vote_for_bus_bw(&bw_mbps);
+		if (ret) {
+			IPAERR("Failed to vote for bus BW (%u)\n", bw_mbps);
+			return ret;
+		}
+		ret = ipa_pm_activate_sync(rmnet_ipa3_ctx->q6_teth_pm_hdl);
+	} else {
+		bw_mbps = 0;
+		ret = ipa3_vote_for_bus_bw(&bw_mbps);
+		if (ret) {
+			IPAERR("Failed to vote for bus BW (%u)\n", bw_mbps);
+			return ret;
+		}
+		ret = ipa_pm_deactivate_sync(rmnet_ipa3_ctx->q6_teth_pm_hdl);
+	}
+	return ret;
 }
 
 /**
@@ -2159,16 +2176,8 @@ static void ipa3_q6_deregister_pm(void)
 int ipa3_wwan_set_modem_perf_profile(int throughput)
 {
 	int ret;
-	int tether_bridge_handle = 0;
 
 	IPAWANDBG("throughput: %d\n", throughput);
-	/* query rmnet-tethering handle */
-	tether_bridge_handle = ipa3_teth_bridge_get_pm_hdl();
-	if (tether_bridge_handle > 0) {
-		/* only update with valid handle*/
-		ret = ipa_pm_set_throughput(tether_bridge_handle,
-		throughput);
-	}
 	/* for TETH MODEM on softap/rndis */
 	ret = ipa_pm_set_throughput(rmnet_ipa3_ctx->q6_teth_pm_hdl,
 	throughput);

+ 4 - 1
ipa/ipa_v3/teth_bridge.c

@@ -178,8 +178,11 @@ int ipa3_teth_bridge_connect(struct teth_bridge_connect_params *connect_params)
 		TETH_ERR("fail to register with PM %d\n", res);
 		return res;
 	}
-
+	/* vote for turbo */
+	res = ipa_pm_set_throughput(ipa3_teth_ctx->modem_pm_hdl,
+		5200);
 	res = ipa_pm_activate_sync(ipa3_teth_ctx->modem_pm_hdl);
+
 	TETH_DBG_FUNC_EXIT();
 	return res;
 }