Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/arch/xtensa/lib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void alloc_shared_secondary_cores_objects(void)
{
uint8_t *dynamic_vectors;

dynamic_vectors = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, 0, SOF_DYNAMIC_VECTORS_SIZE);
dynamic_vectors = rballoc(SOF_MEM_FLAG_COHERENT, 0, SOF_DYNAMIC_VECTORS_SIZE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be good to explain why. Just because it's a relatively large allocation of 1K?

if (dynamic_vectors == NULL)
panic(SOF_IPC_PANIC_MEM);

Expand Down
4 changes: 2 additions & 2 deletions src/audio/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t align)
}

/* allocate new buffer */
buffer = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
buffer = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I'm totally confused now. I thought rballoc() was only for audio buffers. Then some other uses cropped in. Now you're suggesting even more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I'm totally confused now. I thought rballoc() was only for audio buffers. Then some other uses cropped in. Now you're suggesting even more.

It is just replacement here, as we will remove the RUNTIME_SHARED zone thoroughly in the subsequent commits.

The naming is not so important to me, for the allocator, it doesn't know about what the required buffer will be used for, @lgirdwood asked me to do a "Part 5" to unify the rxxalloc() helpers, at that time we will have only e.g. rmalloc() and rzalloc(), and the allocator internal will decide where (which zone) it will allocate the required buffer on.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh direction of travel is simplification of allocator to align with Zephyr

sizeof(*buffer));
if (!buffer) {
tr_err(&buffer_tr, "buffer_alloc(): could not alloc structure");
return NULL;
}

buffer->lock = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
buffer->lock = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(*buffer->lock));
if (!buffer->lock) {
rfree(buffer);
Expand Down
2 changes: 1 addition & 1 deletion src/audio/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static struct comp_dev *dai_new(const struct comp_driver *drv,
return NULL;
dev->ipc_config = *config;

dd = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*dd));
dd = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*dd));
if (!dd) {
rfree(dev);
return NULL;
Expand Down
3 changes: 2 additions & 1 deletion src/audio/mux/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ static struct comp_dev *mux_new(const struct comp_driver *drv,
return NULL;
dev->ipc_config = *config;

cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
/* allocate quite a big buffer, use rballoc to make sure it will succeed */
cd = rballoc(0, SOF_MEM_CAPS_RAM,
sizeof(*cd) + MUX_MAX_STREAMS * sizeof(struct mux_stream_data));
if (!cd) {
rfree(dev);
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/dw/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ static int dw_dma_probe(struct dma *dma)
pm_runtime_get_sync(DW_DMAC_CLK, dma->plat_data.id);

/* allocate dma channels */
dma->chan = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
dma->chan = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct dma_chan_data) * dma->plat_data.channels);

if (!dma->chan) {
Expand All @@ -987,7 +987,7 @@ static int dw_dma_probe(struct dma *dma)
chan->index = i;
chan->core = DMA_CORE_INVALID;

dw_chan = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
dw_chan = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(*dw_chan));

if (!dw_chan) {
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/generic/dummy-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ static int dummy_dma_probe(struct dma *dma)
return -EEXIST; /* already created */
}

dma->chan = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
dma->chan = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
dma->plat_data.channels * sizeof(dma->chan[0]));
if (!dma->chan) {
tr_err(&ddma_tr, "dummy-dmac %d: Out of memory!",
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/imx/esai.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static int esai_probe(struct dai *dai)
dai_err(dai, "ESAI: Repeated probe, skipping");
return -EEXIST;
}
pdata = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*pdata));
pdata = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*pdata));
if (!pdata) {
dai_err(dai, "ESAI probe failure, out of memory");
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/imx/sai.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ static int sai_probe(struct dai *dai)
dai_info(dai, "SAI: sai_probe");

/* allocate private data */
sai = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*sai));
sai = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*sai));
if (!sai) {
dai_err(dai, "sai_probe(): alloc failed");
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/alh.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static int alh_probe(struct dai *dai)
if (dai_get_drvdata(dai))
return -EEXIST;

alh = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*alh));
alh = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*alh));
if (!alh) {
dai_err(dai, "alh_probe() error: alloc failed");
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/baytrail/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ static int ssp_probe(struct dai *dai)
struct ssp_pdata *ssp;

/* allocate private data */
ssp = rzalloc(SOF_MEM_ZONE_SYS_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*ssp));
ssp = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*ssp));
dai_set_drvdata(dai, ssp);

ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_READY;
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/dmic/dmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ static int dmic_probe(struct dai *dai)
if (dai_get_drvdata(dai))
return -EEXIST; /* already created */

dmic = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*dmic));
dmic = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*dmic));
if (!dmic) {
dai_err(dai, "dmic_probe(): alloc failed");
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/haswell/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ static int ssp_probe(struct dai *dai)
struct ssp_pdata *ssp;

/* allocate private data */
ssp = rzalloc(SOF_MEM_ZONE_SYS_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*ssp));
ssp = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*ssp));
dai_set_drvdata(dai, ssp);

ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_READY;
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/intel/hda/hda-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ static int hda_dma_probe(struct dma *dma)
if (dma->chan)
return -EEXIST; /* already created */

dma->chan = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
dma->chan = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct dma_chan_data) * dma->plat_data.channels);

if (!dma->chan) {
Expand All @@ -804,7 +804,7 @@ static int hda_dma_probe(struct dma *dma)
chan->status = COMP_STATE_INIT;
chan->core = DMA_CORE_INVALID;

hda_chan = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0,
hda_chan = rballoc(SOF_MEM_FLAG_COHERENT,
SOF_MEM_CAPS_RAM,
sizeof(struct hda_chan_data));
if (!hda_chan) {
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/hda/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static int hda_probe(struct dai *dai)
if (dai_get_drvdata(dai))
return -EEXIST;

hda = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*hda));
hda = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*hda));
if (!hda) {
dai_err(dai, "hda_probe() error: alloc failed");
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/ssp/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ static int ssp_probe(struct dai *dai)
return -EEXIST; /* already created */

/* allocate private data */
ssp = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*ssp));
ssp = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*ssp));
if (!ssp) {
dai_err(dai, "ssp_probe(): alloc failed");
return -ENOMEM;
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int interrupt_cascade_register(const struct irq_cascade_tmpl *tmpl)

}

*cascade = rzalloc(SOF_MEM_ZONE_SYS_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(**cascade));
*cascade = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(**cascade));

spinlock_init(&(*cascade)->lock);

Expand Down Expand Up @@ -204,7 +204,7 @@ static int irq_register_child(struct irq_cascade_desc *cascade, int irq,
/* init child from run-time, may be registered and unregistered
* many times at run-time
*/
child = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
child = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct irq_desc));
if (!child) {
ret = -ENOMEM;
Expand Down
6 changes: 3 additions & 3 deletions src/drivers/mediatek/mt8195/afe-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ int afe_probe(struct mtk_base_afe *afe)
tr_dbg(&afedrv_tr, "afe_base:0x%x\n", afe->base);
/* TODO how to get the memif number, how to sync with dmac lib */
afe->memifs_size = platform->memif_size;
afe->memif = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
afe->memif = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct mtk_base_afe_memif) * afe->memifs_size);
if (!afe->memif)
return -ENOMEM;
Expand All @@ -362,14 +362,14 @@ int afe_probe(struct mtk_base_afe *afe)

/* TODO how to get the dai number, how to sync with dai lib*/
afe->dais_size = platform->dais_size;
afe->dais = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
afe->dais = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct mtk_base_afe_dai) * afe->dais_size);
if (!afe->dais)
goto err_alloc_memif;

/* TODO how to get the irq number */
afe->irqs_size = platform->irqs_size;
afe->irqs = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
afe->irqs = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct mtk_base_afe_irq) * afe->irqs_size);
if (!afe->irqs)
goto err_alloc_dais;
Expand Down
4 changes: 2 additions & 2 deletions src/include/sof/ipc/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ static inline struct ipc_msg *ipc_msg_init(uint32_t header, uint32_t size)
{
struct ipc_msg *msg;

msg = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*msg));
msg = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*msg));
if (!msg)
return NULL;

msg->tx_data = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, size);
msg->tx_data = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, size);
if (!msg->tx_data) {
rfree(msg);
return NULL;
Expand Down
4 changes: 2 additions & 2 deletions src/include/sof/lib/alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ enum mem_zone {
SOF_MEM_ZONE_SYS_RUNTIME, /**< System-runtime zone */
SOF_MEM_ZONE_RUNTIME, /**< Runtime zone */
SOF_MEM_ZONE_BUFFER, /**< Buffer zone */
SOF_MEM_ZONE_RUNTIME_SHARED, /**< Runtime shared zone */
SOF_MEM_ZONE_SYS_SHARED, /**< System shared zone */
};

Expand Down Expand Up @@ -94,7 +93,8 @@ void *rmalloc(enum mem_zone zone, uint32_t flags, uint32_t caps, size_t bytes);
void *rzalloc(enum mem_zone zone, uint32_t flags, uint32_t caps, size_t bytes);

/**
* Allocates memory block from SOF_MEM_ZONE_BUFFER.
* Allocates memory block from SOF_MEM_ZONE_BUFFER,
* the allocated buffer will be initialized to 0s.
* @param flags Flags, see SOF_MEM_FLAG_...
* @param caps Capabilities, see SOF_MEM_CAPS_...
* @param bytes Size in bytes.
Expand Down
6 changes: 0 additions & 6 deletions src/include/sof/lib/mm_heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ struct mm {
struct mm_heap system[PLATFORM_HEAP_SYSTEM];
/* system runtime heap - used for runtime system components */
struct mm_heap system_runtime[PLATFORM_HEAP_SYSTEM_RUNTIME];
#if CONFIG_CORE_COUNT > 1
/* object shared between different cores - used during init cannot be freed */
struct mm_heap system_shared[PLATFORM_HEAP_SYSTEM_SHARED];
/* object shared between different cores */
struct mm_heap runtime_shared[PLATFORM_HEAP_RUNTIME_SHARED];
#endif
/* general heap for components */
struct mm_heap runtime[PLATFORM_HEAP_RUNTIME];
/* general component buffer heap */
Expand Down
2 changes: 1 addition & 1 deletion src/include/sof/schedule/ll_schedule_domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static inline struct ll_schedule_domain *domain_init
{
struct ll_schedule_domain *domain;

domain = rzalloc(SOF_MEM_ZONE_SYS_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*domain));
domain = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*domain));
domain->type = type;
domain->clk = clk;
domain->synchronous = synchronous;
Expand Down
4 changes: 2 additions & 2 deletions src/ipc/ipc-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ int ipc_init(struct sof *sof)
tr_info(&ipc_tr, "ipc_init()");

/* init ipc data */
sof->ipc = rzalloc(SOF_MEM_ZONE_SYS_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*sof->ipc));
sof->ipc->comp_data = rzalloc(SOF_MEM_ZONE_SYS_SHARED, 0,
sof->ipc = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*sof->ipc));
sof->ipc->comp_data = rballoc(SOF_MEM_FLAG_COHERENT,
SOF_MEM_CAPS_RAM, SOF_IPC_MSG_MAX_SIZE);

spinlock_init(&sof->ipc->lock);
Expand Down
2 changes: 1 addition & 1 deletion src/ipc/ipc3/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ int dai_config(struct comp_dev *dev, struct ipc_config_dai *common_config,

/* allocated dai_config if not yet */
if (!dd->dai_spec_config) {
dd->dai_spec_config = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
dd->dai_spec_config = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct sof_ipc_dai_config));
if (!dd->dai_spec_config) {
comp_err(dev, "dai_config(): No memory for dai_config.");
Expand Down
15 changes: 1 addition & 14 deletions src/ipc/ipc3/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,18 +1368,11 @@ static int fill_mem_usage_elems(enum mem_zone zone, enum sof_ipc_dbg_mem_zone ip
return elem_number;
}

#if CONFIG_CORE_COUNT > 1
#define PLATFORM_HEAP_SYSTEM_SHARED_CNT (PLATFORM_HEAP_SYSTEM_SHARED + PLATFORM_HEAP_RUNTIME_SHARED)
#else
#define PLATFORM_HEAP_SYSTEM_SHARED_CNT 0
#endif

static int ipc_glb_test_mem_usage(uint32_t header)
{
/* count number heaps */
int elem_cnt = PLATFORM_HEAP_SYSTEM + PLATFORM_HEAP_SYSTEM_RUNTIME +
PLATFORM_HEAP_RUNTIME + PLATFORM_HEAP_BUFFER +
PLATFORM_HEAP_SYSTEM_SHARED_CNT;
PLATFORM_HEAP_RUNTIME + PLATFORM_HEAP_BUFFER;
size_t size = sizeof(struct sof_ipc_dbg_mem_usage) +
elem_cnt * sizeof(struct sof_ipc_dbg_mem_usage_elem);
struct sof_ipc_dbg_mem_usage_elem *elems;
Expand All @@ -1404,12 +1397,6 @@ static int ipc_glb_test_mem_usage(uint32_t header)
/* cppcheck-suppress unreadVariable */
elems += fill_mem_usage_elems(SOF_MEM_ZONE_BUFFER, SOF_IPC_MEM_ZONE_BUFFER,
PLATFORM_HEAP_BUFFER, elems);
#if CONFIG_CORE_COUNT > 1
elems += fill_mem_usage_elems(SOF_MEM_ZONE_SYS_SHARED, SOF_IPC_MEM_ZONE_SYS_SHARED,
PLATFORM_HEAP_SYSTEM_SHARED, elems);
elems += fill_mem_usage_elems(SOF_MEM_ZONE_RUNTIME_SHARED, SOF_IPC_MEM_ZONE_RUNTIME_SHARED,
PLATFORM_HEAP_RUNTIME_SHARED, elems);
#endif

/* write component values to the outbox */
mailbox_hostbox_write(0, mem_usage, mem_usage->rhdr.hdr.size);
Expand Down
6 changes: 3 additions & 3 deletions src/ipc/ipc3/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ int ipc_pipeline_new(struct ipc *ipc, ipc_pipe_new *_pipe_desc)
}

/* allocate the IPC pipeline container */
ipc_pipe = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
ipc_pipe = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct ipc_comp_dev));
if (!ipc_pipe) {
pipeline_free(pipe);
Expand Down Expand Up @@ -431,7 +431,7 @@ int ipc_buffer_new(struct ipc *ipc, const struct sof_ipc_buffer *desc)
return -ENOMEM;
}

ibd = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
ibd = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct ipc_comp_dev));
if (!ibd) {
buffer_free(buffer);
Expand Down Expand Up @@ -639,7 +639,7 @@ int ipc_comp_new(struct ipc *ipc, ipc_comp *_comp)
}

/* allocate the IPC component container */
icd = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
icd = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct ipc_comp_dev));
if (!icd) {
tr_err(&ipc_tr, "ipc_comp_new(): alloc failed");
Expand Down
4 changes: 2 additions & 2 deletions src/ipc/ipc4/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int ipc_pipeline_new(struct ipc *ipc, ipc_pipe_new *_pipe_desc)
pipe->period = 1000;

/* allocate the IPC pipeline container */
ipc_pipe = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
ipc_pipe = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct ipc_comp_dev));
if (!ipc_pipe) {
pipeline_free(pipe);
Expand Down Expand Up @@ -393,7 +393,7 @@ int ipc4_add_comp_dev(struct comp_dev *dev)
struct ipc_comp_dev *icd;

/* allocate the IPC component container */
icd = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
icd = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM,
sizeof(struct ipc_comp_dev));
if (!icd) {
tr_err(&ipc_tr, "ipc_comp_new(): alloc failed");
Expand Down
2 changes: 1 addition & 1 deletion src/lib/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void sa_init(struct sof *sof, uint64_t timeout)
else
tr_info(&sa_tr, "sa_init(), timeout = %u", (unsigned int)timeout);

sof->sa = rzalloc(SOF_MEM_ZONE_SYS_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*sof->sa));
sof->sa = rballoc(SOF_MEM_FLAG_COHERENT, SOF_MEM_CAPS_RAM, sizeof(*sof->sa));

/* set default timeouts */
#ifdef __ZEPHYR__
Expand Down
Loading