Преглед на файлове

qcacld-3.0: Optimize PMO logs

Extensive amount of PMO logs are seen in case of crash, which
decreses the debugging effciency.

To address this issue, optimize PMO logs.

Change-Id: I7c3b76d72deaf53782befc6d931866d907b5d168
CRs-Fixed: 3402290
Asutosh Mohapatra преди 2 години
родител
ревизия
639844a833

+ 40 - 8
components/pmo/core/src/wlan_pmo_static_config.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -406,12 +406,23 @@ static void set_action_id_drop_pattern_for_public_action(
 				= DROP_PUBLIC_ACTION_FRAME_BITMAP;
 }
 
+#define PMO_MAX_WAKE_PATTERN_LEN 350
+
+/* Considering 4 char for i and 10 char for action wakeup pattern and
+ * 2 char for brackets, 2 char for 0x and 1 for space and 1 to end string
+ */
+#define PMO_MAX_SINGLE_WAKE_PATTERN_LEN 20
+
 QDF_STATUS
 pmo_register_action_frame_patterns(struct wlan_objmgr_vdev *vdev,
 				   enum qdf_suspend_type suspend_type)
 {
 	struct pmo_action_wakeup_set_params *cmd;
 	int i = 0;
+	uint8_t *info;
+	uint32_t len = 0;
+	int ret;
+
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	cmd = qdf_mem_malloc(sizeof(*cmd));
@@ -442,17 +453,37 @@ pmo_register_action_frame_patterns(struct wlan_objmgr_vdev *vdev,
 	set_action_id_drop_pattern_for_public_action(cmd->action_per_category);
 	set_action_id_drop_pattern_for_block_ack(&cmd->action_category_map[0]);
 
+	info = qdf_mem_malloc(PMO_MAX_WAKE_PATTERN_LEN);
+	if (!info) {
+		qdf_mem_free(cmd);
+		return -ENOMEM;
+	}
+
 	for (i = 0; i < PMO_SUPPORTED_ACTION_CATE_ELE_LIST; i++) {
-		if (i < ALLOWED_ACTION_FRAME_MAP_WORDS)
-			pmo_debug("%d action Wakeup pattern 0x%x in fw",
-				  i, cmd->action_category_map[i]);
-		else
+		if (i < ALLOWED_ACTION_FRAME_MAP_WORDS) {
+			ret = qdf_scnprintf(info + len,
+				PMO_MAX_WAKE_PATTERN_LEN - len,
+				" %d[0x%x]", i, cmd->action_category_map[i]);
+			if (ret <= 0)
+				break;
+			len += ret;
+
+			if (len >= (PMO_MAX_WAKE_PATTERN_LEN -
+				    PMO_MAX_SINGLE_WAKE_PATTERN_LEN)) {
+				pmo_nofl_debug("serial_num[action wakeup pattern in fw]:%s",
+					       info);
+				len = 0;
+			}
+		} else {
 			cmd->action_category_map[i] = 0;
+		}
 	}
 
-	pmo_debug("Spectrum mgmt action id drop bitmap: 0x%x",
-			cmd->action_per_category[PMO_MAC_ACTION_SPECTRUM_MGMT]);
-	pmo_debug("Public action id drop bitmap: 0x%x",
+	if (len > 0)
+		pmo_nofl_debug("serial_num[action wakeup pattern in fw]:%s",
+			       info);
+	pmo_debug("Spectrum mgmt action id drop bitmap: 0x%x, Public action id drop bitmap: 0x%x",
+			cmd->action_per_category[PMO_MAC_ACTION_SPECTRUM_MGMT],
 			cmd->action_per_category[PMO_MAC_ACTION_PUBLIC_USAGE]);
 
 	/*  config action frame patterns */
@@ -462,6 +493,7 @@ pmo_register_action_frame_patterns(struct wlan_objmgr_vdev *vdev,
 			status);
 
 	qdf_mem_free(cmd);
+	qdf_mem_free(info);
 
 	return status;
 }

+ 2 - 47
components/pmo/core/src/wlan_pmo_suspend_resume.c

@@ -188,8 +188,6 @@ static void pmo_configure_vdev_suspend_params(
 	uint8_t  ito_repeat_count_value = 0;
 	uint32_t non_wow_inactivity_time, wow_inactivity_time;
 
-	pmo_enter();
-
 	vdev_id = pmo_vdev_get_id(vdev);
 	if (!PMO_VDEV_IN_STA_MODE(opmode))
 		return;
@@ -243,8 +241,6 @@ static void pmo_configure_vdev_resume_params(
 		pmo_debug("Failed to Set inactivity timeout vdevId %d",
 			  vdev_id);
 	}
-
-	pmo_exit();
 }
 
 /**
@@ -482,8 +478,6 @@ static QDF_STATUS pmo_core_psoc_configure_suspend(struct wlan_objmgr_psoc *psoc,
 {
 	struct pmo_psoc_priv_obj *psoc_ctx;
 
-	pmo_enter();
-
 	psoc_ctx = pmo_psoc_get_priv(psoc);
 
 	if (is_runtime_pm)
@@ -548,8 +542,6 @@ QDF_STATUS pmo_core_psoc_user_space_suspend_req(struct wlan_objmgr_psoc *psoc,
 
 	pmo_psoc_put_ref(psoc);
 out:
-	pmo_exit();
-
 	return status;
 }
 
@@ -678,8 +670,6 @@ static QDF_STATUS pmo_core_psoc_configure_resume(struct wlan_objmgr_psoc *psoc,
 {
 	struct pmo_psoc_priv_obj *psoc_ctx;
 
-	pmo_enter();
-
 	psoc_ctx = pmo_psoc_get_priv(psoc);
 	if (is_runtime_pm)
 		pmo_core_disable_runtime_pm_offloads(psoc);
@@ -694,8 +684,6 @@ static QDF_STATUS pmo_core_psoc_configure_resume(struct wlan_objmgr_psoc *psoc,
 	pmo_core_update_wow_bus_suspend(psoc, psoc_ctx, false);
 	pmo_unpause_all_vdev(psoc, psoc_ctx);
 
-	pmo_exit();
-
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -744,8 +732,6 @@ pmo_core_enable_wow_in_fw(struct wlan_objmgr_psoc *psoc,
 	QDF_STATUS status;
 	void *hif_ctx;
 
-	pmo_enter();
-
 	hif_ctx = pmo_core_psoc_get_hif_handle(psoc);
 	qdf_event_reset(&psoc_ctx->wow.target_suspend);
 	pmo_core_set_wow_nack(psoc_ctx, false);
@@ -891,8 +877,6 @@ pmo_core_enable_wow_in_fw(struct wlan_objmgr_psoc *psoc,
 	pmo_core_update_wow_enable_cmd_sent(psoc_ctx, true);
 
 out:
-	pmo_exit();
-
 	return status;
 }
 
@@ -943,7 +927,6 @@ QDF_STATUS pmo_core_psoc_bus_suspend_req(struct wlan_objmgr_psoc *psoc,
 	bool wow_mode_selected = false;
 	qdf_time_t begin, end;
 
-	pmo_enter();
 	if (!psoc) {
 		pmo_err("psoc is NULL");
 		status = QDF_STATUS_E_NULL_VALUE;
@@ -965,7 +948,6 @@ QDF_STATUS pmo_core_psoc_bus_suspend_req(struct wlan_objmgr_psoc *psoc,
 	psoc_ctx = pmo_psoc_get_priv(psoc);
 
 	wow_mode_selected = pmo_core_is_wow_enabled(psoc_ctx);
-	pmo_debug("wow mode selected %d", wow_mode_selected);
 
 	begin = qdf_get_log_timestamp_usecs();
 	if (wow_mode_selected)
@@ -980,8 +962,6 @@ QDF_STATUS pmo_core_psoc_bus_suspend_req(struct wlan_objmgr_psoc *psoc,
 
 	pmo_psoc_put_ref(psoc);
 out:
-	pmo_exit();
-
 	return status;
 }
 
@@ -1335,8 +1315,6 @@ dec_psoc_ref:
 	pmo_psoc_put_ref(psoc);
 
 out:
-	pmo_exit();
-
 	return status;
 }
 #endif
@@ -1359,8 +1337,6 @@ QDF_STATUS pmo_core_psoc_send_host_wakeup_ind_to_fw(
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	void *hif_ctx;
 
-	pmo_enter();
-
 	hif_ctx = pmo_core_psoc_get_hif_handle(psoc);
 
 	hif_set_ep_intermediate_vote_access(hif_ctx);
@@ -1399,8 +1375,6 @@ QDF_STATUS pmo_core_psoc_send_host_wakeup_ind_to_fw(
 				       HIF_EP_VOTE_ACCESS_ENABLE);
 	}
 out:
-	pmo_exit();
-
 	return status;
 }
 
@@ -1417,7 +1391,6 @@ QDF_STATUS pmo_core_psoc_disable_wow_in_fw(struct wlan_objmgr_psoc *psoc,
 {
 	QDF_STATUS ret;
 
-	pmo_enter();
 	ret = pmo_core_psoc_send_host_wakeup_ind_to_fw(psoc, psoc_ctx);
 	if (ret != QDF_STATUS_SUCCESS)
 		goto out;
@@ -1429,8 +1402,6 @@ QDF_STATUS pmo_core_psoc_disable_wow_in_fw(struct wlan_objmgr_psoc *psoc,
 	/* Unpause the vdev as we are resuming */
 	pmo_unpause_all_vdev(psoc, psoc_ctx);
 out:
-	pmo_exit();
-
 	return ret;
 }
 
@@ -1447,7 +1418,6 @@ QDF_STATUS pmo_core_psoc_resume_target(struct wlan_objmgr_psoc *psoc,
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
-	pmo_enter();
 	qdf_event_reset(&psoc_ctx->wow.target_resume);
 
 	status = pmo_tgt_psoc_send_target_resume_req(psoc);
@@ -1471,8 +1441,6 @@ QDF_STATUS pmo_core_psoc_resume_target(struct wlan_objmgr_psoc *psoc,
 		pmo_tgt_update_target_suspend_acked_flag(psoc, false);
 	}
 out:
-	pmo_exit();
-
 	return status;
 }
 
@@ -1484,7 +1452,6 @@ QDF_STATUS pmo_core_psoc_bus_resume_req(struct wlan_objmgr_psoc *psoc,
 	QDF_STATUS status;
 	qdf_time_t begin, end;
 
-	pmo_enter();
 	if (!psoc) {
 		pmo_err("psoc is null");
 		status = QDF_STATUS_E_NULL_VALUE;
@@ -1524,8 +1491,6 @@ QDF_STATUS pmo_core_psoc_bus_resume_req(struct wlan_objmgr_psoc *psoc,
 	pmo_psoc_put_ref(psoc);
 
 out:
-	pmo_exit();
-
 	return status;
 }
 
@@ -1536,7 +1501,6 @@ void pmo_core_psoc_target_suspend_acknowledge(void *context, bool wow_nack)
 	void *dp_soc = pmo_core_psoc_get_dp_handle(psoc);
 	QDF_STATUS status;
 
-	pmo_enter();
 	if (!psoc) {
 		pmo_err("psoc is null");
 		goto out;
@@ -1570,17 +1534,14 @@ void pmo_core_psoc_wakeup_host_event_received(struct wlan_objmgr_psoc *psoc)
 {
 	struct pmo_psoc_priv_obj *psoc_ctx;
 
-	pmo_enter();
 	if (!psoc) {
 		pmo_err("psoc is null");
-		goto out;
+		return;
 	}
 
 	psoc_ctx = pmo_psoc_get_priv(psoc);
 	psoc_ctx->wow.wow_state = pmo_wow_state_none;
 	qdf_event_set(&psoc_ctx->wow.target_resume);
-out:
-	pmo_exit();
 }
 
 int pmo_core_psoc_is_target_wake_up_received(struct wlan_objmgr_psoc *psoc)
@@ -1640,8 +1601,6 @@ int pmo_core_psoc_clear_target_wake_up(struct wlan_objmgr_psoc *psoc)
 
 	pmo_psoc_put_ref(psoc);
 out:
-	pmo_exit();
-
 	return ret;
 }
 
@@ -1650,17 +1609,13 @@ void pmo_core_psoc_handle_initial_wake_up(void *cb_ctx)
 	struct pmo_psoc_priv_obj *psoc_ctx;
 	struct wlan_objmgr_psoc *psoc = (struct wlan_objmgr_psoc *)cb_ctx;
 
-	pmo_enter();
 	if (!psoc) {
 		pmo_err("cb ctx/psoc is null");
-		goto out;
+		return;
 	}
 
 	psoc_ctx = pmo_psoc_get_priv(psoc);
 	pmo_core_update_wow_initial_wake_up(psoc_ctx, 1);
-
-out:
-	pmo_exit();
 }
 
 QDF_STATUS pmo_core_config_listen_interval(struct wlan_objmgr_vdev *vdev,

+ 0 - 8
components/pmo/dispatcher/src/wlan_pmo_obj_mgmt_api.c

@@ -490,8 +490,6 @@ QDF_STATUS pmo_suspend_all_components(struct wlan_objmgr_psoc *psoc,
 	pmo_psoc_suspend_handler handler;
 	void *arg;
 
-	pmo_enter();
-
 	pmo_ctx = pmo_get_context();
 	if (!pmo_ctx) {
 		pmo_err("unable to get pmo ctx");
@@ -539,8 +537,6 @@ suspend_recovery:
 	}
 
 exit_with_status:
-	pmo_exit();
-
 	return status;
 }
 
@@ -553,8 +549,6 @@ QDF_STATUS pmo_resume_all_components(struct wlan_objmgr_psoc *psoc,
 	pmo_psoc_suspend_handler handler;
 	void *arg;
 
-	pmo_enter();
-
 	pmo_ctx = pmo_get_context();
 	if (!pmo_ctx) {
 		pmo_err("unable to get pmo ctx");
@@ -583,8 +577,6 @@ QDF_STATUS pmo_resume_all_components(struct wlan_objmgr_psoc *psoc,
 	}
 
 exit_with_status:
-	pmo_exit();
-
 	return status;
 }
 

+ 1 - 4
components/pmo/dispatcher/src/wlan_pmo_tgt_static_config.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2018, 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -103,8 +104,6 @@ QDF_STATUS pmo_tgt_send_action_frame_pattern_req(
 	struct wlan_objmgr_psoc *psoc;
 	struct wlan_pmo_tx_ops pmo_tx_ops;
 
-	pmo_enter();
-
 	psoc = pmo_vdev_get_psoc(vdev);
 
 	pmo_tx_ops = GET_PMO_TX_OPS_FROM_PSOC(psoc);
@@ -118,8 +117,6 @@ QDF_STATUS pmo_tgt_send_action_frame_pattern_req(
 	if (status != QDF_STATUS_SUCCESS)
 		pmo_err("Failed to add  filter");
 out:
-	pmo_exit();
-
 	return status;
 }
 

+ 1 - 4
components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -81,8 +82,6 @@ QDF_STATUS pmo_tgt_send_vdev_sta_ps_param(struct wlan_objmgr_vdev *vdev,
 	struct wlan_objmgr_psoc *psoc;
 	struct wlan_pmo_tx_ops pmo_tx_ops;
 
-	pmo_enter();
-
 	psoc = pmo_vdev_get_psoc(vdev);
 
 	pmo_tx_ops = GET_PMO_TX_OPS_FROM_PSOC(psoc);
@@ -95,8 +94,6 @@ QDF_STATUS pmo_tgt_send_vdev_sta_ps_param(struct wlan_objmgr_vdev *vdev,
 	status = pmo_tx_ops.send_vdev_sta_ps_param_req(vdev, ps_param,
 			param_value);
 out:
-	pmo_exit();
-
 	return status;
 }