qcacld-3.0: Relocate init of tx_action_cnf_event
HDD has a completion variable which is used to synchronize the sending of an action frame with the send confirmation. Proper use of a completion variable requires a specific sequence of steps: - Initialize the completion variable - Perform the activity that has asynchronous processing - Wait on the completion variable Currently HDD does not correctly follow this model for sending action frames; it incorrectly initializes the completion variable after it has invoked the UMAC function which sends the frame. This creates a race condition whereby the TX could complete and set the completion variable before the completion variable is initialized, and then when the completion variable is initialized the fact that the activity has already completed will be lost. In order to prevent this race condition and conform to the sequence of steps required for proper completion variable usage, relocate the initialization of tx_action_cnf_event. Change-Id: Ibc54b8dd62c3a828d1a43922d89e7970af325f6e CRs-Fixed: 950132
This commit is contained in:

committed by
Akash Patel

parent
f6358f1060
commit
19caeb103e
@@ -2057,7 +2057,6 @@ void hdd_cleanup_actionframe(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
|
|||||||
|
|
||||||
if (NULL != cfgState->buf) {
|
if (NULL != cfgState->buf) {
|
||||||
unsigned long rc;
|
unsigned long rc;
|
||||||
INIT_COMPLETION(adapter->tx_action_cnf_event);
|
|
||||||
rc = wait_for_completion_timeout(
|
rc = wait_for_completion_timeout(
|
||||||
&adapter->tx_action_cnf_event,
|
&adapter->tx_action_cnf_event,
|
||||||
msecs_to_jiffies(ACTION_FRAME_TX_TIMEOUT));
|
msecs_to_jiffies(ACTION_FRAME_TX_TIMEOUT));
|
||||||
|
@@ -1544,6 +1544,8 @@ send_frame:
|
|||||||
current_freq = 0;
|
current_freq = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INIT_COMPLETION(pAdapter->tx_action_cnf_event);
|
||||||
|
|
||||||
if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
|
if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
|
||||||
(WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
|
(WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
|
||||||
(WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
|
(WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
|
||||||
|
Reference in New Issue
Block a user