Skip to content

copier: fix allocation and configuration size#6930

Merged
kv2019i merged 4 commits into
thesofproject:mainfrom
lyakh:copier-var
Jan 18, 2023
Merged

copier: fix allocation and configuration size#6930
kv2019i merged 4 commits into
thesofproject:mainfrom
lyakh:copier-var

Conversation

@lyakh
Copy link
Copy Markdown
Collaborator

@lyakh lyakh commented Jan 10, 2023

Copier configuration size must include the variable size array in struct ipc4_copier_gateway_cfg.

@RanderWang
Copy link
Copy Markdown
Collaborator

RanderWang commented Jan 11, 2023

@lyakh Now copier doesn't save gateway config (blob data) in variable array since it is a little huge like DMIC blob. Why do we need to save it ? These blob data is sent to dai directly from memory windows

@lyakh
Copy link
Copy Markdown
Collaborator Author

lyakh commented Jan 11, 2023

@lyakh Now copier doesn't save gateway config (blob data) in variable array since it is a little huge like DMIC blob. Why do we need to save it ? These blob data is sent to dai directly from memory windows

@RanderWang ah, so it is on purpose? Ok, then we need an explanation there, I'll add a comment. And we don't need that cache-invalidation, I'll remove it. And in principle this PR isn't wrong, right? So it is strange why it's causing PR failures. I'll investigate that.

Comment thread src/include/ipc4/copier.h Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder how did this work until now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wonder why this passed build ? @lyakh have you been able to build this with GCC ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@dbaluta as @RanderWang explained, it wasn't used. And indeed in some cases that array is large, and if we don't need to keep that configuration, it's ok to not do so, but then we need to make it explicit in the code.
@lgirdwood sure, it builds both ways, because that array isn't declared as variable size, it's declared as size 1 because of problems with some compilers I guess

Copy link
Copy Markdown
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.

@mwasko some fixes that may be needed for mtl03

Comment thread src/include/ipc4/copier.h Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wonder why this passed build ? @lyakh have you been able to build this with GCC ?

@mwasko
Copy link
Copy Markdown
Contributor

mwasko commented Jan 12, 2023

@mwasko some fixes that may be needed for mtl03

I think MTL-003 has already been announced but I will let know the team to take a look at this.

@lyakh lyakh marked this pull request as ready for review January 13, 2023 11:47
@lyakh
Copy link
Copy Markdown
Collaborator Author

lyakh commented Jan 13, 2023

Now this PR is causing CI failures like https://sof-ci.01.org/sofpr/PR6930/build3364/devicetest/index.html?model=TGLU_RVP_NOCODEC_IPC4ZPH&testcase=check-capture-3times but I think it isn't the fault of this PR that those tests are now failing, it is because it's fixing something. E.g. in the SSP case I narrowed down the failure to calling dai_ssp_get_properties() - before this PR this function wasn't called, because pipeline_comp_trigger() wasn't using the correct pointer to the DAI. Now the pointer is correct and the function is called. And although the function's name has a "get" in it, it has a side effect... It initialises the SSP properties structure. Same is done with HDA and SDW. So, I think, parameters, that were set during DAI configuration now get reset to initial values. @juimonen do you know what's the right fix for this?

Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Code looks good. Not approving until the issue found by CI is sorted out.

@lyakh lyakh force-pushed the copier-var branch 2 times, most recently from f27ab70 to 9870206 Compare January 16, 2023 15:57
@lyakh
Copy link
Copy Markdown
Collaborator Author

lyakh commented Jan 17, 2023

lyakh added 4 commits January 17, 2023 10:17
Some DAI types share properties objects between playback and capture
directions and write to them and read from them with no locking. Add
a DAI spinlock to protect them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
rtos/interrupt.h is included twice in dai-zephyr.c, remove one copy.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
With IPC4 the top level component that receives trigger events is a
copier and not the associated with it DAI. We need to retrieve the
DAI device pointer for its timing parameters.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
No need to invalidate cache again - comp_new() already has done it.
Also document why we don't need to copy config_data[] and use
memcpy() directly instead of mailbox_hostbox_read() - we already have
a pointer and cached have been invalidated already.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@kv2019i kv2019i merged commit 4cc9d54 into thesofproject:main Jan 18, 2023
@lyakh lyakh deleted the copier-var branch January 18, 2023 14:42
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.

6 participants