Skip to content
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

[nrf fromlist] modules: hal_nordic: nrfs: Enqueue requests when not c… #2273

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
13 changes: 7 additions & 6 deletions modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ static void ipc_sysctrl_ept_bound(void *priv)
LOG_DBG("Bound to sysctrl.");
k_event_post(&ipc_connected_event, IPC_INIT_DONE_EVENT);
atomic_set(&ipc_cpusys_channel_config.status, CONNECTED);

if (k_msgq_num_used_get(&ipc_transmit_msgq) > 0) {
k_work_submit(&backend_send_work);
}
}

static void ipc_sysctrl_ept_recv(const void *data, size_t size, void *priv)
Expand Down Expand Up @@ -172,11 +176,6 @@ nrfs_err_t nrfs_backend_send(void *message, size_t size)

nrfs_err_t nrfs_backend_send_ex(void *message, size_t size, k_timeout_t timeout, bool high_prio)
{
if (atomic_get(&ipc_cpusys_channel_config.status) != CONNECTED) {
LOG_WRN("Backend not yet connected to sysctrl");
return NRFS_ERR_INVALID_STATE;
}

if (size <= MAX_PACKET_DATA_SIZE) {
int err;
struct ipc_data_packet tx_data;
Expand All @@ -190,7 +189,9 @@ nrfs_err_t nrfs_backend_send_ex(void *message, size_t size, k_timeout_t timeout,
return NRFS_ERR_IPC;
}

err = k_work_submit(&backend_send_work);
if (nrfs_backend_connected()) {
err = k_work_submit(&backend_send_work);
}

return err >= 0 ? 0 : NRFS_ERR_IPC;
}
Expand Down
Loading