Skip to content

ASoC: SOF: DMIC: Fixed length IPC - #1924

Merged
kv2019i merged 3 commits into
thesofproject:topic/sof-devfrom
singalsu:dmic_fixed_length_ipc
Apr 9, 2020
Merged

ASoC: SOF: DMIC: Fixed length IPC#1924
kv2019i merged 3 commits into
thesofproject:topic/sof-devfrom
singalsu:dmic_fixed_length_ipc

Conversation

@singalsu

Copy link
Copy Markdown
Collaborator

No description provided.

@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

The similar PR for firmware would increase ABI minor to 15. Since the ABI minor for current kernel is behind by one this would increase ABI minor to 14 that is not consistent. Probably the feature from firmware should be merged first to get to version 14 and have 15 on both sides with this merged.

I've tested this with all combinations of new/new, new/old, old/new for kernel and FW on UP2+DMIC kit and no issues seen.

@plbossartplbossart 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.

minor comments, looks good otherwise.
Need to align on ABI change, there are already two changes competing for ABI 15.

Comment threadsound/soc/sof/topology.c Outdated
Comment threadinclude/sound/sof/dai-intel.h Outdated
Comment threadinclude/sound/sof/dai-intel.h
Comment threadinclude/sound/sof/dai-intel.h Outdated
@singalsusingalsu added the ABI involves ABI changes, need extra attention label Mar 23, 2020
@singalsu
singalsuforce-pushed the dmic_fixed_length_ipc branch from 97c2fb4 to f9a84c5CompareMarch 23, 2020 17:41

@ranj063ranj063 left a comment

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 but for the one change in comment as requested by Pierre, the patch looks good. Thanks!

Comment threadinclude/uapi/sound/sof/abi.h Outdated
Comment threadsound/soc/sof/topology.c Outdated
Comment threadsound/soc/sof/topology.c Outdated
Comment threadsound/soc/sof/topology.c

@kv2019ikv2019i left a comment

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.

Thanks @singalsu Minor comments to documentation, and we need to clarify what is the right ABI version to use.

Comment threadinclude/sound/sof/dai-intel.h Outdated
Comment threadinclude/uapi/sound/sof/abi.h Outdated
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

I've addressed the comments in my way except the sdev->private and ABI minor version.

@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

On FW side review @lgirdwood said this should have ABI minor version 14 so my guess was wrong. I'll wait for other comments before I update this.

@kv2019ikv2019i left a comment

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.

Looks good now @singalsu

Not sure who should do this, but I manually added this PR to the ABI classifier as well:
https://github.com/orgs/thesofproject/projects/2?card_filter_query=dmic

Comment threadsound/soc/sof/topology.c
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

Looks good now @singalsu

Not sure who should do this, but I manually added this PR to the ABI classifier as well:
https://github.com/orgs/thesofproject/projects/2?card_filter_query=dmic

Thanks! I didn't know about that. I'll learn how to do it.

@singalsu
singalsuforce-pushed the dmic_fixed_length_ipc branch from b14d68b to 728154cCompareMarch 25, 2020 14:55
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

I just pushed new version with extra if statement brackets removed and changed ABI minor back to 14.

@singalsu
singalsu requested a review from lyakhMarch 25, 2020 15:00
@singalsu
singalsu dismissed stale reviews from ranj063 and kv2019i via a245cbeMarch 25, 2020 17:18
@singalsu
singalsuforce-pushed the dmic_fixed_length_ipc branch from 728154c to a245cbeCompareMarch 25, 2020 17:18
@singalsu
singalsu requested a review from plbossartMarch 25, 2020 17:20
ranj063
ranj063 previously approved these changes Mar 25, 2020
plbossart
plbossart previously approved these changes Mar 25, 2020
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

Thanks for quick review work to everyone. The firmware proposal PR is now updated to match this one.

lyakh
lyakh previously approved these changes Mar 26, 2020
kv2019i
kv2019i previously approved these changes Mar 26, 2020
@kv2019i

kv2019i commented Mar 26, 2020

Copy link
Copy Markdown
Collaborator

Just waiting on thesofproject/sof#2610 now..
UPDATE: sof#2610 now approved. I'll let FW merge first and then I'll merge this.

This patch fixes the typo in word "microphone".
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch changes the flexible array member pdm[] into a fixed
array of four that is the max. number of stereo PDM controllers
in the current Intel platforms. The change simplifies DMIC DAI
load code and aligns the IPC with other DAI types.
The change is compatible with old and new firmware with similar
change. The ABI minor version is increased due to change in
IPC headers.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch restores the field name to fifo_bits_b since the
legacy firmware compatibility code (for firmware ABI 3.0.0 or earlier)
sets it in sof_link_dmic_load() function in topology.c. Setting of
reserved_2 didn't look appropriate.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
singalsu dismissed stale reviews from kv2019i, lyakh, plbossart, and ranj063 via 57f8967April 3, 2020 11:53
@singalsu
singalsuforce-pushed the dmic_fixed_length_ipc branch from a245cbe to 57f8967CompareApril 3, 2020 11:53
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

This leaves abi.h at minor 15. No other changes into this PR.

@kv2019ikv2019i left a comment

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.

Agreed with @lgirdwood to reclassify this to ABI15. Updated to latest sof-dev and as no changes otherwise, seems ready to go.

* Used to track the pdm config array index currently being parsed
*/
sdev->private = kzalloc(sizeof(u32), GFP_KERNEL);
if (!sdev->private) {

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.

Do I understand correctly that this now conflicts with #1766? But the conflict seems to be easy to resolve.

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.

@juimonen FYI, Seppo is out this week, so maybe let's put this #1924 in first, and you'll update the other one?

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.

@kv2019i you want me to update it? Sure can do, but so far I'm not aware of many cases of such take-overs. Is it urgent? Or was it just a typo?

uint32_t reserved_1; /**< Reserved */
uint16_t fifo_bits; /**< FIFO word length (16 or 32) */
uint16_t reserved_2; /**< Reserved */
uint16_t fifo_bits_b; /**< Deprecated since firmware ABI 3.0.1 */

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'm wondering how we're going to handle such deprecation? Do we set a grace period of, say, a year and then remove this backward compatibility and then claim the field as "reserved?"

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.

@lyakh I don't think you really ever get back reserved bits via deprecation unless you end up in a situation where you absolutely have to. I.e. rare enough event, so better worry about the process when the time comes.

@lyakhlyakh left a comment

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 would be good to have those additional remarks addressed in a new PR

#define SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_IDLE_HIGH BIT(5)

/* DMIC max. four controllers for eight microphone channels */
#define SOF_DAI_INTEL_DMIC_NUM_CTRL 4

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.

sorry for chiming in so late with this. This can be made a separate PR: should we add a check of num_pdm_active <= SOF_DAI_INTEL_DMIC_NUM_CTRL? I think it would be good to tighten up our topology consistency checks.

* that does not include the PDM controller config array
* Set the common params to 0.
*/
/* Ensure the entire DMIC config struct is zeros */

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.

This comment could be just drop, it doesn't seem to add a lot of information. In fact, looking at it: the below memset() is completely redundant. The caller has already 0-initialised the whole config. @singalsu could you make an additional PR to remove this too?

@kv2019i

Copy link
Copy Markdown
Collaborator

Thanks @lyakh . Let' s merge this version if the FW side progresses this week, and handle updates in separate PR.

@kv2019i

Copy link
Copy Markdown
Collaborator

FW part merged, merging this.
@singalsu Please check the additional comments from @lyakh and address in follow-up if still valid.

@kv2019i
kv2019i merged commit 0bebc01 into thesofproject:topic/sof-devApr 9, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ABIinvolves ABI changes, need extra attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@singalsu@kv2019i@plbossart@lyakh@ranj063@paulstelian97@xiulipan