Skip to content

Commit 06cfdac

Browse files
committed
Reapply "ipc: move most functions to run from DRAM"
This restores commit 0e53393. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 57368e1 commit 06cfdac

File tree

5 files changed

+165
-53
lines changed

5 files changed

+165
-53
lines changed

src/include/sof/ipc/topology.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ typedef uint32_t ipc_comp;
4949
struct ipc_comp_dev;
5050
const struct comp_driver *ipc4_get_comp_drv(uint32_t module_id);
5151
struct comp_dev *ipc4_get_comp_dev(uint32_t comp_id);
52-
int ipc4_add_comp_dev(struct comp_dev *dev);
53-
const struct comp_driver *ipc4_get_drv(const void *uuid);
5452
int ipc4_chain_manager_create(struct ipc4_chain_dma *cdma);
5553
int ipc4_chain_dma_state(struct comp_dev *dev, struct ipc4_chain_dma *cdma);
5654
int ipc4_create_chain_dma(struct ipc *ipc, struct ipc4_chain_dma *cdma);

src/ipc/ipc-common.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <rtos/cache.h>
2121
#include <sof/lib/cpu.h>
2222
#include <sof/lib/mailbox.h>
23+
#include <sof/lib/memory.h>
2324
#include <sof/list.h>
2425
#include <sof/platform.h>
2526
#include <rtos/sof.h>
@@ -188,12 +189,14 @@ static void schedule_ipc_worker(void)
188189
#endif
189190
}
190191

191-
void ipc_msg_send_direct(struct ipc_msg *msg, void *data)
192+
__cold void ipc_msg_send_direct(struct ipc_msg *msg, void *data)
192193
{
193194
struct ipc *ipc = ipc_get();
194195
k_spinlock_key_t key;
195196
int ret;
196197

198+
assert_can_be_cold();
199+
197200
key = k_spin_lock(&ipc->lock);
198201

199202
/* copy mailbox data to message if not already copied */
@@ -280,8 +283,10 @@ void ipc_schedule_process(struct ipc *ipc)
280283
#endif
281284
}
282285

283-
int ipc_init(struct sof *sof)
286+
__cold int ipc_init(struct sof *sof)
284287
{
288+
assert_can_be_cold();
289+
285290
tr_dbg(&ipc_tr, "ipc_init()");
286291

287292
/* init ipc data */

src/ipc/ipc-helper.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <rtos/cache.h>
2222
#include <sof/lib/cpu.h>
2323
#include <sof/lib/mailbox.h>
24+
#include <sof/lib/memory.h>
2425
#include <sof/list.h>
2526
#include <sof/platform.h>
2627
#include <rtos/sof.h>
@@ -37,8 +38,10 @@
3738

3839
LOG_MODULE_DECLARE(ipc, CONFIG_SOF_LOG_LEVEL);
3940

40-
static bool valid_ipc_buffer_desc(const struct sof_ipc_buffer *desc)
41+
__cold static bool valid_ipc_buffer_desc(const struct sof_ipc_buffer *desc)
4142
{
43+
assert_can_be_cold();
44+
4245
if (desc->caps >= SOF_MEM_CAPS_LOWEST_INVALID)
4346
return false;
4447

@@ -47,10 +50,12 @@ static bool valid_ipc_buffer_desc(const struct sof_ipc_buffer *desc)
4750
}
4851

4952
/* create a new component in the pipeline */
50-
struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc, bool is_shared)
53+
__cold struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc, bool is_shared)
5154
{
5255
struct comp_buffer *buffer;
5356

57+
assert_can_be_cold();
58+
5459
tr_info(&buffer_tr, "buffer new size 0x%x id %d.%d flags 0x%x",
5560
desc->size, desc->comp.pipeline_id, desc->comp.id, desc->flags);
5661

@@ -75,6 +80,7 @@ struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc, bool is_shared
7580
return buffer;
7681
}
7782

83+
/* Called from multiple locations, including ipc_get_comp_by_ppl_id(), so cannot be cold */
7884
int32_t ipc_comp_pipe_id(const struct ipc_comp_dev *icd)
7985
{
8086
switch (icd->type) {
@@ -177,9 +183,11 @@ int comp_verify_params(struct comp_dev *dev, uint32_t flag,
177183
}
178184
EXPORT_SYMBOL(comp_verify_params);
179185

180-
int comp_buffer_connect(struct comp_dev *comp, uint32_t comp_core,
181-
struct comp_buffer *buffer, uint32_t dir)
186+
__cold int comp_buffer_connect(struct comp_dev *comp, uint32_t comp_core,
187+
struct comp_buffer *buffer, uint32_t dir)
182188
{
189+
assert_can_be_cold();
190+
183191
/* check if it's a connection between cores */
184192
if (buffer->core != comp_core) {
185193
#if CONFIG_INCOHERENT
@@ -258,13 +266,15 @@ int ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id)
258266
ipc_ppl_sink->cd);
259267
}
260268

261-
int ipc_comp_free(struct ipc *ipc, uint32_t comp_id)
269+
__cold int ipc_comp_free(struct ipc *ipc, uint32_t comp_id)
262270
{
263271
struct ipc_comp_dev *icd;
264272
struct comp_buffer *buffer;
265273
struct comp_buffer *safe;
266274
uint32_t flags;
267275

276+
assert_can_be_cold();
277+
268278
/* check whether component exists */
269279
icd = ipc_get_comp_by_id(ipc, comp_id);
270280
if (!icd) {

0 commit comments

Comments
 (0)