From 5298c51bdddf9ba76d4a0fabc2b3362e65dbb157 Mon Sep 17 00:00:00 2001 From: abhinav kumar Date: Thu, 17 Nov 2022 15:42:06 +0530 Subject: [PATCH] qcacld-3.0: Dont issue disconnect on STA while start/stop SAP Currently, our host logic is "If an STA connection is in progress in another adapter, driver disconnects the STA and completes the SAP operation (start BSS or stop BSS)". This is due to below reasons: In the old kernel version and for STA+SAP concurrency support from GUI, the first STA connection gets triggered and while it is in progress, SAP start/stop also comes up. Once STA association is successful, the STA connect event is sent to the kernel which gets queued in the kernel workqueue and the supplicant won't process M1 received from AP and send M2 until this NL80211_CONNECT event is received. Workqueue is not scheduled as RTNL lock is already taken by hostapd thread which has issued start_bss/stop_bss command to the driver. The driver cannot complete start_bss/stop_bss as the pending command at the head of the SME command pending list is hw_mode_update for STA session which cannot be processed as SME is in WAITforKey state for STA interface. The start_bss/stop_bss command for SAP interface is queued behind the hw_mode_update command and so it cannot be processed until hw_mode_update command is processed. This is causing a deadlock so disconnect the STA interface first if a connection or key exchange is in progress and then start or stop the SAP interface. As part of connection mgr changes, removed dependency on WAITforKey state in serialization, and h/w mode also is not sent immediately after the STA connection, So no possibility of the above deadlock scenario. The fix is to avoid disconnection on the STA interface during the start or stop of the SAP interface. Change-Id: Iad3ada091e505007cc6901a461be3b88fc051f4e CRs-Fixed: 3339784 --- core/hdd/src/wlan_hdd_assoc.c | 16 ++-------------- core/hdd/src/wlan_hdd_hostapd.c | 25 ------------------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 67f3e1f93559..7fd32192150a 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -165,7 +165,7 @@ u8 ccp_rsn_oui_13[HDD_RSN_OUI_SIZE] = {0x50, 0x6F, 0x9A, 0x01}; #define HDD_PEER_AUTHORIZE_WAIT 10 -/** +/* * beacon_filter_table - table of IEs used for beacon filtering */ static const int beacon_filter_table[] = { @@ -434,18 +434,6 @@ struct hdd_adapter *hdd_get_sta_connection_in_progress( hdd_adapter_dev_put_debug(next_adapter, dbgid); return adapter; - } else if ((eConnectionState_Associated == - hdd_sta_ctx->conn_info.conn_state) && - sme_is_sta_key_exchange_in_progress( - hdd_ctx->mac_handle, - adapter->vdev_id)) { - hdd_debug("vdev_id %d: Key exchange is in progress", - adapter->vdev_id); - hdd_adapter_dev_put_debug(adapter, dbgid); - if (next_adapter) - hdd_adapter_dev_put_debug(next_adapter, - dbgid); - return adapter; } } hdd_adapter_dev_put_debug(adapter, dbgid); diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index dde93a5872cb..d1d8318f2802 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5273,24 +5273,6 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, return -EINVAL; } } - /* - * For STA+SAP concurrency support from GUI, first STA connection gets - * triggered and while it is in progress, SAP start also comes up. - * Once STA association is successful, STA connect event is sent to - * kernel which gets queued in kernel workqueue and supplicant won't - * process M1 received from AP and send M2 until this NL80211_CONNECT - * event is received. Workqueue is not scheduled as RTNL lock is already - * taken by hostapd thread which has issued start_bss command to driver. - * Driver cannot complete start_bss as the pending command at the head - * of the SME command pending list is hw_mode_update for STA session - * which cannot be processed as SME is in WAITforKey state for STA - * interface. The start_bss command for SAP interface is queued behind - * the hw_mode_update command and so it cannot be processed until - * hw_mode_update command is processed. This is causing a deadlock so - * disconnect the STA interface first if connection or key exchange is - * in progress and then start SAP interface. - */ - hdd_abort_ongoing_sta_connection(hdd_ctx); mac_handle = hdd_ctx->mac_handle; @@ -6070,13 +6052,6 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, hdd_debug("Device_mode %s(%d)", qdf_opmode_str(adapter->device_mode), adapter->device_mode); - /* - * If a STA connection is in progress in another adapter, disconnect - * the STA and complete the SAP operation. STA will reconnect - * after SAP stop is done. - */ - hdd_abort_ongoing_sta_connection(hdd_ctx); - if (adapter->device_mode == QDF_SAP_MODE) { wlan_hdd_del_station(adapter); mac_handle = hdd_ctx->mac_handle;