From d16c202da2c3c69d50be52b6bdd9902f35d24340 Mon Sep 17 00:00:00 2001 From: Mukul Sharma Date: Tue, 25 Jul 2017 18:56:12 +0530 Subject: [PATCH] qcacld-3.0: Disable auto ps timer on interface down Auto ps timer is started as part of the interface up but not disabled as part of the interface down. Meanwhile if interface down happen hence sme session get deleted. But if ps timer expire later then it try to access invalid sme session and lead to abort. As a part of fix, Disable auto ps timer on interface down. Change-Id: If67f7ec66d7dea7b8e7e674dc86efe7124244dde CRs-Fixed: 2061845 --- core/hdd/src/wlan_hdd_main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 0b0aa28abdeb..e32b203d545a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -121,6 +121,7 @@ #include "nan_public_structs.h" #include "wlan_reg_ucfg_api.h" #include "wlan_hdd_rx_monitor.h" +#include "sme_power_save_api.h" #ifdef CNSS_GENL #include @@ -2496,7 +2497,17 @@ static int __hdd_stop(struct net_device *dev) /* Make sure the interface is marked as closed */ clear_bit(DEVICE_IFACE_OPENED, &adapter->event_flags); - hdd_debug("Disabling queues"); + + hdd_debug("Disabling Auto Power save timer"); + sme_ps_disable_auto_ps_timer( + WLAN_HDD_GET_HAL_CTX(adapter), + adapter->sessionId); + + /* + * Disable TX on the interface, after this hard_start_xmit() will not + * be called on that interface + */ + hdd_notice("Disabling queues"); wlan_hdd_netif_queue_control(adapter, WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH);