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

memory: Use cached memory for frequently used objects #527

Closed
wants to merge 1 commit into from
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
3 changes: 1 addition & 2 deletions src/drivers/intel/baytrail/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,7 @@ static int ssp_probe(struct dai *dai)
struct ssp_pdata *ssp;

/* allocate private data */
ssp = rzalloc(RZONE_SYS | RZONE_FLAG_UNCACHED, SOF_MEM_CAPS_RAM,
sizeof(*ssp));
ssp = rzalloc(RZONE_SYS, SOF_MEM_CAPS_RAM, sizeof(*ssp));
dai_set_drvdata(dai, ssp);

spinlock_init(&dai->lock);
Expand Down
3 changes: 1 addition & 2 deletions src/drivers/intel/cavs/dmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,8 +1454,7 @@ static int dmic_probe(struct dai *dai)
pm_runtime_get_sync(DMIC_CLK, dai->index);

/* allocate private data */
dmic = rzalloc(RZONE_RUNTIME | RZONE_FLAG_UNCACHED, SOF_MEM_CAPS_RAM,
sizeof(*dmic));
dmic = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM, sizeof(*dmic));
if (!dmic) {
trace_dmic_error("eap");
return -ENOMEM;
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/intel/cavs/hda-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ static int hda_dma_probe(struct dma *dma)
return -EEXIST; /* already created */

/* allocate private data */
hda_pdata = rzalloc(RZONE_RUNTIME | RZONE_FLAG_UNCACHED,
SOF_MEM_CAPS_RAM, sizeof(*hda_pdata));
hda_pdata = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM,
sizeof(*hda_pdata));
if (!hda_pdata) {
trace_error(TRACE_CLASS_DMA, "alloc failed");
return -ENOMEM;
Expand Down
3 changes: 1 addition & 2 deletions src/drivers/intel/cavs/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,7 @@ static int ssp_probe(struct dai *dai)
pm_runtime_get_sync(SSP_CLK, dai->index);

/* allocate private data */
ssp = rzalloc(RZONE_RUNTIME | RZONE_FLAG_UNCACHED, SOF_MEM_CAPS_RAM,
sizeof(*ssp));
ssp = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM, sizeof(*ssp));
if (!ssp) {
trace_error(TRACE_CLASS_DAI, "alloc failed");
return -ENOMEM;
Expand Down
3 changes: 1 addition & 2 deletions src/drivers/intel/dw-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,7 @@ static int dw_dma_probe(struct dma *dma)
pm_runtime_get_sync(DW_DMAC_CLK, dma->plat_data.id);

/* allocate private data */
dw_pdata = rzalloc(RZONE_RUNTIME | RZONE_FLAG_UNCACHED,
SOF_MEM_CAPS_RAM, sizeof(*dw_pdata));
dw_pdata = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM, sizeof(*dw_pdata));
if (!dw_pdata) {
trace_error(TRACE_CLASS_DMA, "alloc failed");
return -ENOMEM;
Expand Down
3 changes: 1 addition & 2 deletions src/drivers/intel/haswell/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,7 @@ static int ssp_probe(struct dai *dai)
struct ssp_pdata *ssp;

/* allocate private data */
ssp = rzalloc(RZONE_SYS | RZONE_FLAG_UNCACHED, SOF_MEM_CAPS_RAM,
sizeof(*ssp));
ssp = rzalloc(RZONE_SYS, SOF_MEM_CAPS_RAM, sizeof(*ssp));
dai_set_drvdata(dai, ssp);

spinlock_init(&dai->lock);
Expand Down
10 changes: 4 additions & 6 deletions src/ipc/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int ipc_comp_new(struct ipc *ipc, struct sof_ipc_comp *comp)
}

/* allocate the IPC component container */
icd = rzalloc(RZONE_RUNTIME | RZONE_FLAG_UNCACHED, SOF_MEM_CAPS_RAM,
icd = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM,
sizeof(struct ipc_comp_dev));
if (icd == NULL) {
trace_ipc_error("eCm");
Expand Down Expand Up @@ -175,7 +175,7 @@ int ipc_buffer_new(struct ipc *ipc, struct sof_ipc_buffer *desc)
return -ENOMEM;
}

ibd = rzalloc(RZONE_RUNTIME | RZONE_FLAG_UNCACHED, SOF_MEM_CAPS_RAM,
ibd = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM,
sizeof(struct ipc_comp_dev));
if (ibd == NULL) {
rfree(buffer);
Expand Down Expand Up @@ -280,13 +280,12 @@ int ipc_pipeline_new(struct ipc *ipc,
}

/* allocate the IPC pipeline container */
ipc_pipe = rzalloc(RZONE_RUNTIME | RZONE_FLAG_UNCACHED,
ipc_pipe = rzalloc(RZONE_RUNTIME,
SOF_MEM_CAPS_RAM, sizeof(struct ipc_comp_dev));
if (ipc_pipe == NULL) {
pipeline_free(pipe);
return -ENOMEM;
}

ipc_pipe->pipeline = pipe;
ipc_pipe->type = COMP_TYPE_PIPELINE;

Expand Down Expand Up @@ -530,8 +529,7 @@ int ipc_init(struct sof *sof)

spinlock_init(&sof->ipc->lock);

sof->ipc->shared_ctx = rzalloc(RZONE_SYS | RZONE_FLAG_UNCACHED,
SOF_MEM_CAPS_RAM,
sof->ipc->shared_ctx = rzalloc(RZONE_SYS, SOF_MEM_CAPS_RAM,
sizeof(*sof->ipc->shared_ctx));

dcache_writeback_region(sof->ipc, sizeof(*sof->ipc));
Expand Down
3 changes: 1 addition & 2 deletions src/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ void clock_init(void)
{
int i = 0;

clk_pdata = rmalloc(RZONE_SYS | RZONE_FLAG_UNCACHED, SOF_MEM_CAPS_RAM,
sizeof(*clk_pdata));
clk_pdata = rmalloc(RZONE_SYS, SOF_MEM_CAPS_RAM, sizeof(*clk_pdata));

/* set defaults */
for (i = 0; i < PLATFORM_CORE_COUNT; i++) {
Expand Down
3 changes: 1 addition & 2 deletions src/lib/work.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,7 @@ void init_system_workq(struct work_queue_timesource *ts)
*queue = work_new_queue(ts);

if (cpu_get_id() == PLATFORM_MASTER_CORE_ID) {
work_shared_ctx = rzalloc(RZONE_SYS | RZONE_FLAG_UNCACHED,
SOF_MEM_CAPS_RAM,
work_shared_ctx = rzalloc(RZONE_SYS, SOF_MEM_CAPS_RAM,
sizeof(*work_shared_ctx));
atomic_init(&work_shared_ctx->total_num_work, 0);
atomic_init(&work_shared_ctx->timer_clients, 0);
Expand Down