android_kernel_motorola_sm6375/umac
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Zhu Jianmin 959cb86f82 qcacmn: Fix stability caused by unwanted recursive calls in serialization
Issue description: When wlan_serialization_dequeue_cmd() gets called, it
will remove the command from active queue and try to move next pending
command from pending queue to active queue. But before it moves this
pending command to active queue completly, it calls the caller and
notify that command is activated through callback.
If that callback returns failure then serialization abandon the process
of moving it from pending to active. Now it again picks the same command
from pending and repeat the process. This creates unwanted recursion and
reference count mistakenly decremented multiple times.

Here is the recursion stack:
  (a) wlan_serialization_move_pending_to_active()
    (b) wlan_serialization_enqueue_cmd
      (c) wlan_serialization_add_cmd_to_given_queue
        (d) cmd_list->cmd.cmd_cb() fails
          (e) wlan_serialization_put_back_to_global_list
            (f) go back to (a) and repeat
Fix: Divide wlan_serialization_enqueue_cmd() API's logic in 2 parts.
1) Enqueue the command first through wlan_serialization_enqueue_cmd()
   This ensures that command has been put in to given queue.
2) Once command has been put in to given queue and if this queue happen
   to be active queue then activate the command through
   wlan_serialization_activate_cmd()
Here is the stack after the fix:
  (a) wlan_serialization_move_pending_to_active()
    (b) wlan_serialization_enqueue_cmd
      (c) wlan_serialization_add_cmd_to_given_queue
        (d) returns WLAN_SER_CMD_ACTIVE or !WLAN_SER_CMD_ACTIVE
  (a1) if (WLAN_SER_CMD_ACTIVE)
    (b1) wlan_serialization_put_back_to_global_list() for pending cmd
      (c1) wlan_serialization_activate_cmd()
        (d1) if fail
          (e1) wlan_serialization_put_back_to_global_list for active cmd
             (f1) then repeat from (a)
        (d2) if pass then return
  (a2) if (!WLAN_SER_CMD_ACTIVE) then nothing to be done.

Change-Id: I8c63dd15d7ab8612a87950a3c189e73d1436c26a
CRs-Fixed: 2132975
2017-11-01 14:39:17 -07:00
..
cmn_services qcacmn: Fix stability caused by unwanted recursive calls in serialization 2017-11-01 14:39:17 -07:00
dfs qcacmn: Fix for AP to ignore CAC complete event from firmware during CAC 2017-10-25 19:41:16 -07:00
global_umac_dispatcher/lmac_if qcacmn: Changes to wext interface for external acs 2017-10-30 01:39:07 -07:00
nan qcacmn: Enable support for multiple NAN Data Interfaces 2017-07-25 13:33:53 -07:00
p2p qcacmn: Fix invalid buffer access in p2p mgmt tx processing 2017-10-26 23:48:04 -07:00
regulatory qcacmn: Do not call scheduler for PO and FO 2017-10-28 07:25:39 -07:00
scan qcacmn: Go for DBS scan if atleast one session is connected 2017-10-29 07:25:15 -07:00
tdls qcacmn: Send TDLS frames with lower AC 2017-10-24 15:38:24 -07:00
wifi_pos qcacmn: Add ucfg_wifi_pos set/get apis for FTM value 2017-10-20 13:54:00 -07:00