Browse Source

qcacmn: Additional flag to mark cmds both for activation and cancel

Adding additional flag for commands which has been marked
for activation and for which cancel has been received.

After the commands marked for activation and also marked for cancel
really gets active, we remove the command from the active queue.

Change-Id: I5eb42459e216ad8cbcee15ce9a7572dec7f776a2
CRs-Fixed: 2326639
Vivek 6 years ago
parent
commit
595e6ee390

+ 14 - 1
umac/cmn_services/serialization/src/wlan_serialization_internal.c

@@ -276,9 +276,22 @@ QDF_STATUS wlan_serialization_activate_cmd(
 
 	wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
 
-	if (QDF_IS_STATUS_ERROR(status))
+	if (QDF_IS_STATUS_ERROR(status)) {
 		wlan_serialization_dequeue_cmd(&cmd_list->cmd, true);
+		return status;
+	}
 
+	/*
+	 * Cmd was marked for activation and cancel
+	 * was received before activation so the command
+	 * should be immediately removed after activation
+	 */
+	if (qdf_atomic_test_bit(CMD_ACTIVE_MARKED_FOR_CANCEL,
+				&cmd_list->cmd_in_use))
+		wlan_serialization_cmd_cancel_handler(
+				ser_pdev_obj, &cmd_list->cmd,
+				NULL, NULL, cmd_list->cmd.cmd_type,
+				WLAN_SERIALIZATION_ACTIVE_QUEUE);
 error:
 	return status;
 }

+ 6 - 6
umac/cmn_services/serialization/src/wlan_serialization_non_scan.c

@@ -490,15 +490,16 @@ wlan_ser_cancel_non_scan_cmd(
 			}
 
 			/* Cancel request received for a cmd in active
-			 * queue which has not been activated yet, we
-			 * should assert here
+			 * queue which has not been activated yet, we mark
+			 * it as CMD_ACTIVE_MARKED_FOR_CANCEL and remove
+			 * the cmd after activation
 			 */
 			if (qdf_atomic_test_bit(CMD_MARKED_FOR_ACTIVATION,
 						&cmd_list->cmd_in_use)) {
-				wlan_serialization_release_lock(
-						&pdev_q->pdev_queue_lock);
+				qdf_atomic_set_bit(CMD_ACTIVE_MARKED_FOR_CANCEL,
+						   &cmd_list->cmd_in_use);
 				status = WLAN_SER_CMD_MARKED_FOR_ACTIVATION;
-				goto error;
+				continue;
 			}
 
 			qdf_status = wlan_serialization_find_and_stop_timer(
@@ -589,7 +590,6 @@ wlan_ser_cancel_non_scan_cmd(
 
 	wlan_serialization_release_lock(&pdev_q->pdev_queue_lock);
 
-error:
 	ser_exit();
 	return status;
 }

+ 6 - 6
umac/cmn_services/serialization/src/wlan_serialization_scan.c

@@ -237,15 +237,16 @@ wlan_ser_cancel_scan_cmd(
 			}
 
 			/* Cancel request received for a cmd in active
-			 * queue which has not been activated yet, we
-			 * should assert here
+			 * queue which has not been activated yet, we mark
+			 * it as CMD_ACTIVE_MARKED_FOR_CANCEL and remove
+			 * the cmd after activation
 			 */
 			if (qdf_atomic_test_bit(CMD_MARKED_FOR_ACTIVATION,
 						&cmd_list->cmd_in_use)) {
-				wlan_serialization_release_lock(
-						&pdev_q->pdev_queue_lock);
+				qdf_atomic_set_bit(CMD_ACTIVE_MARKED_FOR_CANCEL,
+						   &cmd_list->cmd_in_use);
 				status = WLAN_SER_CMD_MARKED_FOR_ACTIVATION;
-				goto error;
+				continue;
 			}
 
 			qdf_status = wlan_serialization_find_and_stop_timer(
@@ -312,7 +313,6 @@ wlan_ser_cancel_scan_cmd(
 
 	wlan_serialization_release_lock(&pdev_q->pdev_queue_lock);
 
-error:
 	ser_exit();
 	return status;
 }

+ 1 - 0
umac/cmn_services/serialization/src/wlan_serialization_utils_i.h

@@ -635,6 +635,7 @@ QDF_STATUS wlan_serialization_peek_next(
  */
 #define CMD_MARKED_FOR_ACTIVATION 1
 #define CMD_IS_ACTIVE             2
+#define CMD_ACTIVE_MARKED_FOR_CANCEL 3
 /**
  * struct wlan_serialization_timer - Timer used for serialization
  * @cmd:      Cmd to which the timer is linked