Skip to contentSkip to conversation

ASoC: Intel: Mark BE DAIs as nonatomic for hsw and

PATCH In review Cezary Rojewski 3 participants 14 messages Jun 24, 2022 – Jul 15, 2022

Subsystems (3)
lore
Share & tools
lore

Cezary Rojewski

author maintainer
#0 lore raw

cover ASoC: Intel: Mark BE DAIs as nonatomic for hsw and

Address the warning: "Codec: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic" by marking BE DAI as nonatomic. Aligns with what is already done for FE DAIs.

This patchset iterates the change over all HSW and BDW related machine board drivers.

Cezary Rojewski (4):
ASoC: Intel: hsw_rt5640: Mark BE DAI as nonatomic
ASoC: Intel: bdw_rt286: Mark BE DAI as nonatomic
ASoC: Intel: bdw_rt5650: Mark BE DAI as nonatomic
ASoC: Intel: bdw_rt5677: Mark BE DAI as nonatomic

 sound/soc/intel/boards/bdw-rt5650.c | 1 +
 sound/soc/intel/boards/bdw-rt5677.c | 1 +
 sound/soc/intel/boards/bdw_rt286.c  | 1 +
 sound/soc/intel/boards/hsw_rt5640.c | 1 +
 4 files changed, 4 insertions(+)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/4 ASoC: Intel: hsw_rt5640: Mark BE DAI as nonatomic

Address the warning: "Codec: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic" by marking BE DAI as nonatomic. Aligns with what is already done for FE DAIs.

---
 sound/soc/intel/boards/hsw_rt5640.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/intel/boards/hsw_rt5640.c +1 -0
index ad747363d112..050c53ebd6ba 100644
@@ -121,6 +121,7 @@ static struct snd_soc_dai_link card_dai_links[] = {
 		/* SSP0 - Codec */
 		.name = "Codec",
 		.id = 0,
+		.nonatomic = 1,
 		.no_pcm = 1,
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC,
 		.ignore_pmdown_time = 1,
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH 2/4 ASoC: Intel: bdw_rt286: Mark BE DAI as nonatomic

In reply to Cezary Rojewski

Address the warning: "Codec: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic" by marking BE DAI as nonatomic. Aligns with what is already done for FE DAIs.

---
 sound/soc/intel/boards/bdw_rt286.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/intel/boards/bdw_rt286.c +1 -0
index 47eaddb00936..6b76df0e7c9b 100644
@@ -162,6 +162,7 @@ static struct snd_soc_dai_link card_dai_links[] = {
 		/* SSP0 - Codec */
 		.name = "Codec",
 		.id = 0,
+		.nonatomic = 1,
 		.no_pcm = 1,
 		.init = codec_link_init,
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC,
Signature · 1 line
2.25.1
author maintainer
#3 lore raw

PATCH 3/4 ASoC: Intel: bdw_rt5650: Mark BE DAI as nonatomic

In reply to Cezary Rojewski

Address the warning: "Codec: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic" by marking BE DAI as nonatomic. Aligns with what is already done for FE ones.

---
 sound/soc/intel/boards/bdw-rt5650.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/intel/boards/bdw-rt5650.c +1 -0
index aae857fdcdb8..67c3f49b924c 100644
@@ -249,6 +249,7 @@ static struct snd_soc_dai_link bdw_rt5650_dais[] = {
 		/* SSP0 - Codec */
 		.name = "Codec",
 		.id = 0,
+		.nonatomic = 1,
 		.no_pcm = 1,
 		.dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBC_CFC,
Signature · 1 line
2.25.1
author maintainer
#4 lore raw

PATCH 4/4 ASoC: Intel: bdw_rt5677: Mark BE DAI as nonatomic

In reply to Cezary Rojewski

Address the warning: "Codec: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic" by marking BE DAI as nonatomic. Aligns with what is already done for FE ones.

---
 sound/soc/intel/boards/bdw-rt5677.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/intel/boards/bdw-rt5677.c +1 -0
index d0ecbba2febe..31488702768e 100644
@@ -349,6 +349,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = {
 		/* SSP0 - Codec */
 		.name = "Codec",
 		.id = 0,
+		.nonatomic = 1,
 		.no_pcm = 1,
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBC_CFC,
Signature · 1 line
2.25.1
#5 lore raw
In reply to Cezary Rojewski
Quoted 6 lines · Cezary Rojewski

Address the warning: "Codec: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic" by marking BE DAI as nonatomic. Aligns with what is already done for FE DAIs.

This patchset iterates the change over all HSW and BDW related machine board drivers.

I don't think this is necessary, I was planning to demote this warning to a simple dev_dbg or possibly remove this message entirely.

The BE DAIs can perfectly be declared as non-atomic in all Intel machine drivers, except for SoundWire where there's a known delay during the .trigger.

Quoted 12 lines

Cezary Rojewski (4):
ASoC: Intel: hsw_rt5640: Mark BE DAI as nonatomic
ASoC: Intel: bdw_rt286: Mark BE DAI as nonatomic
ASoC: Intel: bdw_rt5650: Mark BE DAI as nonatomic
ASoC: Intel: bdw_rt5677: Mark BE DAI as nonatomic

 sound/soc/intel/boards/bdw-rt5650.c | 1 +
 sound/soc/intel/boards/bdw-rt5677.c | 1 +
 sound/soc/intel/boards/bdw_rt286.c  | 1 +
 sound/soc/intel/boards/hsw_rt5640.c | 1 +
 4 files changed, 4 insertions(+)
author maintainer
#6 lore raw
Quoted 8 lines · Pierre-Louis Bossart
Quoted 6 lines · Cezary Rojewski

Address the warning: "Codec: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic" by marking BE DAI as nonatomic. Aligns with what is already done for FE DAIs.

This patchset iterates the change over all HSW and BDW related machine board drivers.

Quoted 6 lines

I don't think this is necessary, I was planning to demote this warning to a simple dev_dbg or possibly remove this message entirely.

The BE DAIs can perfectly be declared as non-atomic in all Intel machine drivers, except for SoundWire where there's a known delay during the .trigger.

Hmm.. that's a good feedback. Isn't ASoC's FE<->BE treated as a single PCM substream in sound/core/pcm_native.c though? If so, does it even make sense for card's BE DAI to be atomic, if it's FE counterpart is nonatomic already? Especially if it is specifying platform and cpu_dai that matches Intel's components which we know communicate using IPCs.

Warning is one thing, but will you be also getting rid of the if-statement in soc-pcm.c that actually forces nonatomic=1 on BE when FE is already declared as such? If the if-statement stays, I believe the declaring BE DAIs 'correctly' in the way to go.

Regards,
Czarek

#7 lore raw
Quoted 17 lines · Cezary Rojewski
Quoted 8 lines · Pierre-Louis Bossart
Quoted 6 lines · Cezary Rojewski

Address the warning: "Codec: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic" by marking BE DAI as nonatomic. Aligns with what is already done for FE DAIs.

This patchset iterates the change over all HSW and BDW related machine board drivers.

Quoted 6 lines

I don't think this is necessary, I was planning to demote this warning to a simple dev_dbg or possibly remove this message entirely.

The BE DAIs can perfectly be declared as non-atomic in all Intel machine drivers, except for SoundWire where there's a known delay during the .trigger.

Quoted 5 lines

Hmm.. that's a good feedback. Isn't ASoC's FE<->BE treated as a single PCM substream in sound/core/pcm_native.c though? If so, does it even make sense for card's BE DAI to be atomic, if it's FE counterpart is nonatomic already? Especially if it is specifying platform and cpu_dai that matches Intel's components which we know communicate using IPCs.

I guess it depends on the cpu_dai implementation. Not all implementations implement a delay in the .trigger callback and/or rely on IPCs.

Quoted 4 lines

Warning is one thing, but will you be also getting rid of the if-statement in soc-pcm.c that actually forces nonatomic=1 on BE when FE is already declared as such? If the if-statement stays, I believe the declaring BE DAIs 'correctly' in the way to go.

I meant just removing the dev_warn() only.

See https://github.com/thesofproject/linux/pull/3723

author maintainer
#8 lore raw
Quoted 12 lines · Pierre-Louis Bossart
Quoted 5 lines · Cezary Rojewski

Hmm.. that's a good feedback. Isn't ASoC's FE<->BE treated as a single PCM substream in sound/core/pcm_native.c though? If so, does it even make sense for card's BE DAI to be atomic, if it's FE counterpart is nonatomic already? Especially if it is specifying platform and cpu_dai that matches Intel's components which we know communicate using IPCs.

I guess it depends on the cpu_dai implementation. Not all implementations implement a delay in the .trigger callback and/or rely on IPCs.

Quoted 8 lines
Quoted 4 lines

Warning is one thing, but will you be also getting rid of the if-statement in soc-pcm.c that actually forces nonatomic=1 on BE when FE is already declared as such? If the if-statement stays, I believe the declaring BE DAIs 'correctly' in the way to go.

I meant just removing the dev_warn() only.

See https://github.com/thesofproject/linux/pull/3723

So the framework is still fixing the flag for the driver. Ideally we would like to have all the drivers assign correct values to ->nonatomic flag themselves.

Now when I think about it, the message seems useful - at least as dev_dbg(). It _guides_ driver developer to the desired approach: setting the ->nonatomic flag for BE to '1' if the corresponding FE is already configured as such.

I've provided similar answer in the linked thread.

Regards,
Czarek

#9 lore raw
Quoted 22 lines · Cezary Rojewski
Quoted 12 lines · Pierre-Louis Bossart
Quoted 5 lines · Cezary Rojewski

Hmm.. that's a good feedback. Isn't ASoC's FE<->BE treated as a single PCM substream in sound/core/pcm_native.c though? If so, does it even make sense for card's BE DAI to be atomic, if it's FE counterpart is nonatomic already? Especially if it is specifying platform and cpu_dai that matches Intel's components which we know communicate using IPCs.

I guess it depends on the cpu_dai implementation. Not all implementations implement a delay in the .trigger callback and/or rely on IPCs.

Quoted 8 lines
Quoted 4 lines

Warning is one thing, but will you be also getting rid of the if-statement in soc-pcm.c that actually forces nonatomic=1 on BE when FE is already declared as such? If the if-statement stays, I believe the declaring BE DAIs 'correctly' in the way to go.

I meant just removing the dev_warn() only.

See https://github.com/thesofproject/linux/pull/3723

Quoted 8 lines

So the framework is still fixing the flag for the driver. Ideally we would like to have all the drivers assign correct values to ->nonatomic flag themselves.

Now when I think about it, the message seems useful - at least as dev_dbg(). It _guides_ driver developer to the desired approach: setting the ->nonatomic flag for BE to '1' if the corresponding FE is already configured as such.

that would result in unnecessary changes to all machine drivers to get rid of the message...

author maintainer
#10 lore raw
Quoted 6 lines · Pierre-Louis Bossart
Quoted 4 lines · Cezary Rojewski

So the framework is still fixing the flag for the driver. Ideally we would like to have all the drivers assign correct values to ->nonatomic flag themselves.

Quoted 7 lines
Quoted 4 lines

Now when I think about it, the message seems useful - at least as dev_dbg(). It _guides_ driver developer to the desired approach: setting the ->nonatomic flag for BE to '1' if the corresponding FE is already configured as such.

that would result in unnecessary changes to all machine drivers to get rid of the message...

I would have rather used the word _optional_ here. dev_dbg() is a diplomatic solution.

As I'm responsible for catpt and avs drivers, this very series fixes the issue for the former. AVS driver have had the flag set appropriately from the get go, so no fixes needed.

maintainer
#11 lore raw
In reply to Pierre-Louis Bossart
Quoted 10 lines · Pierre-Louis Bossart
Quoted 4 lines · Cezary Rojewski

Warning is one thing, but will you be also getting rid of the if-statement in soc-pcm.c that actually forces nonatomic=1 on BE when FE is already declared as such? If the if-statement stays, I believe the declaring BE DAIs 'correctly' in the way to go.

I meant just removing the dev_warn() only.

See https://github.com/thesofproject/linux/pull/3723

Is something going to be upstreamed here? I don't really mind which solution is adopted here but right now Cezary's patches are the ones that were posted upstream.

author maintainer
#12 lore raw
Quoted 8 lines · Mark Brown
Quoted 6 lines · Pierre-Louis Bossart
Quoted 4 lines · Cezary Rojewski

Warning is one thing, but will you be also getting rid of the if-statement in soc-pcm.c that actually forces nonatomic=1 on BE when FE is already declared as such? If the if-statement stays, I believe the declaring BE DAIs 'correctly' in the way to go.

Quoted 7 lines
Quoted 3 lines

I meant just removing the dev_warn() only.

See https://github.com/thesofproject/linux/pull/3723

Is something going to be upstreamed here? I don't really mind which solution is adopted here but right now Cezary's patches are the ones that were posted upstream.

My 2 cents:

Both series can co-exist. We should still encourage people to configure their DAIs properly so the if-statements like the one forcing ->nonatomic=1 in time are gone.

maintainer
#13 lore raw
In reply to Cezary Rojewski
Quoted 8 lines · Cezary Rojewski

Address the warning: "Codec: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic" by marking BE DAI as nonatomic. Aligns with what is already done for FE DAIs.

This patchset iterates the change over all HSW and BDW related machine board drivers.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/4] ASoC: Intel: hsw_rt5640: Mark BE DAI as nonatomic

      commit: 58ef0d3d5716000c153acc5401109fd90afbdf09
[2/4] ASoC: Intel: bdw_rt286: Mark BE DAI as nonatomic
      commit: 6d7e011808504e0aabbbf3b66d4c14982394abae
[3/4] ASoC: Intel: bdw_rt5650: Mark BE DAI as nonatomic
      commit: 5c4ef9529b12865c2402784a7506c880178effda
[4/4] ASoC: Intel: bdw_rt5677: Mark BE DAI as nonatomic
      commit: bdd15ec4888a375848030cbf7d9fc16c7f430f48

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark