From 0724417fbf68a95c11d2bd1511c935b8f17fa691 Mon Sep 17 00:00:00 2001 From: Will Huang Date: Mon, 14 May 2018 14:23:30 +0800 Subject: [PATCH] qcacld-3.0: Update max_vdev_count to psoc objmgr Currently max_intf_count which report from target only update to hdd layer, but there might be a race condition if don't update to objmgr: There are already max_intf_count vdev created, one of the vdev is closing by supplicant, vdev is logically deleted and referenced by other function and waiting for cleaning. The interface count of hdd layer is already decreased to accept opening new adapter, but the vdev_id which derived from objmgr vdev is still occupied so the new vdev have to choose max_intf_count as vdev_id, which makes target assert. Update max_vdev_count to psoc objmgr in hdd_update_tgt_cfg() Change-Id: Ifff0b79cfb4645bb466a22da2d7d07040eee2bd0 CRs-Fixed: 2241098 --- core/hdd/src/wlan_hdd_main.c | 2 ++ core/hdd/src/wlan_hdd_object_manager.c | 13 +++++++++++++ core/hdd/src/wlan_hdd_object_manager.h | 11 +++++++++++ 3 files changed, 26 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d34f6693195e8..2784007c35a3a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1874,6 +1874,8 @@ void hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg) } } + hdd_objmgr_update_tgt_max_vdev_psoc(hdd_ctx, cfg->max_intf_count); + ret = hdd_green_ap_update_config(hdd_ctx); ucfg_ipa_set_dp_handle(hdd_ctx->hdd_psoc, diff --git a/core/hdd/src/wlan_hdd_object_manager.c b/core/hdd/src/wlan_hdd_object_manager.c index 9fe3044f1cae9..353dfbe55be63 100644 --- a/core/hdd/src/wlan_hdd_object_manager.c +++ b/core/hdd/src/wlan_hdd_object_manager.c @@ -116,6 +116,19 @@ int hdd_objmgr_release_and_destroy_psoc(struct hdd_context *hdd_ctx) return qdf_status_to_os_return(status); } +void hdd_objmgr_update_tgt_max_vdev_psoc(struct hdd_context *hdd_ctx, + uint8_t max_vdev) +{ + struct wlan_objmgr_psoc *psoc = hdd_ctx->hdd_psoc; + + if (!psoc) { + hdd_err("Psoc NULL"); + return; + } + + wlan_psoc_set_max_vdev_count(psoc, max_vdev); +} + int hdd_objmgr_create_and_store_pdev(struct hdd_context *hdd_ctx) { QDF_STATUS status; diff --git a/core/hdd/src/wlan_hdd_object_manager.h b/core/hdd/src/wlan_hdd_object_manager.h index d3f957ca11424..c41ec80d49778 100644 --- a/core/hdd/src/wlan_hdd_object_manager.h +++ b/core/hdd/src/wlan_hdd_object_manager.h @@ -78,6 +78,17 @@ int hdd_objmgr_create_and_store_psoc(struct hdd_context *hdd_ctx, */ int hdd_objmgr_release_and_destroy_psoc(struct hdd_context *hdd_ctx); +/** + * hdd_objmgr_update_tgt_max_vdev_psoc() - Update target max vdev number + * @hdd_ctx: Hdd context + * + * This API update target max vdev number to psoc object + * + * Return: None + */ +void hdd_objmgr_update_tgt_max_vdev_psoc(struct hdd_context *hdd_ctx, + uint8_t max_vdev); + /** * hdd_objmgr_create_and_store_pdev() - Create pdev and store in hdd context * @hdd_ctx: Hdd context