Skip to content

Conversation

@serhiy-katsyuba-intel
Copy link
Contributor

There are few problems with the invalidate call here:

struct sof_ipc_cmd_hdr belongs to IPC3. There is no 'size' field in IPC4 payload at that offset. comp_data is zeroed on init and on IPC4 it is only used to send responses by get_large_config. Probably get_large_config is rarely used as, otherwise, that would result in invalidates of dcache with weird sizes and problems at runtime.

I do not see any point to invalidate dcache here. It's definitely not needed for IPC4. Not an expert in IPC3, however, it seems IPC3 does not need such code either.

@serhiy-katsyuba-intel
Copy link
Contributor Author

@lyakh , @kv2019i, there is a tiny possibility that the removed invalidate is needed for some IPC3 use case I'm unaware of. In such case I can redo to use #ifdef CONFIG_IPC_MAJOR_3 instead of removal. Please have a look.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Ack - not needed for IPC3. Looks like we need this for v2.14 too.
@lyakh fyi.

dcache_invalidate_region((__sparse_force void __sparse_cache *)MAILBOX_HOSTBOX_BASE,
((struct sof_ipc_cmd_hdr *)ipc->comp_data)->size);

/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would add this under #ifndef IPC4 .. to avoid any issues with IPC3.

Copy link
Collaborator

Choose a reason for hiding this comment

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

actually, do any IPC3 users use multicore? Obviously this only affects secondary core execution

Copy link
Member

Choose a reason for hiding this comment

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

Good point! Mediatek and AMD uses single core, not sure about NXP

Copy link
Collaborator

@softwarecki softwarecki left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@abonislawski abonislawski left a comment

Choose a reason for hiding this comment

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

Is there a CI coverage on any IPC3 platform?

@lyakh
Copy link
Collaborator

lyakh commented Oct 14, 2025

Is there a CI coverage on any IPC3 platform?

@abonislawski not by jenkins AFAIK, I suppose same with QB?

@abonislawski
Copy link
Member

Yes, same situation with QB

@kv2019i
Copy link
Collaborator

kv2019i commented Oct 16, 2025

Maybe ask the original author when we still can. :) @lyakh , seems this was added in your commit 8e8016de02ceb8637857148a348ab4ab42bfe7e in 2021.

NXP does have multicore xtensa platforms, although not sure if these are used specifically with SOF, but in general, I don't see we can make general assumption about no multicore support with IPC3. Given @dbaluta and team is only one who can test, if he prefers an ifdef and keep this code, I'd keep it (unless Guennadi comes back and says this code can be removed).

@dbaluta
Copy link
Collaborator

dbaluta commented Oct 16, 2025

Wkl

NXP does have multicore xtensa platforms, although not sure if these are used specifically with SOF, but in general, I don't see we can make general assumption about no multicore support with IPC3. Given @dbaluta and team is only one who can test, if he prefers an ifdef and keep this code, I'd keep it (unless Guennadi comes back and says this code can be removed).

I would prefer a define there. We are only running single core on Xtensa as of now.

@serhiy-katsyuba-intel
Copy link
Contributor Author

Pushed the new version with invalidate enclosed in #if !CONFIG_IPC_MAJOR_4 instead of removal.

@lyakh
Copy link
Collaborator

lyakh commented Oct 17, 2025

Maybe ask the original author when we still can. :) @lyakh , seems this was added in your commit 8e8016de02ceb8637857148a348ab4ab42bfe7e in 2021.

well, I suppose that was added by me back in IPC3 times and was simply not caught when extending for IPC4? I see IPC4 originating from mid 2021 too, so I probably wasn't working with it back then yet

struct sof_ipc_cmd_hdr belongs to IPC3. There is no 'size' field in IPC4
payload at that offset. comp_data is zeroed on init and on IPC4 it is only
used to send responses by get_large_config. Probably get_large_config is
rarely used as, otherwise, that would result in invalidates of dcache with
weird sizes and problems at runtime.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
@kv2019i kv2019i merged commit 5a37bcb into thesofproject:main Oct 17, 2025
37 of 45 checks passed
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.

8 participants