From fd758ecd2f4189195f5e1e0929d6f55e73145a8e Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Fri, 4 Aug 2017 12:03:18 +0530 Subject: [PATCH] qcacld-3.0: Driver loading failure during monitor mode bring up The API hdd_update_tgt_cfg decides whether to create a new PDEV or use the existing one. In this case, the driver is de-initialized/re-initialized followed by the cfg download. The FW then generates SYS_READY and the control comes to this function. Since there is no check for monitor mode the second PDEV is created. FW seems to provide phy_id = 0 and expects the host to use the corresponding pdev_id at various places during initialization. Now here phy_id = 0 and pdev_id = 1, thus initializations fails. To resolve this issue add a check for monitor mode in hdd_update_tgt_cfg function and use the same pdev_id. CRs-Fixed: 2087541 Change-Id: I9dd6449b1e81b6bb218d21c07ca0f5335067865d --- core/hdd/src/wlan_hdd_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index cdd4d7fc4ab8..7fec4a78e666 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1519,9 +1519,11 @@ void hdd_update_tgt_cfg(void *context, void *param) uint8_t antenna_mode; /* Reuse same pdev for module start/stop or SSR */ - if ((hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) || - !cds_is_driver_loading()) { - hdd_err("Reuse pdev for module start/stop or SSR"); + if (((hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) || + (hdd_get_conparam() == QDF_GLOBAL_MONITOR_MODE) || + !cds_is_driver_loading()) && (hdd_ctx->hdd_pdev != NULL)) { + hdd_debug("Reuse pdev for module start/stop or SSR pdev_id = %u", + hdd_ctx->hdd_pdev->pdev_objmgr.wlan_pdev_id); /* Restore pdev to MAC/WMA contexts */ sme_store_pdev(hdd_ctx->hHal, hdd_ctx->hdd_pdev); } else { @@ -1529,7 +1531,9 @@ void hdd_update_tgt_cfg(void *context, void *param) if (ret) { hdd_err("pdev creation fails!"); QDF_BUG(0); - } + } else + hdd_debug("New pdev has been created with pdev_id = %u", + hdd_ctx->hdd_pdev->pdev_objmgr.wlan_pdev_id); } if (cds_cfg) {