Skip to content

Revert "modules: nrf_wifi: Use spinlocks" #93463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions modules/nrf_wifi/os/shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,9 @@ static void zep_shim_qspi_cpy_to(void *priv, unsigned long addr, const void *src
}
#endif /* !CONFIG_NRF71_ON_IPC */

struct zep_shim_spinlock {
struct k_spinlock lock;
k_spinlock_key_t key;
};

static void *zep_shim_spinlock_alloc(void)
{
struct zep_shim_spinlock *slock = NULL;
struct k_mutex *lock = NULL;

slock = k_heap_aligned_alloc(wifi_ctrl_pool, WORD_SIZE, sizeof(*slock), K_FOREVER);
if (!slock) {
Expand All @@ -211,7 +206,7 @@ static void *zep_shim_spinlock_alloc(void)
memset(slock, 0, sizeof(*slock));
}

return slock;
return lock;
}

static void zep_shim_spinlock_free(void *lock)
Expand All @@ -223,38 +218,29 @@ static void zep_shim_spinlock_free(void *lock)

static void zep_shim_spinlock_init(void *lock)
{
/* No explicit initialization needed for k_spinlock_t */
ARG_UNUSED(lock);
k_mutex_init(lock);
}

static void zep_shim_spinlock_take(void *lock)
{
struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock;

slock->key = k_spin_lock(&slock->lock);
k_mutex_lock(lock, K_FOREVER);
}

static void zep_shim_spinlock_rel(void *lock)
{
struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock;

k_spin_unlock(&slock->lock, slock->key);
k_mutex_unlock(lock);
}

static void zep_shim_spinlock_irq_take(void *lock, unsigned long *flags)
{
struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock;

ARG_UNUSED(flags);
slock->key = k_spin_lock(&slock->lock);
k_mutex_lock(lock, K_FOREVER);
}

static void zep_shim_spinlock_irq_rel(void *lock, unsigned long *flags)
{
struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock;

ARG_UNUSED(flags);
k_spin_unlock(&slock->lock, slock->key);
k_mutex_unlock(lock);
}

static int zep_shim_pr_dbg(const char *fmt, va_list args)
Expand Down