Browse Source

qcacmn: Optimize logs in serialization

Remove redundant logs and optimize the logs in serialization.

Change-Id: I7eaf252c8266ca1c60d213b0309ef217bc95ff33
CRs-Fixed: 2612823
Abhishek Singh 5 years ago
parent
commit
1c46a20660

+ 0 - 16
umac/cmn_services/serialization/inc/wlan_serialization_api.h

@@ -387,22 +387,6 @@ wlan_serialization_cancel_request(
 void wlan_serialization_remove_cmd(
 		struct wlan_serialization_queued_cmd_info *cmd);
 
-/**
- * wlan_serialization_flush_cmd() - Request to flush command
- * @cmd: Command information
- *
- * This API is used to flush a cmd sitting in the queue. It
- * simply flushes the cmd from the queue and does not call
- * any callbacks in between. If the request is for active
- * queue, and if the active queue becomes empty upon flush,
- * then it will pick the next pending cmd and put in the active
- * queue before returning.
- *
- * Return: None
- */
-void wlan_serialization_flush_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd);
-
 /**
  * wlan_serialization_update_timer() -Update timer for an active command
  * @cmd: Command information

+ 7 - 44
umac/cmn_services/serialization/src/wlan_serialization_api.c

@@ -63,9 +63,6 @@ bool wlan_serialization_is_cmd_present_in_active_queue(
 
 	status = wlan_serialization_is_cmd_present_queue(cmd, true);
 
-	ser_debug("Cmd type:%d id:%d present: %d",
-		  cmd->cmd_type, cmd->cmd_id, status);
-
 error:
 	return status;
 }
@@ -195,8 +192,6 @@ wlan_serialization_non_scan_cmd_status(
 	qdf_list_node_t *node = NULL;
 	qdf_list_t *queue = NULL;
 
-	ser_enter();
-
 	pdev_q = &ser_pdev_obj->pdev_q[SER_PDEV_QUEUE_COMP_NON_SCAN];
 
 	/* Look in the pdev non scan active queue */
@@ -228,7 +223,6 @@ wlan_serialization_non_scan_cmd_status(
 
 	wlan_serialization_release_lock(&pdev_q->pdev_queue_lock);
 
-	ser_exit();
 	return cmd_status;
 }
 
@@ -244,8 +238,6 @@ wlan_serialization_cancel_request(
 	struct wlan_ser_pdev_obj *ser_pdev_obj;
 	struct wlan_serialization_pdev_queue *pdev_queue;
 
-	ser_enter();
-
 	if (!req) {
 		ser_err("given request is empty");
 		cmd_status = WLAN_SER_CMD_NOT_FOUND;
@@ -264,6 +256,7 @@ wlan_serialization_cancel_request(
 	cmd.source = req->requestor;
 	cmd.vdev = req->vdev;
 
+	ser_debug("Type %d id %d source %d", cmd.cmd_type, cmd.cmd_id, cmd.source);
 	pdev = wlan_serialization_get_pdev_from_cmd(&cmd);
 	if (!pdev) {
 		ser_err("pdev is invalid");
@@ -286,7 +279,7 @@ wlan_serialization_cancel_request(
 			&cmd, req->req_type, req->queue_type);
 
 error:
-	ser_exit();
+
 	return cmd_status;
 }
 
@@ -297,8 +290,6 @@ void wlan_serialization_remove_cmd(
 	enum wlan_serialization_cmd_status ser_status;
 	struct wlan_serialization_command cmd = {0};
 
-	ser_enter();
-
 	if (!cmd_info) {
 		ser_err("given request is empty");
 		QDF_ASSERT(0);
@@ -307,9 +298,9 @@ void wlan_serialization_remove_cmd(
 	status = wlan_serialization_validate_cmd(cmd_info->requestor,
 						 cmd_info->cmd_type);
 	if (QDF_IS_STATUS_ERROR(status)) {
-		ser_err("cmd is not valid");
+		ser_err("cmd type %d is not valid", cmd_info->cmd_type);
 		QDF_ASSERT(0);
-		goto error;
+		return;
 	}
 
 	cmd.cmd_type = cmd_info->cmd_type;
@@ -322,12 +313,9 @@ void wlan_serialization_remove_cmd(
 
 	if (ser_status != WLAN_SER_CMD_IN_ACTIVE_LIST) {
 		if (ser_status != WLAN_SER_CMD_MARKED_FOR_ACTIVATION)
-		ser_debug("Can't dequeue requested cmd_id[%d] type[%d]",
-			  cmd.cmd_id, cmd.cmd_type);
+		ser_debug("Can't dequeue requested id %d type %d requestor %d",
+			  cmd.cmd_id, cmd.cmd_type, cmd_info->requestor);
 	}
-
-error:
-	ser_exit();
 }
 
 enum wlan_serialization_status
@@ -340,8 +328,6 @@ wlan_serialization_request(struct wlan_serialization_command *cmd)
 	union wlan_serialization_rules_info info;
 	struct wlan_objmgr_psoc *psoc;
 
-	ser_enter();
-
 	serialization_status = WLAN_SER_CMD_DENIED_UNSPECIFIED;
 
 	if (!cmd) {
@@ -384,7 +370,6 @@ wlan_serialization_request(struct wlan_serialization_command *cmd)
 	serialization_status = wlan_serialization_enqueue_cmd(cmd, SER_REQUEST);
 
 error:
-	ser_exit();
 	return serialization_status;
 }
 
@@ -428,8 +413,6 @@ wlan_serialization_vdev_scan_status(struct wlan_objmgr_vdev *vdev)
 	struct wlan_serialization_pdev_queue *pdev_q;
 	enum wlan_serialization_cmd_status status;
 
-	ser_enter();
-
 	pdev_q = &ser_pdev_obj->pdev_q[SER_PDEV_QUEUE_COMP_SCAN];
 
 	wlan_serialization_acquire_lock(&pdev_q->pdev_queue_lock);
@@ -446,25 +429,10 @@ wlan_serialization_vdev_scan_status(struct wlan_objmgr_vdev *vdev)
 			cmd_in_active, cmd_in_pending);
 
 	wlan_serialization_release_lock(&pdev_q->pdev_queue_lock);
-	ser_exit();
 
 	return status;
 }
 
-void wlan_serialization_flush_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd)
-{
-	ser_enter();
-
-	if (!cmd) {
-		ser_err("cmd is null, can't flush");
-		goto error;
-	}
-
-error:
-	ser_exit();
-}
-
 enum wlan_serialization_cmd_status
 wlan_serialization_pdev_scan_status(struct wlan_objmgr_pdev *pdev)
 {
@@ -576,8 +544,6 @@ void *wlan_serialization_get_active_cmd(
 	qdf_list_t *queue;
 	struct wlan_serialization_pdev_queue *pdev_q;
 
-	ser_enter();
-
 	if (!psoc) {
 		ser_err("invalid psoc");
 		goto error;
@@ -625,7 +591,7 @@ void *wlan_serialization_get_active_cmd(
 release_vdev_ref:
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_SERIALIZATION_ID);
 error:
-	ser_exit();
+
 	return umac_cmd;
 }
 
@@ -758,8 +724,6 @@ wlan_ser_validate_umac_cmd(struct wlan_objmgr_vdev *vdev,
 	struct wlan_serialization_pdev_queue *pdev_q;
 	QDF_STATUS status = QDF_STATUS_E_INVAL;
 
-	ser_enter();
-
 	if (!vdev) {
 		ser_err("invalid vdev");
 		return QDF_STATUS_E_INVAL;
@@ -796,7 +760,6 @@ wlan_ser_validate_umac_cmd(struct wlan_objmgr_vdev *vdev,
 	}
 
 	wlan_serialization_release_lock(&pdev_q->pdev_queue_lock);
-	ser_exit();
 
 	return status;
 }

+ 30 - 72
umac/cmn_services/serialization/src/wlan_serialization_internal.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. 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
@@ -125,8 +125,6 @@ wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
 	 *       command.
 	 */
 
-	ser_enter();
-
 	if (!cmd) {
 		ser_err("NULL command");
 		goto error;
@@ -161,12 +159,6 @@ wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
 		goto error;
 	}
 
-	ser_debug("enqueue cmd: type[%d] id[%d] high_priority[%d] blocking[%d]",
-		  cmd->cmd_type,
-		  cmd->cmd_id,
-		  cmd->is_high_priority,
-		  cmd->is_blocking);
-
 	wlan_serialization_acquire_lock(&pdev_queue->pdev_queue_lock);
 
 	/* Before queuing any non scan command,
@@ -208,9 +200,8 @@ wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
 		if (vdev_queue->queue_disable) {
 			wlan_serialization_release_lock(
 				&pdev_queue->pdev_queue_lock);
-			ser_err("VDEV queue is disabled, ser request denied");
-			ser_err("cmd id[%d] cmd type[%d]", cmd->cmd_id,
-				cmd->cmd_type);
+			ser_err_rl("VDEV queue is disabled, reject cmd id %d type %d",
+				   cmd->cmd_id, cmd->cmd_type);
 			status = WLAN_SER_CMD_QUEUE_DISABLED;
 			goto error;
 		}
@@ -220,7 +211,8 @@ wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
 
 	if (wlan_serialization_is_cmd_present_queue(cmd, active_queue)) {
 		wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
-		ser_err("duplicate command, can't enqueue");
+		ser_err("duplicate command, reject cmd id %d type %d",
+			cmd->cmd_id, cmd->cmd_type);
 		goto error;
 	}
 
@@ -228,12 +220,15 @@ wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
 				&pdev_queue->cmd_pool_list,
 				&nnode) != QDF_STATUS_SUCCESS) {
 		wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
-		ser_err("Failed to get cmd buffer from global pool");
+		ser_err("Failed to get cmd buffer from global pool cmd id %d type %d",
+			cmd->cmd_id, cmd->cmd_type);
 		status = WLAN_SER_CMD_DENIED_LIST_FULL;
 		goto error;
 	}
 
-	ser_debug("Global pool node: %pK", nnode);
+	ser_debug("Type %d id %d high_priority %d blocking %d timeout %d allowed %d",
+		  cmd->cmd_type, cmd->cmd_id, cmd->is_high_priority,
+		  cmd->is_blocking, cmd->cmd_timeout_duration, active_queue);
 
 	cmd_list =
 		qdf_container_of(nnode,
@@ -261,7 +256,8 @@ wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
 			&pdev_queue->cmd_pool_list,
 			&cmd_list->pdev_node);
 		wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
-		ser_err("Failed to add cmd to active/pending queue");
+		ser_err("Failed to add cmd id %d type %d to active/pending queue",
+			cmd->cmd_id, cmd->cmd_type);
 		goto error;
 	}
 
@@ -280,7 +276,6 @@ wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
 						ser_pdev_obj, ser_reason);
 
 error:
-	ser_exit();
 
 	return status;
 }
@@ -326,10 +321,8 @@ QDF_STATUS wlan_serialization_activate_cmd(
 	 * and releasing its own lock appropriately.
 	 */
 
-	ser_debug("cmd cb: type[%d] id[%d] : reason: %s",
-		  cmd_list->cmd.cmd_type,
-		  cmd_list->cmd.cmd_id,
-		  "WLAN_SER_CB_ACTIVATE_CMD");
+	ser_debug("Activate type %d id %d", cmd_list->cmd.cmd_type,
+		  cmd_list->cmd.cmd_id);
 
 	cmd_list->cmd.activation_reason = ser_reason;
 
@@ -397,11 +390,6 @@ wlan_serialization_is_active_cmd_allowed(struct wlan_serialization_command *cmd)
 		(wlan_serialization_is_active_non_scan_cmd_allowed(cmd) &&
 		 wlan_serialization_is_non_scan_pending_queue_empty(cmd));
 
-	ser_debug("active cmd_type[%d] cmd_id[%d] allowed: %d",
-		  cmd->cmd_type,
-		  cmd->cmd_id,
-		  active_cmd_allowed);
-
 error:
 	return active_cmd_allowed;
 }
@@ -449,8 +437,6 @@ wlan_serialization_dequeue_cmd(struct wlan_serialization_command *cmd,
 	struct wlan_serialization_pdev_queue *pdev_queue;
 	bool blocking_cmd_removed = 0;
 
-	ser_enter();
-
 	if (!cmd) {
 		ser_err("NULL command");
 		goto error;
@@ -477,10 +463,8 @@ wlan_serialization_dequeue_cmd(struct wlan_serialization_command *cmd,
 	pdev_queue = wlan_serialization_get_pdev_queue_obj(
 			ser_pdev_obj, cmd->cmd_type);
 
-	ser_debug("dequeue cmd: type[%d] id[%d] high_priority[%d] blocking[%d]",
-		  cmd->cmd_type,
-		  cmd->cmd_id,
-		  cmd->is_high_priority,
+	ser_debug("Type %d id %d high_priority %d blocking %d",
+		  cmd->cmd_type, cmd->cmd_id, cmd->is_high_priority,
 		  cmd->is_blocking);
 
 	wlan_serialization_acquire_lock(&pdev_queue->pdev_queue_lock);
@@ -532,10 +516,8 @@ wlan_serialization_dequeue_cmd(struct wlan_serialization_command *cmd,
 	/* Call cmd cb for remove request*/
 	if (cmd_bkup.cmd_cb) {
 		/* caller should release the memory */
-		ser_debug("cmd cb: type[%d] id[%d]: reason: %s",
-			  cmd_bkup.cmd_type,
-			  cmd_bkup.cmd_id,
-			  "WLAN_SER_CB_RELEASE_MEM_CMD");
+		ser_debug("Release memory for type %d id %d",
+			  cmd_bkup.cmd_type, cmd_bkup.cmd_id);
 		cmd_bkup.cmd_cb(&cmd_bkup,
 				     WLAN_SER_CB_RELEASE_MEM_CMD);
 	}
@@ -553,7 +535,6 @@ wlan_serialization_dequeue_cmd(struct wlan_serialization_command *cmd,
 		status = WLAN_SER_CMD_IN_PENDING_LIST;
 
 error:
-	ser_exit();
 	return status;
 }
 
@@ -576,7 +557,7 @@ void wlan_serialization_generic_timer_cb(void *arg)
 		return;
 	}
 
-	ser_err("active cmd timeout for cmd_type[%d] vdev[%d]",
+	ser_err("Active cmd timeout for cmd_type[%d] vdev[%d]",
 		cmd->cmd_type, wlan_vdev_get_id(cmd->vdev));
 
 	if (cmd->cmd_cb)
@@ -629,7 +610,7 @@ static void wlan_serialization_timer_handler(void *arg)
 		return;
 	}
 
-	ser_err("active cmd timeout for cmd_type[%d] vdev[%d]",
+	ser_err("Active cmd timeout for cmd_type %d vdev %d",
 		cmd->cmd_type, wlan_vdev_get_id(cmd->vdev));
 
 	wlan_serialization_timer_cb_mc_ctx(arg);
@@ -674,11 +655,8 @@ wlan_serialization_find_and_update_timer(
 
 	wlan_serialization_release_lock(&psoc_ser_obj->timer_lock);
 
-	if (QDF_IS_STATUS_SUCCESS(status))
-		ser_debug("Updated the timer for cmd type:%d, id: %d",
-			  cmd->cmd_type, cmd->cmd_id);
-	else
-		ser_debug("Can't find timer for cmd_type[%d]", cmd->cmd_type);
+	if (QDF_IS_STATUS_ERROR(status))
+		ser_debug("Can't find timer for cmd_type %d", cmd->cmd_type);
 
 exit:
 	return status;
@@ -744,10 +722,7 @@ wlan_serialization_find_and_stop_timer(struct wlan_objmgr_psoc *psoc,
 
 	wlan_serialization_release_lock(&psoc_ser_obj->timer_lock);
 
-	if (QDF_IS_STATUS_SUCCESS(status))
-		ser_debug("Stopped timer for cmd_type %d cmd id %d",
-			  cmd->cmd_type, cmd->cmd_id);
-	else
+	if (QDF_IS_STATUS_ERROR(status))
 		ser_err("Can't find timer for cmd_type %d cmd id %d",
 			cmd->cmd_type, cmd->cmd_id);
 
@@ -776,7 +751,7 @@ wlan_serialization_find_and_start_timer(struct wlan_objmgr_psoc *psoc,
 	    (wlan_is_emulation_platform(nif_phy_ver))) {
 		ser_err("[SCAN-EMULATION]: Not performing timer functions\n");
 		status = QDF_STATUS_SUCCESS;
-		goto exit;
+		goto error;
 	}
 
 	psoc_ser_obj = wlan_serialization_get_psoc_obj(psoc);
@@ -821,29 +796,17 @@ wlan_serialization_find_and_start_timer(struct wlan_objmgr_psoc *psoc,
 	wlan_serialization_release_lock(&psoc_ser_obj->timer_lock);
 
 	if (QDF_IS_STATUS_SUCCESS(status)) {
-		qdf_timer_init(NULL,
-			       &ser_timer->timer,
+		qdf_timer_init(NULL, &ser_timer->timer,
 			       wlan_serialization_timer_handler,
-			       ser_timer,
-			       QDF_TIMER_TYPE_SW);
-			       qdf_timer_mod(&ser_timer->timer,
-			       cmd->cmd_timeout_duration);
-
-		ser_debug("Started timer for cmd: type[%d] id[%d] high_priority[%d] blocking[%d]",
-			  cmd->cmd_type,
-			  cmd->cmd_id,
-			  cmd->is_high_priority,
-			  cmd->is_blocking);
+			       ser_timer, QDF_TIMER_TYPE_SW);
+		qdf_timer_mod(&ser_timer->timer, cmd->cmd_timeout_duration);
 	} else {
 		ser_err("Failed to start timer for cmd: type[%d] id[%d] high_priority[%d] blocking[%d]",
-			  cmd->cmd_type,
-			  cmd->cmd_id,
-			  cmd->is_high_priority,
-			  cmd->is_blocking);
+			cmd->cmd_type, cmd->cmd_id, cmd->is_high_priority,
+			cmd->is_blocking);
 	}
 
 error:
-exit:
 	return status;
 }
 
@@ -862,8 +825,6 @@ wlan_serialization_cmd_cancel_handler(
 	enum wlan_serialization_cmd_status status =
 		WLAN_SER_CMD_NOT_FOUND;
 
-	ser_enter();
-
 	if (!ser_obj) {
 		ser_err("invalid serial object");
 		goto error;
@@ -900,7 +861,6 @@ wlan_serialization_cmd_cancel_handler(
 		status = pending_status;
 
 error:
-	ser_exit();
 	return status;
 }
 
@@ -914,8 +874,6 @@ wlan_serialization_find_and_cancel_cmd(
 	struct wlan_ser_pdev_obj *ser_obj = NULL;
 	struct wlan_objmgr_pdev *pdev;
 
-	ser_enter();
-
 	if (!cmd) {
 		ser_err("Invalid cmd");
 		goto error;
@@ -1000,6 +958,6 @@ wlan_serialization_find_and_cancel_cmd(
 	}
 
 error:
-	ser_exit();
+
 	return status;
 }

+ 0 - 2
umac/cmn_services/serialization/src/wlan_serialization_legacy_api.c

@@ -143,8 +143,6 @@ wlan_serialization_peek_head_active_cmd_using_psoc(
 	cmd_list = qdf_container_of(nnode,
 			struct wlan_serialization_command_list, pdev_node);
 	cmd = &cmd_list->cmd;
-	ser_debug("cmd_type[%d], cmd_id[%d]",
-		  cmd_list->cmd.cmd_type, cmd_list->cmd.cmd_id);
 
 end:
 	return cmd;

+ 22 - 38
umac/cmn_services/serialization/src/wlan_serialization_non_scan.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. 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
@@ -132,17 +132,11 @@ enum wlan_serialization_status wlan_ser_add_non_scan_cmd(
 	uint8_t vdev_id;
 	struct wlan_serialization_pdev_queue *pdev_queue;
 
-	ser_debug("add non scan cmd: type[%d] id[%d] prio[%d] blocking[%d]",
-		  cmd_list->cmd.cmd_type,
-		  cmd_list->cmd.cmd_id,
-		  cmd_list->cmd.is_high_priority,
-		  cmd_list->cmd.is_blocking);
-
 	vdev_status = wlan_serialization_add_cmd_to_vdev_queue(
 			ser_pdev_obj, cmd_list, is_cmd_for_active_queue);
 
 	if (vdev_status == WLAN_SER_CMD_DENIED_LIST_FULL) {
-		ser_err_rl("List is full cannot add CMD %d cmd id %d",
+		ser_err_rl("List is full cannot add type %d cmd id %d",
 			   cmd_list->cmd.cmd_type, cmd_list->cmd.cmd_id);
 		status = vdev_status;
 		goto vdev_error;
@@ -150,13 +144,15 @@ enum wlan_serialization_status wlan_ser_add_non_scan_cmd(
 
 	if (is_cmd_for_active_queue) {
 		if (vdev_status != WLAN_SER_CMD_ACTIVE) {
-			ser_err("Failed to add to vdev active queue");
+			ser_err("Failed to add type %d cmd id %d to vdev active queue",
+				cmd_list->cmd.cmd_type, cmd_list->cmd.cmd_id);
 			QDF_ASSERT(0);
 			goto vdev_error;
 		}
 	} else {
 		if (vdev_status != WLAN_SER_CMD_PENDING) {
-			ser_err("Failed to add to vdev pending queue");
+			ser_err("Failed to add type %d cmd id %d to vdev pending queue",
+				cmd_list->cmd.cmd_type, cmd_list->cmd.cmd_id);
 			QDF_ASSERT(0);
 			goto vdev_error;
 		}
@@ -166,19 +162,23 @@ enum wlan_serialization_status wlan_ser_add_non_scan_cmd(
 			ser_pdev_obj, cmd_list, is_cmd_for_active_queue);
 
 	if (pdev_status == WLAN_SER_CMD_DENIED_LIST_FULL) {
+		ser_err_rl("pdev List is full cannot add type %d cmd id %d",
+			   cmd_list->cmd.cmd_type, cmd_list->cmd.cmd_id);
 		status = pdev_status;
 		goto pdev_error;
 	}
 
 	if (is_cmd_for_active_queue) {
 		if (pdev_status != WLAN_SER_CMD_ACTIVE) {
-			ser_err("Failed to add to pdev active queue");
+			ser_err("Failed to add type %d cmd id %d to pdev active queue",
+				cmd_list->cmd.cmd_type, cmd_list->cmd.cmd_id);
 			QDF_ASSERT(0);
 			goto pdev_error;
 		}
 	} else {
 		if (pdev_status != WLAN_SER_CMD_PENDING) {
-			ser_err("Failed to add to pdev pending queue");
+			ser_err("Failed to add type %d cmd id %d to pdev pending queue",
+				cmd_list->cmd.cmd_type, cmd_list->cmd.cmd_id);
 			QDF_ASSERT(0);
 			goto pdev_error;
 		}
@@ -240,8 +240,6 @@ wlan_ser_move_non_scan_pending_to_active(
 	ser_vdev_obj = wlan_serialization_get_vdev_obj(vdev);
 	vdev_queue = &ser_vdev_obj->vdev_q[SER_VDEV_QUEUE_COMP_NON_SCAN];
 
-	ser_enter();
-
 	if (!ser_pdev_obj) {
 		ser_err("Can't find ser_pdev_obj");
 		goto error;
@@ -260,9 +258,7 @@ wlan_ser_move_non_scan_pending_to_active(
 
 	qsize =  wlan_serialization_list_size(pending_queue);
 	if (!qsize) {
-		wlan_serialization_release_lock(
-			&pdev_queue->pdev_queue_lock);
-		ser_debug("Pending Queue is empty");
+		wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
 		goto error;
 	}
 
@@ -383,7 +379,7 @@ wlan_ser_move_non_scan_pending_to_active(
 
 	wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
 error:
-	ser_exit();
+
 	return status;
 }
 
@@ -399,12 +395,6 @@ QDF_STATUS wlan_ser_remove_non_scan_cmd(
 	bool blocking_cmd_removed = 0;
 	struct wlan_serialization_pdev_queue *pdev_queue;
 
-	ser_debug("remove non scan cmd: type[%d] id[%d] prio[%d] blocking[%d]",
-		  cmd->cmd_type,
-		  cmd->cmd_id,
-		  cmd->is_high_priority,
-		  cmd->is_blocking);
-
 	vdev_status =
 		wlan_serialization_remove_cmd_from_vdev_queue(ser_pdev_obj,
 							      pcmd_list,
@@ -423,7 +413,8 @@ QDF_STATUS wlan_ser_remove_non_scan_cmd(
 	if (vdev_status != QDF_STATUS_SUCCESS) {
 		status = vdev_status;
 		if (vdev_status != QDF_STATUS_E_PENDING)
-			ser_debug("Failed to remove cmd from vdev queue");
+			ser_debug("Failed to remove type %d id %d from vdev queue",
+				  cmd->cmd_type, cmd->cmd_id);
 		goto error;
 	}
 
@@ -434,7 +425,8 @@ QDF_STATUS wlan_ser_remove_non_scan_cmd(
 							      is_active_cmd);
 
 	if (pdev_status != QDF_STATUS_SUCCESS) {
-		ser_err("Failed to remove cmd from pdev active/pending queue");
+		ser_debug("Failed to remove type %d id %d from pdev active/pending queue",
+			  cmd->cmd_type, cmd->cmd_id);
 		goto error;
 	}
 
@@ -479,8 +471,6 @@ wlan_ser_cancel_non_scan_cmd(
 	QDF_STATUS pdev_status, vdev_status;
 	struct wlan_ser_vdev_obj *ser_vdev_obj;
 
-	ser_enter();
-
 	pdev_q = wlan_serialization_get_pdev_queue_obj(ser_pdev_obj, cmd_type);
 
 	pdev_queue = wlan_serialization_get_list_from_pdev_queue(
@@ -647,16 +637,11 @@ wlan_ser_cancel_non_scan_cmd(
 		 */
 		if (cmd_bkup.cmd_cb) {
 			/* caller should now do necessary clean up */
-			ser_debug("cmd cb: type[%d] id[%d]",
-				  cmd_bkup.cmd_type,
-				  cmd_bkup.cmd_id);
-			ser_debug("reason: WLAN_SER_CB_CANCEL_CMD");
-			cmd_bkup.cmd_cb(&cmd_bkup,
-					WLAN_SER_CB_CANCEL_CMD);
+			ser_debug("Cancel command: type %d id %d and Release memory",
+				  cmd_bkup.cmd_type, cmd_bkup.cmd_id);
+			cmd_bkup.cmd_cb(&cmd_bkup, WLAN_SER_CB_CANCEL_CMD);
 			/* caller should release the memory */
-			ser_debug("reason: WLAN_SER_CB_RELEASE_MEM_CMD");
-			cmd_bkup.cmd_cb(&cmd_bkup,
-					WLAN_SER_CB_RELEASE_MEM_CMD);
+			cmd_bkup.cmd_cb(&cmd_bkup, WLAN_SER_CB_RELEASE_MEM_CMD);
 		}
 
 		wlan_serialization_acquire_lock(&pdev_q->pdev_queue_lock);
@@ -682,6 +667,5 @@ wlan_ser_cancel_non_scan_cmd(
 
 	wlan_serialization_release_lock(&pdev_q->pdev_queue_lock);
 
-	ser_exit();
 	return status;
 }

+ 8 - 35
umac/cmn_services/serialization/src/wlan_serialization_scan.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. 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
@@ -97,10 +97,8 @@ wlan_serialization_is_active_scan_cmd_allowed(
 			psoc, WLAN_PDEV_OP,
 			wlan_serialization_active_scan_cmd_count_handler,
 			&count, 1, WLAN_SERIALIZATION_ID);
-	if (count < ucfg_scan_get_max_active_scans(psoc)) {
-		ser_debug("count is [%d]", count);
+	if (count < ucfg_scan_get_max_active_scans(psoc))
 		status =  true;
-	}
 
 error:
 	return status;
@@ -136,12 +134,6 @@ wlan_ser_add_scan_cmd(
 {
 	enum wlan_serialization_status status;
 
-	ser_debug("add scan cmd: type[%d] id[%d] prio[%d] blocking[%d]",
-		  cmd_list->cmd.cmd_type,
-		  cmd_list->cmd.cmd_id,
-		  cmd_list->cmd.is_high_priority,
-		  cmd_list->cmd.is_blocking);
-
 	status = wlan_serialization_add_cmd_to_pdev_queue(
 			ser_pdev_obj, cmd_list,
 			is_cmd_for_active_queue);
@@ -158,12 +150,6 @@ wlan_ser_remove_scan_cmd(
 {
 	QDF_STATUS status;
 
-	ser_debug("remove scan cmd: type[%d] id[%d] prio[%d] blocking[%d]",
-		  cmd->cmd_type,
-		  cmd->cmd_id,
-		  cmd->is_high_priority,
-		  cmd->is_blocking);
-
 	status = wlan_serialization_remove_cmd_from_pdev_queue(
 			ser_pdev_obj, pcmd_list, cmd, is_active_cmd);
 
@@ -188,8 +174,6 @@ wlan_ser_cancel_scan_cmd(
 	struct wlan_objmgr_psoc *psoc = NULL;
 	QDF_STATUS qdf_status;
 
-	ser_enter();
-
 	pdev_q = &ser_obj->pdev_q[SER_PDEV_QUEUE_COMP_SCAN];
 
 	if (is_active_queue)
@@ -322,17 +306,10 @@ wlan_ser_cancel_scan_cmd(
 		 * it is being removed
 		 */
 		if (cmd_bkup.cmd_cb) {
-			ser_debug("cmd cb: type[%d] id[%d]",
-				  cmd_bkup.cmd_type,
-				  cmd_bkup.cmd_id);
-			ser_debug("reason: WLAN_SER_CB_CANCEL_CMD");
-
-			cmd_bkup.cmd_cb(&cmd_bkup,
-					WLAN_SER_CB_CANCEL_CMD);
-
-			ser_debug("reason: WLAN_SER_CB_RELEASE_MEM_CMD");
-			cmd_bkup.cmd_cb(&cmd_bkup,
-					WLAN_SER_CB_RELEASE_MEM_CMD);
+			ser_debug("Cancel command: type %d id %d and Release memory",
+				  cmd_bkup.cmd_type, cmd_bkup.cmd_id);
+			cmd_bkup.cmd_cb(&cmd_bkup, WLAN_SER_CB_CANCEL_CMD);
+			cmd_bkup.cmd_cb(&cmd_bkup, WLAN_SER_CB_RELEASE_MEM_CMD);
 		}
 
 		wlan_serialization_acquire_lock(&pdev_q->pdev_queue_lock);
@@ -343,7 +320,6 @@ wlan_ser_cancel_scan_cmd(
 
 	wlan_serialization_release_lock(&pdev_q->pdev_queue_lock);
 
-	ser_exit();
 	return status;
 }
 
@@ -361,8 +337,6 @@ enum wlan_serialization_status wlan_ser_move_scan_pending_to_active(
 
 	pdev_queue = &ser_pdev_obj->pdev_q[SER_PDEV_QUEUE_COMP_SCAN];
 
-	ser_enter();
-
 	if (!ser_pdev_obj) {
 		ser_err("Can't find ser_pdev_obj");
 		goto error;
@@ -374,7 +348,6 @@ enum wlan_serialization_status wlan_ser_move_scan_pending_to_active(
 
 	if (wlan_serialization_list_empty(pending_queue)) {
 		wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
-		ser_debug("nothing to move from pend to active que");
 		goto error;
 	}
 
@@ -400,6 +373,7 @@ enum wlan_serialization_status wlan_ser_move_scan_pending_to_active(
 		     sizeof(struct wlan_serialization_command));
 
 	if (!wlan_serialization_is_active_scan_cmd_allowed(&cmd_to_remove)) {
+		ser_debug("active scan command not allowed");
 		wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
 		goto error;
 	}
@@ -415,7 +389,7 @@ enum wlan_serialization_status wlan_ser_move_scan_pending_to_active(
 
 	if (QDF_STATUS_SUCCESS != qdf_status) {
 		wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
-		ser_err("Can't remove cmd from pendingQ id-%d type-%d",
+		ser_err("Can't remove from pendingQ id %d type %d",
 			pending_cmd_list->cmd.cmd_id,
 			pending_cmd_list->cmd.cmd_type);
 		QDF_ASSERT(0);
@@ -453,6 +427,5 @@ enum wlan_serialization_status wlan_ser_move_scan_pending_to_active(
 	wlan_serialization_activate_cmd(active_cmd_list, ser_pdev_obj,
 					SER_PENDING_TO_ACTIVE);
 error:
-	ser_exit();
 	return status;
 }

+ 17 - 39
umac/cmn_services/serialization/src/wlan_serialization_utils.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. 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
@@ -127,7 +127,6 @@ QDF_STATUS wlan_serialization_timer_destroy(
 		goto error;
 	}
 
-	ser_debug("Destroying the timer");
 	qdf_timer_stop(&ser_timer->timer);
 	ser_timer->cmd = NULL;
 
@@ -161,8 +160,6 @@ QDF_STATUS wlan_serialization_cleanup_vdev_timers(
 	struct wlan_objmgr_pdev *pdev = NULL;
 	struct wlan_objmgr_psoc *psoc = NULL;
 
-	ser_enter();
-
 	pdev = wlan_vdev_get_pdev(vdev);
 	if (!pdev) {
 		QDF_BUG(0);
@@ -211,7 +208,6 @@ QDF_STATUS wlan_serialization_cleanup_vdev_timers(
 
 	wlan_serialization_release_lock(&psoc_ser_obj->timer_lock);
 error:
-	ser_exit();
 	return status;
 }
 
@@ -222,8 +218,6 @@ QDF_STATUS wlan_serialization_cleanup_all_timers(
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint32_t i = 0;
 
-	ser_enter();
-
 	if (!psoc_ser_obj) {
 		ser_err("Invalid psoc_ser_obj");
 		status = QDF_STATUS_E_FAILURE;
@@ -245,7 +239,7 @@ QDF_STATUS wlan_serialization_cleanup_all_timers(
 
 	wlan_serialization_release_lock(&psoc_ser_obj->timer_lock);
 error:
-	ser_exit();
+
 	return status;
 }
 
@@ -269,7 +263,8 @@ QDF_STATUS wlan_serialization_validate_cmd(
 	if (cmd_type < 0 || comp_id < 0 ||
 	    cmd_type >= WLAN_SER_CMD_MAX ||
 	   comp_id >= WLAN_UMAC_COMP_ID_MAX) {
-		ser_err("Invalid cmd or comp passed");
+		ser_err("Invalid cmd or comp passed comp %d type %d",
+			comp_id, cmd_type);
 		goto error;
 	}
 
@@ -344,12 +339,10 @@ void wlan_serialization_destroy_pdev_list(
 
 void wlan_serialization_destroy_vdev_list(qdf_list_t *list)
 {
-	ser_enter();
 
 	wlan_serialization_release_vdev_list_cmds(list);
 	qdf_list_destroy(list);
 
-	ser_exit();
 }
 
 struct wlan_ser_psoc_obj *wlan_serialization_get_psoc_obj(
@@ -494,8 +487,10 @@ wlan_serialization_remove_cmd_from_queue(
 	node = wlan_serialization_find_cmd(queue, WLAN_SER_MATCH_CMD_ID_VDEV,
 					   cmd, 0, NULL, cmd->vdev, node_type);
 
-	if (!node)
+	if (!node) {
+		ser_info("fail to find node %d for removal", node_type);
 		goto error;
+	}
 
 	if (node_type == WLAN_SER_PDEV_NODE)
 		cmd_list =
@@ -508,13 +503,6 @@ wlan_serialization_remove_cmd_from_queue(
 					 struct wlan_serialization_command_list,
 					 vdev_node);
 
-	ser_debug("Matching command found for removal from queue");
-	ser_debug("remove cmd: type[%d] id[%d] prio[%d] blocking[%d]",
-		  cmd_list->cmd.cmd_type,
-			  cmd_list->cmd.cmd_id,
-			  cmd_list->cmd.is_high_priority,
-			  cmd_list->cmd.is_blocking);
-
 	if (qdf_atomic_test_bit(CMD_MARKED_FOR_ACTIVATION,
 				&cmd_list->cmd_in_use)) {
 		qdf_atomic_set_bit(CMD_ACTIVE_MARKED_FOR_REMOVAL,
@@ -526,7 +514,7 @@ wlan_serialization_remove_cmd_from_queue(
 	status = wlan_serialization_remove_node(queue, node);
 
 	if (QDF_STATUS_SUCCESS != status)
-		ser_err("Fail to add to free pool type[%d]",
+		ser_err("Fail to add to free pool type %d",
 			cmd->cmd_type);
 
 	*pcmd_list = cmd_list;
@@ -552,24 +540,16 @@ wlan_serialization_add_cmd_to_queue(
 		goto error;
 	}
 
-	if (node_type == WLAN_SER_PDEV_NODE) {
+	if (node_type == WLAN_SER_PDEV_NODE)
 		node = &cmd_list->pdev_node;
-		ser_debug("pdev_queue: %pK", queue);
-	} else {
+	else
 		node = &cmd_list->vdev_node;
-		ser_debug("vdev_queue: %pK", queue);
-	}
-
-	ser_debug("add cmd: type[%d] id[%d] high_priority[%d] blocking[%d]",
-		  cmd_list->cmd.cmd_type,
-		  cmd_list->cmd.cmd_id,
-		  cmd_list->cmd.is_high_priority,
-		  cmd_list->cmd.is_blocking);
 
 	if (qdf_list_size(queue) == qdf_list_max_size(queue)) {
 		status = WLAN_SER_CMD_DENIED_LIST_FULL;
-		ser_err("qdf_list_size: %d is already max %d",
-			qdf_list_size(queue), qdf_list_max_size(queue));
+		ser_err("Queue size reached max %d, fail to add type %d id %d",
+			qdf_list_max_size(queue), cmd_list->cmd.cmd_type,
+			cmd_list->cmd.cmd_id);
 		goto error;
 	}
 
@@ -581,8 +561,6 @@ wlan_serialization_add_cmd_to_queue(
 	if (QDF_IS_STATUS_ERROR(qdf_status))
 		goto error;
 
-	ser_debug("adding cmd to node: %pK", node);
-
 	if (is_cmd_for_active_queue)
 		status = WLAN_SER_CMD_ACTIVE;
 	else
@@ -765,7 +743,9 @@ bool wlan_serialization_match_cmd_vdev(qdf_list_node_t *nnode,
 	if (cmd_list->cmd.vdev == vdev)
 		match_found = true;
 
-	ser_debug("matching cmd found(vdev:%pK): %d", vdev, match_found);
+	if (!match_found)
+		ser_debug("matching cmd not found for (vdev:%pK)", vdev);
+
 	return match_found;
 }
 
@@ -836,10 +816,8 @@ wlan_serialization_find_cmd(qdf_list_t *queue,
 
 	queuelen = wlan_serialization_list_size(queue);
 
-	if (!queuelen) {
-		ser_debug("queue empty");
+	if (!queuelen)
 		goto error;
-	}
 
 	while (queuelen--) {
 		status = wlan_serialization_get_cmd_from_queue(queue, &nnode);