Bläddra i källkod

qcacld-3.0: Remove IPA uC stat log when IPA pipe is suspended

There's an excessive log for IPA uC stat request reason even when
WDI pipe is suspended.
Enable IPA uC stat request reason log only when IPA pipe is resumed.

Change-Id: I35d98e02a9180738bc9cdb25f59e31d572df9e0e
CRs-Fixed: 2181952
Yun Park 7 år sedan
förälder
incheckning
a29974a3ae

+ 7 - 0
components/ipa/core/inc/wlan_ipa_core.h

@@ -587,5 +587,12 @@ QDF_STATUS wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
  */
 int wlan_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr);
 
+/**
+ * wlan_ipa_is_fw_wdi_activated() - Is FW WDI actived?
+ * @ipa_ctx: IPA contex
+ *
+ * Return: true if FW WDI actived, false otherwise
+ */
+bool wlan_ipa_is_fw_wdi_activated(struct wlan_ipa_priv *ipa_ctx);
 #endif /* IPA_OFFLOAD */
 #endif /* _WLAN_IPA_CORE_H_ */

+ 7 - 0
components/ipa/core/inc/wlan_ipa_main.h

@@ -360,5 +360,12 @@ QDF_STATUS ipa_wlan_evt(struct wlan_objmgr_pdev *pdev, qdf_netdev_t net_dev,
  */
 int ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr);
 
+/**
+ * ipa_is_fw_wdi_activated - Is FW WDI activated?
+ * @pdev: pdev obj
+ *
+ * Return: true if FW WDI activated, false otherwise
+ */
+bool ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev);
 #endif /* IPA_OFFLOAD */
 #endif /* end  of _WLAN_IPA_MAIN_H_ */

+ 18 - 8
components/ipa/core/src/wlan_ipa_core.c

@@ -1462,8 +1462,7 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 		} else {
 			/* Disable IPA UC TX PIPE when STA disconnected */
 			if ((ipa_ctx->num_iface == 1) &&
-			    (ipa_ctx->activated_fw_pipe ==
-			     WLAN_IPA_UC_NUM_WDI_PIPE) &&
+			    wlan_ipa_is_fw_wdi_activated(ipa_ctx) &&
 			    !ipa_ctx->ipa_pipes_down)
 				wlan_ipa_uc_handle_last_discon(ipa_ctx);
 		}
@@ -1496,7 +1495,7 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 		qdf_mutex_acquire(&ipa_ctx->event_lock);
 
 		if ((ipa_ctx->num_iface == 1) &&
-		    (ipa_ctx->activated_fw_pipe == WLAN_IPA_UC_NUM_WDI_PIPE) &&
+		    wlan_ipa_is_fw_wdi_activated(ipa_ctx) &&
 		    !ipa_ctx->ipa_pipes_down) {
 			if (cds_is_driver_unloading()) {
 				/*
@@ -1664,10 +1663,9 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 		/* Disable IPA UC TX PIPE when last STA disconnected */
 		if (!ipa_ctx->sap_num_connected_sta &&
 				ipa_ctx->uc_loaded == true) {
-			if ((false == ipa_ctx->resource_unloading)
-			    && (WLAN_IPA_UC_NUM_WDI_PIPE ==
-				ipa_ctx->activated_fw_pipe) &&
-				!ipa_ctx->ipa_pipes_down) {
+			if ((false == ipa_ctx->resource_unloading) &&
+			    wlan_ipa_is_fw_wdi_activated(ipa_ctx) &&
+			    !ipa_ctx->ipa_pipes_down) {
 				wlan_ipa_uc_handle_last_discon(ipa_ctx);
 			}
 
@@ -2401,7 +2399,7 @@ static void wlan_ipa_uc_op_cb(struct op_msg_type *op_msg,
 	    (msg->op_code == WLAN_IPA_UC_OPCODE_RX_RESUME)) {
 		qdf_mutex_acquire(&ipa_ctx->ipa_lock);
 		ipa_ctx->activated_fw_pipe++;
-		if (ipa_ctx->activated_fw_pipe == WLAN_IPA_UC_NUM_WDI_PIPE) {
+		if (wlan_ipa_is_fw_wdi_activated(ipa_ctx)) {
 			ipa_ctx->resource_loading = false;
 			qdf_event_set(&ipa_ctx->ipa_resource_comp);
 			if (ipa_ctx->wdi_enabled == false) {
@@ -2658,3 +2656,15 @@ int wlan_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
 	else
 		return qdf_ipa_release_wdi_mapping(num_buf, buf_arr);
 }
+
+/**
+ * wlan_ipa_is_fw_wdi_activated() - Is FW WDI actived?
+ * @ipa_ctx: IPA contex
+ *
+ * Return: true if FW WDI actived, false otherwise
+ */
+bool wlan_ipa_is_fw_wdi_activated(struct wlan_ipa_priv *ipa_ctx)
+{
+	return (WLAN_IPA_UC_NUM_WDI_PIPE == ipa_ctx->activated_fw_pipe);
+}
+

+ 24 - 0
components/ipa/core/src/wlan_ipa_main.c

@@ -530,3 +530,27 @@ int ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
 {
 	return wlan_ipa_uc_smmu_map(map, num_buf, buf_arr);
 }
+
+/**
+ * ipa_is_fw_wdi_activated - Is FW WDI activated?
+ * @pdev: pdev obj
+ *
+ * Return: true if FW WDI activated, false otherwise
+ */
+bool ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_ipa_priv *ipa_obj;
+
+	if (!ipa_config_is_enabled()) {
+		ipa_info("ipa is disabled");
+		return false;
+	}
+
+	ipa_obj = ipa_pdev_get_priv_obj(pdev);
+	if (!ipa_obj) {
+		ipa_err("IPA object is NULL");
+		return false;
+	}
+
+	return wlan_ipa_is_fw_wdi_activated(ipa_obj);
+}

+ 14 - 0
components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h

@@ -282,6 +282,14 @@ QDF_STATUS ucfg_ipa_wlan_evt(struct wlan_objmgr_pdev *pdev,
  */
 int ucfg_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr);
 
+/**
+ * ucfg_ipa_is_fw_wdi_activated - Is FW WDI activated?
+ * @pdev: pdev obj
+ *
+ * Return: true if FW WDI activated, false otherwise
+ */
+bool ucfg_ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev);
+
 #else
 
 static inline bool ucfg_ipa_is_present(void)
@@ -438,5 +446,11 @@ int ucfg_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
 {
 	return 0;
 }
+
+static inline
+bool ucfg_ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev)
+{
+	return false;
+}
 #endif /* IPA_OFFLOAD */
 #endif /* _WLAN_IPA_UCFG_API_H_ */

+ 5 - 0
components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c

@@ -169,3 +169,8 @@ int ucfg_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
 {
 	return ipa_uc_smmu_map(map, num_buf, buf_arr);
 }
+
+bool ucfg_ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev)
+{
+	return ipa_is_fw_wdi_activated(pdev);
+}

+ 12 - 10
core/hdd/src/wlan_hdd_main.c

@@ -7251,25 +7251,27 @@ static void hdd_bus_bw_work_handler(struct work_struct *work)
 		connected = true;
 	}
 
+	if (!connected) {
+		hdd_err("bus bandwidth timer running in disconnected state");
+		return;
+	}
+
 	/* add intra bss forwarded tx and rx packets */
 	tx_packets += fwd_tx_packets_diff;
 	rx_packets += fwd_rx_packets_diff;
 
-	ucfg_ipa_uc_stat_query(hdd_ctx->hdd_pdev, &ipa_tx_packets,
-			       &ipa_rx_packets);
-	tx_packets += (uint64_t)ipa_tx_packets;
-	rx_packets += (uint64_t)ipa_rx_packets;
+	if (ucfg_ipa_is_fw_wdi_activated(hdd_ctx->hdd_pdev)) {
+		ucfg_ipa_uc_stat_query(hdd_ctx->hdd_pdev, &ipa_tx_packets,
+				&ipa_rx_packets);
+		tx_packets += (uint64_t)ipa_tx_packets;
+		rx_packets += (uint64_t)ipa_rx_packets;
 
-	if (!connected) {
-		hdd_err("bus bandwidth timer running in disconnected state");
-		return;
+		ucfg_ipa_set_perf_level(hdd_ctx->hdd_pdev, tx_packets, rx_packets);
+		ucfg_ipa_uc_stat_request(hdd_ctx->hdd_pdev, 2);
 	}
 
 	hdd_pld_request_bus_bandwidth(hdd_ctx, tx_packets, rx_packets);
 
-	ucfg_ipa_set_perf_level(hdd_ctx->hdd_pdev, tx_packets, rx_packets);
-	ucfg_ipa_uc_stat_request(hdd_ctx->hdd_pdev, 2);
-
 restart_timer:
 	/* ensure periodic timer should still be running before restarting it */
 	qdf_spinlock_acquire(&hdd_ctx->bus_bw_timer_lock);