From aad2e9bdb9bf1c7d672fe560e003f22547500977 Mon Sep 17 00:00:00 2001 From: Surya Prakash Raajen Date: Fri, 27 Jan 2023 22:01:25 +0530 Subject: [PATCH] qcacmn: Re-init mlo global shmem in case of recovery Re-init mlo global shmem region whenever in case of expected target recovery mode. In case of mode1 recovery assert, need complete teardown of mlo and clearing out global mlo shared memory, when asserted SoC is recovered, re-init global shared memory region again. Change-Id: I475b08934bdceb78b87d115b79abf45e76633795 CRs-Fixed: 3390199 --- .../init_deinit/inc/mlo_global_h_shmem_arena.h | 7 +++++-- .../init_deinit/src/mlo_global_h_shmem_arena.c | 13 ++++++++----- .../lmac_if/inc/wlan_lmac_if_def.h | 6 ++++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/target_if/init_deinit/inc/mlo_global_h_shmem_arena.h b/target_if/init_deinit/inc/mlo_global_h_shmem_arena.h index 095462992e..5d14d10558 100644 --- a/target_if/init_deinit/inc/mlo_global_h_shmem_arena.h +++ b/target_if/init_deinit/inc/mlo_global_h_shmem_arena.h @@ -125,21 +125,24 @@ struct wlan_host_mlo_glb_h_shmem_arena_ctx { * @arena_vaddr: Virtual address of the MLO Global shared memory arena * @arena_len: Length (in bytes) of the MLO Global shared memory arena * @grp_id: Id of the required MLO Group + * @recovery: MLO recovery is in progress * * Return: QDF_STATUS of operation */ QDF_STATUS mlo_glb_h_shmem_arena_ctx_init(void *arena_vaddr, size_t arena_len, - uint8_t grp_id); + uint8_t grp_id, + uint8_t recovery); /** * mlo_glb_h_shmem_arena_ctx_deinit() - De-initialize MLO Global shared memory * arena context on Host * @grp_id: Id of the required MLO Group + * @recovery: MLO recovery is in progress * * Return: QDF_STATUS of operation */ -QDF_STATUS mlo_glb_h_shmem_arena_ctx_deinit(uint8_t grp_id); +QDF_STATUS mlo_glb_h_shmem_arena_ctx_deinit(uint8_t grp_id, uint8_t recovery); #endif #ifdef WLAN_MLO_GLOBAL_SHMEM_SUPPORT diff --git a/target_if/init_deinit/src/mlo_global_h_shmem_arena.c b/target_if/init_deinit/src/mlo_global_h_shmem_arena.c index 33a48b0ddb..182fefd0c8 100644 --- a/target_if/init_deinit/src/mlo_global_h_shmem_arena.c +++ b/target_if/init_deinit/src/mlo_global_h_shmem_arena.c @@ -823,7 +823,8 @@ static int parse_mlo_glb_h_shmem_arena( QDF_STATUS mlo_glb_h_shmem_arena_ctx_init(void *arena_vaddr, size_t arena_len, - uint8_t grp_id) + uint8_t grp_id, + uint8_t recovery) { struct wlan_host_mlo_glb_h_shmem_arena_ctx *shmem_arena_ctx; @@ -837,7 +838,8 @@ QDF_STATUS mlo_glb_h_shmem_arena_ctx_init(void *arena_vaddr, } /* We need to initialize only for the first invocation */ - if (qdf_atomic_read(&shmem_arena_ctx->init_count)) + if ((recovery != MLO_RECOVERY_MODE_1) && + qdf_atomic_read(&shmem_arena_ctx->init_count)) goto success; if (parse_mlo_glb_h_shmem_arena(arena_vaddr, arena_len, @@ -856,7 +858,7 @@ success: qdf_export_symbol(mlo_glb_h_shmem_arena_ctx_init); -QDF_STATUS mlo_glb_h_shmem_arena_ctx_deinit(uint8_t grp_id) +QDF_STATUS mlo_glb_h_shmem_arena_ctx_deinit(uint8_t grp_id, uint8_t recovery) { struct wlan_host_mlo_glb_h_shmem_arena_ctx *shmem_arena_ctx; @@ -874,8 +876,9 @@ QDF_STATUS mlo_glb_h_shmem_arena_ctx_deinit(uint8_t grp_id) return QDF_STATUS_E_FAILURE; } - /* We need to de-initialize only for the last invocation */ - if (qdf_atomic_dec_and_test(&shmem_arena_ctx->init_count)) + /* We need to de-initialize only for the last invocation */ + if ((recovery != MLO_RECOVERY_MODE_1) && + qdf_atomic_dec_and_test(&shmem_arena_ctx->init_count)) goto success; free_mlo_glb_rx_reo_per_link_info( diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 6cfaf323d3..09fe7a95e6 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -261,8 +261,10 @@ struct wlan_lmac_if_global_shmem_local_ops { QDF_STATUS (*init_shmem_arena_ctx)(void *arena_vaddr, size_t arena_len, - uint8_t grp_id); - QDF_STATUS (*deinit_shmem_arena_ctx)(uint8_t grp_id); + uint8_t grp_id, + uint8_t recovery); + QDF_STATUS (*deinit_shmem_arena_ctx)(uint8_t grp_id, + uint8_t recovery); void *(*get_crash_reason_address)(uint8_t grp_id, uint8_t chip_id); uint8_t (*get_no_of_chips_from_crash_info)(uint8_t grp_id);