Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca2afe28 authored by Himanshu Batra's avatar Himanshu Batra Committed by snandini
Browse files

qcacmn: Update queue size from pending queue after command activation

As part of activaiton of serialization command from pending to
active queue, the lock is released. In the activation API, the
same API to move non scan cmds from pending to active queue can
be called if activation fails. This reentrant API may modify the
pending queue even before the control is given back to the caller
API leading to random behavior when accesing the next cmd from pending
queue via local variables.

Add fix to update queue size from pending queue after command activation

Change-Id: I8082e2a9dd3410369967ab20196853ddfa0639a7
CRs-Fixed: 2801956
parent 1c0e2642
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -339,9 +339,11 @@ wlan_ser_move_non_scan_pending_to_active(
						   &next_cmd_list->cmd_in_use);
			}

			if (vdev_cmd_active)
			if (vdev_cmd_active) {
				qdf_atomic_clear_bit(CMD_MARKED_FOR_MOVEMENT,
						     &pending_cmd_list->cmd_in_use);
				continue;

			}
		} else {
			if (vdev_cmd_active)
				break;
@@ -417,12 +419,19 @@ wlan_ser_move_non_scan_pending_to_active(
		if (vdev_queue_lookup || pdev_queue->blocking_cmd_active)
			break;

		if (next_cmd_list) {
			qdf_atomic_clear_bit(CMD_MARKED_FOR_MOVEMENT,
					     &next_cmd_list->cmd_in_use);
		qsize =  wlan_serialization_list_size(pending_queue);
		if (!qsize) {
			wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
			goto error;
		}

		next_cmd_list = NULL;
		qdf_status = wlan_serialization_peek_front(pending_queue,
							   &pending_node);
		if (qdf_status != QDF_STATUS_SUCCESS) {
			ser_err("can't peek cmd");
			wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);
			goto error;
		}
	}

	wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);