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

platform: imx: Fix PLATFORM_DCACHE_ALIGN #3602

Merged
merged 1 commit into from Nov 16, 2020

Conversation

dbaluta
Copy link
Collaborator

@dbaluta dbaluta commented Nov 11, 2020

At this point PLATFORM_DCACHE_ALIGN is equal with DCACHE_LINE_SIZE
which on i.MX boards is 128.

Functions like rmalloc and rzalloc are allocating memory aligned at
PLATFORM_DCACHE_ALIGN bytes. This means that blocks under 128 bytes
are not really used and blocks sized > 128 are preffered for small
allocations.

This seems to be an unnecessary overhead which results in SOF not
being abel to allocate memory for simple pipelines (e.g simple
pipeline with a mixer).

For this reason, we set PLATFORM_DCACHE_ALIGN to a smaller value
(sizeof(void*)) but keep HEAP_BUF_ALIGNMENT unchanged.

Signed-off-by: Daniel Baluta daniel.baluta@nxp.com

At this point PLATFORM_DCACHE_ALIGN is equal with DCACHE_LINE_SIZE
which on i.MX boards is 128.

Functions like rmalloc and rzalloc are allocating memory aligned at
PLATFORM_DCACHE_ALIGN bytes. This means that blocks under 128 bytes
are not really used and blocks sized > 128 are preffered for small
allocations.

This seems to be an unnecessary overhead which results in SOF not
being abel to allocate memory for simple pipelines (e.g simple
pipeline with a mixer).

For this reason, we set PLATFORM_DCACHE_ALIGN to a smaller value
(sizeof(void*)) but keep HEAP_BUF_ALIGNMENT unchanged.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
@@ -14,7 +14,7 @@


/* data cache line alignment */
#define PLATFORM_DCACHE_ALIGN DCACHE_LINE_SIZE
#define PLATFORM_DCACHE_ALIGN sizeof(void *)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this build properly? This header might possibly be included by stuff that isn't C code I think...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@paulstelian97 thanks Paul very good point! This builds properly! You can see that only HEAP_BUF_ALIGNMENT is used from non C code (e.g linker files). This is also the way intel non-cavs platforms are handling the alignment.

@dbaluta
Copy link
Collaborator Author

dbaluta commented Nov 12, 2020

@lgirdwood if you want you may approve this but please do not merge it. While this fixes our problems on sof-imx-stable-v1.5, i see some errors on master branch.

I will merge this PR once I figure out what's happening.

@dbaluta
Copy link
Collaborator Author

dbaluta commented Nov 14, 2020

@lgirdwood this is good to merge. the problem was with the topology file and the mixer. It looks like there is something very fishy with the mixer :)

@lgirdwood lgirdwood merged commit 8354454 into thesofproject:master Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants