Skip to content

Commit 80cc9c9

Browse files
committed
ipc: move the IPC sending work queue to global context
Make the IPC sending work queue available to other IPC parts by moving it to the global IPC context. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 68b51b4 commit 80cc9c9

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/include/sof/ipc/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct ipc {
8282

8383
#ifdef __ZEPHYR__
8484
struct k_work_delayable z_delayed_work;
85+
struct k_work_q ipc_send_wq;
8586
#endif
8687

8788
void *private;

src/ipc/ipc-common.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ void ipc_send_queued_msg(void)
171171
}
172172

173173
#ifdef __ZEPHYR__
174-
static struct k_work_q ipc_send_wq;
175174
static K_THREAD_STACK_DEFINE(ipc_send_wq_stack, CONFIG_STACK_SIZE_IPC_TX);
176175
#endif
177176

@@ -184,7 +183,7 @@ static void schedule_ipc_worker(void)
184183
#ifdef __ZEPHYR__
185184
struct ipc *ipc = ipc_get();
186185

187-
k_work_schedule_for_queue(&ipc_send_wq, &ipc->z_delayed_work, K_USEC(IPC_PERIOD_USEC));
186+
k_work_schedule_for_queue(&ipc->ipc_send_wq, &ipc->z_delayed_work, K_USEC(IPC_PERIOD_USEC));
188187
#endif
189188
}
190189

@@ -306,12 +305,10 @@ int ipc_init(struct sof *sof)
306305
#endif
307306

308307
#ifdef __ZEPHYR__
309-
struct k_thread *thread = &ipc_send_wq.thread;
308+
struct k_thread *thread = &sof->ipc->ipc_send_wq.thread;
310309

311-
k_work_queue_start(&ipc_send_wq,
312-
ipc_send_wq_stack,
313-
K_THREAD_STACK_SIZEOF(ipc_send_wq_stack),
314-
1, NULL);
310+
k_work_queue_start(&sof->ipc->ipc_send_wq, ipc_send_wq_stack,
311+
K_THREAD_STACK_SIZEOF(ipc_send_wq_stack), 1, NULL);
315312

316313
k_thread_suspend(thread);
317314

0 commit comments

Comments
 (0)