mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ASoC: spacemit: fix build warning and error
@ 2025-10-28  1:32 Troy Mitchell
  2025-10-28  1:32 ` [PATCH v2 1/2] ASoC: spacemit: add failure check for spacemit_i2s_init_dai() Troy Mitchell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Troy Mitchell @ 2025-10-28  1:32 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Yixun Lan, Jinmei Wei
  Cc: linux-sound, linux-riscv, spacemit, linux-kernel, Troy Mitchell,
	Dan Carpenter, Stephen Rothwell

After the i2s patch for K1 was merged, two issues were identified:
- Missing error handling for the init_dai() function [1],
  which is required since the function allocates memory internally.
- The Kconfig entry ignored the dependency chain of DMA_CMA [2].

This series fixes both issues.

Link: https://lore.kernel.org/all/aPtiNCZ_KBezL2Dr@stanley.mountain/#t [1]
Link: https://lore.kernel.org/all/20251022141705.714b19b5@canb.auug.org.au/ [2]

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
Troy Mitchell (2):
      ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
      ASoC: spacemit: use `depends on` instead of `select`

 sound/soc/spacemit/Kconfig  | 3 +--
 sound/soc/spacemit/k1_i2s.c | 4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)
---
base-commit: 507d05188939fd47c9a11c3ab647f7db1bbef58c
change-id: 20251028-fix-k1-i2s-3253276f8796

Best regards,
-- 
Troy Mitchell <troy.mitchell@linux.spacemit.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
  2025-10-28  1:32 [PATCH v2 0/2] ASoC: spacemit: fix build warning and error Troy Mitchell
@ 2025-10-28  1:32 ` Troy Mitchell
  2025-10-28  1:32 ` [PATCH v2 2/2] ASoC: spacemit: use `depends on` instead of `select` Troy Mitchell
  2025-10-28 14:27 ` [PATCH v2 0/2] ASoC: spacemit: fix build warning and error Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Troy Mitchell @ 2025-10-28  1:32 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Yixun Lan, Jinmei Wei
  Cc: linux-sound, linux-riscv, spacemit, linux-kernel, Troy Mitchell,
	Dan Carpenter

Add error handling when memory allocation for dai fails in
spacemit_i2s_init_dai() call.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aPtiNCZ_KBezL2Dr@stanley.mountain/#t
Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
Changelog in v2:
- fix tag
- Link to v1: https://lore.kernel.org/all/20251024-fix-k1-i2s-dai-mem-v1-1-15f5f1ec294a@linux.spacemit.com/
---
 sound/soc/spacemit/k1_i2s.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/spacemit/k1_i2s.c b/sound/soc/spacemit/k1_i2s.c
index abc439b53e3d4358570df2e69e636bf54820d9ce..8af05e1604f518b63cbbbaa66b73cfee8262d87f 100644
--- a/sound/soc/spacemit/k1_i2s.c
+++ b/sound/soc/spacemit/k1_i2s.c
@@ -428,7 +428,9 @@ static int spacemit_i2s_probe(struct platform_device *pdev)
 
 	dev_set_drvdata(i2s->dev, i2s);
 
-	spacemit_i2s_init_dai(i2s, &dai, res->start + SSDATR);
+	ret = spacemit_i2s_init_dai(i2s, &dai, res->start + SSDATR);
+	if (ret)
+		return ret;
 
 	ret = devm_snd_soc_register_component(i2s->dev,
 					      &spacemit_i2s_component,

-- 
2.51.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] ASoC: spacemit: use `depends on` instead of `select`
  2025-10-28  1:32 [PATCH v2 0/2] ASoC: spacemit: fix build warning and error Troy Mitchell
  2025-10-28  1:32 ` [PATCH v2 1/2] ASoC: spacemit: add failure check for spacemit_i2s_init_dai() Troy Mitchell
@ 2025-10-28  1:32 ` Troy Mitchell
  2025-10-28 14:27 ` [PATCH v2 0/2] ASoC: spacemit: fix build warning and error Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Troy Mitchell @ 2025-10-28  1:32 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Yixun Lan, Jinmei Wei
  Cc: linux-sound, linux-riscv, spacemit, linux-kernel, Troy Mitchell,
	Stephen Rothwell

Selecting DMA_CMA directly bypasses its dependency chain.
This can cause build warnings or errors if the required
dependencies are not enabled.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20251022141705.714b19b5@canb.auug.org.au/
Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
Changelog in v2:
- this patch is introduced in v2
---
 sound/soc/spacemit/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/spacemit/Kconfig b/sound/soc/spacemit/Kconfig
index 2179f94f3f179c54cd06e6ced5523ed3f5225cf4..e11f600a327f58681ce46df6e0e7a70f5f1d1234 100644
--- a/sound/soc/spacemit/Kconfig
+++ b/sound/soc/spacemit/Kconfig
@@ -6,8 +6,7 @@ menu "SpacemiT"
 config SND_SOC_K1_I2S
 	tristate "K1 I2S Device Driver"
 	select SND_SOC_GENERIC_DMAENGINE_PCM
-	select CMA
-	select DMA_CMA
+	depends on DMA_CMA
 	help
 	  Say Y or M if you want to add support for I2S driver for
 	  K1 I2S controller. The device supports up to maximum of

-- 
2.51.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] ASoC: spacemit: fix build warning and error
  2025-10-28  1:32 [PATCH v2 0/2] ASoC: spacemit: fix build warning and error Troy Mitchell
  2025-10-28  1:32 ` [PATCH v2 1/2] ASoC: spacemit: add failure check for spacemit_i2s_init_dai() Troy Mitchell
  2025-10-28  1:32 ` [PATCH v2 2/2] ASoC: spacemit: use `depends on` instead of `select` Troy Mitchell
@ 2025-10-28 14:27 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-10-28 14:27 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Yixun Lan,
	Jinmei Wei, Troy Mitchell
  Cc: linux-sound, linux-riscv, spacemit, linux-kernel, Dan Carpenter,
	Stephen Rothwell

On Tue, 28 Oct 2025 09:32:08 +0800, Troy Mitchell wrote:
> After the i2s patch for K1 was merged, two issues were identified:
> - Missing error handling for the init_dai() function [1],
>   which is required since the function allocates memory internally.
> - The Kconfig entry ignored the dependency chain of DMA_CMA [2].
> 
> This series fixes both issues.
> 
> [...]

Applied to

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

Thanks!

[1/2] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
      commit: f034c16a4663eaf3198dc18b201ba50533fb5b81
[2/2] ASoC: spacemit: use `depends on` instead of `select`
      (no commit info)

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-28 14:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-28  1:32 [PATCH v2 0/2] ASoC: spacemit: fix build warning and error Troy Mitchell
2025-10-28  1:32 ` [PATCH v2 1/2] ASoC: spacemit: add failure check for spacemit_i2s_init_dai() Troy Mitchell
2025-10-28  1:32 ` [PATCH v2 2/2] ASoC: spacemit: use `depends on` instead of `select` Troy Mitchell
2025-10-28 14:27 ` [PATCH v2 0/2] ASoC: spacemit: fix build warning and error Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®