|
@@ -17207,6 +17207,7 @@ static int wlan_hdd_disconnect(struct hdd_adapter *adapter, u16 reason)
|
|
|
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
eConnectionState prev_conn_state;
|
|
|
tHalHandle hal = WLAN_HDD_GET_HAL_CTX(adapter);
|
|
|
+ uint32_t wait_time = WLAN_WAIT_TIME_DISCONNECT;
|
|
|
|
|
|
ENTER();
|
|
|
|
|
@@ -17264,7 +17265,14 @@ static int wlan_hdd_disconnect(struct hdd_adapter *adapter, u16 reason)
|
|
|
prev_conn_state != eConnectionState_Connecting) {
|
|
|
hdd_debug("status = %d, already disconnected", status);
|
|
|
result = 0;
|
|
|
- goto disconnected;
|
|
|
+ /*
|
|
|
+ * Wait here instead of returning directly. This will block the
|
|
|
+ * next connect command and allow processing of the disconnect
|
|
|
+ * in SME else we might hit some race conditions leading to SME
|
|
|
+ * and HDD out of sync. As disconnect is already in progress,
|
|
|
+ * wait here for 1 sec instead of 5 sec.
|
|
|
+ */
|
|
|
+ wait_time = WLAN_WAIT_DISCONNECT_ALREADY_IN_PROGRESS;
|
|
|
} else if (QDF_STATUS_CMD_NOT_QUEUED == status) {
|
|
|
/*
|
|
|
* Wait here instead of returning directly, this will block the
|
|
@@ -17281,8 +17289,7 @@ static int wlan_hdd_disconnect(struct hdd_adapter *adapter, u16 reason)
|
|
|
}
|
|
|
wait_for_disconnect:
|
|
|
rc = wait_for_completion_timeout(&adapter->disconnect_comp_var,
|
|
|
- msecs_to_jiffies
|
|
|
- (WLAN_WAIT_TIME_DISCONNECT));
|
|
|
+ msecs_to_jiffies(wait_time));
|
|
|
|
|
|
if (!rc && (QDF_STATUS_CMD_NOT_QUEUED != status)) {
|
|
|
hdd_err("Failed to disconnect, timed out");
|