From 3a321f3cfbbef4a9dbb23591a33283a3de278406 Mon Sep 17 00:00:00 2001 From: jiad Date: Mon, 16 Jul 2018 18:16:39 +0800 Subject: [PATCH] qcacld-3.0: Fix WLAN IPA disconnection handling When wlan driver unloading is in progress, IPA_OPCODE_TX/RX_SUSPEND will not be processed and resource_unloading may be left as true. Moroever since driver will be unloaded, IPA_OPCODE_TX/RX_SUSPEND interaction between Host and FW will not be necessary. Fix is to disable IPA pipes directly when handling disconnection if wlan driver unloading is in progress. Change-Id: Ia4af1ab04052b1a9bab44105760de50ad6263dbb CRs-Fixed: 2279044 --- components/ipa/core/src/wlan_ipa_core.c | 27 ++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/components/ipa/core/src/wlan_ipa_core.c b/components/ipa/core/src/wlan_ipa_core.c index 71fcb3b4e13f..40aa042d1303 100644 --- a/components/ipa/core/src/wlan_ipa_core.c +++ b/components/ipa/core/src/wlan_ipa_core.c @@ -1597,8 +1597,19 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode, /* Disable IPA UC TX PIPE when STA disconnected */ if ((ipa_ctx->num_iface == 1) && wlan_ipa_is_fw_wdi_activated(ipa_ctx) && - !ipa_ctx->ipa_pipes_down) - wlan_ipa_uc_handle_last_discon(ipa_ctx); + !ipa_ctx->ipa_pipes_down) { + if (cds_is_driver_unloading()) { + /* + * We disable WDI pipes directly here + * since IPA_OPCODE_TX/RX_SUSPEND + * message will not be processed when + * unloading WLAN driver is in progress + */ + wlan_ipa_uc_disable_pipes(ipa_ctx); + } else { + wlan_ipa_uc_handle_last_discon(ipa_ctx); + } + } } if (wlan_ipa_uc_sta_is_enabled(ipa_ctx->config) && @@ -1793,7 +1804,17 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode, if ((false == ipa_ctx->resource_unloading) && wlan_ipa_is_fw_wdi_activated(ipa_ctx) && !ipa_ctx->ipa_pipes_down) { - wlan_ipa_uc_handle_last_discon(ipa_ctx); + if (cds_is_driver_unloading()) { + /* + * We disable WDI pipes directly here + * since IPA_OPCODE_TX/RX_SUSPEND + * message will not be processed when + * unloading WLAN driver is in progress + */ + wlan_ipa_uc_disable_pipes(ipa_ctx); + } else { + wlan_ipa_uc_handle_last_discon(ipa_ctx); + } } if (wlan_ipa_uc_sta_is_enabled(ipa_ctx->config) &&