From f011832a653ff139f1d0fb5e3e274a528d6af389 Mon Sep 17 00:00:00 2001 From: Vivek Date: Fri, 15 Nov 2019 15:46:05 +0530 Subject: [PATCH] qcacmn: Update blocking command flags atomically When moving a blocking command from pending to active queue, we release the lock and call the activation cb. After the activation cb returns, we update the blocking cmd waiting flag based on the active cmd node's "is_blocking" param. If the activation cb is also resulting in removing the command, then after the cb returns, the active cmd node is returned to the free pool and our check fails, and we miss to update the blocking cmd waiting flag, resulting in no further commands moving to the active queue. The update to the blocking command should be done atomically, immediately after it moves to active queue and before releasing the lock for the activation callback. Change-Id: Idedccb16ce68bb2166fb3970cd231fe738ec6af2 CRs-Fixed: 2554767 --- .../serialization/src/wlan_serialization_non_scan.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/umac/cmn_services/serialization/src/wlan_serialization_non_scan.c b/umac/cmn_services/serialization/src/wlan_serialization_non_scan.c index 27db44c0a26d..c323b4504700 100644 --- a/umac/cmn_services/serialization/src/wlan_serialization_non_scan.c +++ b/umac/cmn_services/serialization/src/wlan_serialization_non_scan.c @@ -364,6 +364,9 @@ wlan_ser_move_non_scan_pending_to_active( qdf_atomic_set_bit(CMD_MARKED_FOR_ACTIVATION, &active_cmd_list->cmd_in_use); + if (active_cmd_list->cmd.is_blocking) + pdev_queue->blocking_cmd_waiting--; + wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock); wlan_serialization_activate_cmd(active_cmd_list, ser_pdev_obj, @@ -371,15 +374,11 @@ wlan_ser_move_non_scan_pending_to_active( wlan_serialization_acquire_lock(&pdev_queue->pdev_queue_lock); - if (vdev_queue_lookup) + if (vdev_queue_lookup || pdev_queue->blocking_cmd_active) break; pending_node = NULL; - if (active_cmd_list->cmd.is_blocking) { - pdev_queue->blocking_cmd_waiting--; - break; - } } wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock);