Skip to content

Commit

Permalink
drivers: wifi: Fix mutex re-initialization
Browse files Browse the repository at this point in the history
The mutex is used to protect RPU zephyr context which gets modified for
every interface down and up (including recovery), so, it was being
re-initialized but also used to protect down and up which is a bug.

Move the re-initialization to the driver entry so that it happens only
once and we can properly use the mutext for down and up protection.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 authored and rlubos committed Sep 16, 2024
1 parent 09884d8 commit 9a6c755
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/wifi/nrf700x/src/fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,6 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
goto err;
}

k_mutex_init(&rpu_ctx_zep->rpu_lock);

return status;
err:
if (rpu_ctx) {
Expand Down Expand Up @@ -782,6 +780,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev)
nrf_wifi_scan_timeout_work);
#endif /* CONFIG_NRF700X_RADIO_TEST */

k_mutex_init(&rpu_drv_priv_zep.rpu_ctx_zep.rpu_lock);
return 0;
#ifdef CONFIG_NRF700X_RADIO_TEST
fmac_deinit:
Expand Down

0 comments on commit 9a6c755

Please sign in to comment.