Skip to content

Drivers: Intel: DMIC: Re-arrange DMIC DAI component data - #4299

Merged
lgirdwood merged 3 commits into
thesofproject:mainfrom
singalsu:dmic_cleanup_component_data
Jun 16, 2021
Merged

lgirdwood merged 3 commits into
thesofproject:mainfrom
singalsu:dmic_cleanup_component_data

Conversation

@singalsu

@singalsu singalsu commented Jun 4, 2021 •

Copy link
Copy Markdown
Collaborator

This patch separates the component data to private and global
parts and cleans up the explicit un-cache code from previous
version.

Since the dmic_prm[] struct is fixed length it does not need to
be allocated dynamically. It simplifies a lot the parameters
handling and sharing.

Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com

@singalsu
singalsu force-pushed the dmic_cleanup_component_data branch 3 times, most recently from 89c58bc to b5d0394 Compare June 4, 2021 17:36
@singalsu singalsu changed the title [WIP] Drivers: Intel: DMIC: Cleanup component data [WIP] Drivers: Intel: DMIC: Re-arrange DMIC DAI component data Jun 4, 2021
Comment thread src/drivers/intel/dmic.c Resolved
Comment thread src/drivers/intel/dmic.c Resolved
@singalsu
singalsu force-pushed the dmic_cleanup_component_data branch from b5d0394 to a90f747 Compare June 7, 2021 11:28
@singalsu
singalsu requested a review from lyakh June 7, 2021 11:48
Comment thread src/drivers/intel/dmic.c Resolved
Comment thread src/drivers/intel/dmic.c Resolved
Comment thread src/include/sof/drivers/dmic.h Resolved
Comment thread src/drivers/intel/dmic.c Resolved
Comment thread src/drivers/intel/dmic.c Resolved
Comment thread src/drivers/intel/dmic.c 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.

@singalsu One downside is that this memory cannot be freed even if all dmic pipelines are stopped (unless we get dynamic module loading in the future). But this is ~100 bytes, so maybe something that can be optimized later.

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.

There will be the NHLT blob that is 4 kB so that at least should be dynamically allocated. I'd like to see the issue #4175 to be fixed by this PR. I'll bring back dynamic allocate in the NHLT PR #4025.

@lgirdwood lgirdwood left a comment

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.

I also assume here there is no regression in stability ?

Comment thread src/include/sof/drivers/dmic.h Resolved
@singalsu
singalsu force-pushed the dmic_cleanup_component_data branch from a90f747 to 657a453 Compare June 9, 2021 08:38
Comment thread src/include/sof/drivers/dmic.h Resolved
@singalsu
singalsu force-pushed the dmic_cleanup_component_data branch from 657a453 to c8d9fa1 Compare June 9, 2021 13:27
@singalsu singalsu changed the title [WIP] Drivers: Intel: DMIC: Re-arrange DMIC DAI component data Drivers: Intel: DMIC: Re-arrange DMIC DAI component data Jun 9, 2021
@singalsu
singalsu marked this pull request as ready for review June 9, 2021 14:32

@lgirdwood lgirdwood left a comment

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.

@singalsu I think we are all coming to the conclusion to put everything in uncache.

@singalsu

singalsu commented Jun 9, 2021 •

Copy link
Copy Markdown
Collaborator Author

@singalsu I think we are all coming to the conclusion to put everything in uncache.

@lgirdwood The two alloc() done in dmic_probe() are to SOF_MEM_ZONE_RUNTIME_SHARED. Is that sufficient?

Comment thread src/drivers/intel/dmic.c Resolved
singalsu added 3 commits June 16, 2021 13:24
This patch collects the global DMIC driver parameters into single
struct. The pointer global in every DMIC DAI instance points into
the same data. All access from functions happens via the pointer
that simplifies the next step to add NHLT binary data configuration
for the driver.

The previous dmic_prm[] is no more allocated dynamically since the
single data structure is fixed size and not large. It simplifies the
driver code that handles the multiple ownership.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Previously the gain ramp updates were executed in core 0 only even
if rest of driver was executed in other core. It caused issues with
driver state variables in cached memory.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch only removes some unnecessary line feeds for better
readability.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
singalsu requested review from lgirdwood and lyakh June 16, 2021 12:04
@singalsu
singalsu force-pushed the dmic_cleanup_component_data branch from c8d9fa1 to c72d2c7 Compare June 16, 2021 12:05
@singalsu

Copy link
Copy Markdown
Collaborator Author

I've split the PR to 3 commits. The fist contains most of the changes. Previously I forgot to mention in commit text that dmic_work() runs on the same core as driver as result of 2nd commit (it was needed to make it work for cached data, now I think it could run on core 0 always but I think this makes more sense). 3rd commit is just cosmetic.

@lgirdwood
lgirdwood merged commit b6208b8 into thesofproject:main Jun 16, 2021
@singalsu
singalsu deleted the dmic_cleanup_component_data branch July 21, 2021 12:03
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.

4 participants