[PATCH 0/3] Fix up building KUnit tests for Cirrus Logic modules

0 views
Skip to first unread message

Richard Fitzgerald

unread,
Apr 11, 2025, 8:36:20 AM4/11/25
to bro...@kernel.org, brendan...@linux.dev, davi...@google.com, rm...@google.com, npa...@redhat.com, linux-k...@vger.kernel.org, kuni...@googlegroups.com, linux-...@vger.kernel.org, pat...@opensource.cirrus.com
This series fixes the KConfig for cs_dsp and cs-amp-lib tests so that
CONFIG_KUNIT_ALL_TESTS doesn't cause them to add modules to the build.

Patch 1 adds the ASoC CS35L56 driver to KUnit all_tests.config so that
cs_dsp and cs-amp-lib will be included in the test build.

Patch 2 and 3 fixup the KConfig entries for cs_dsp and cs-amp-lib.

Nico Pache (1):
firmware: cs_dsp: tests: Depend on FW_CS_DSP rather then enabling it

Richard Fitzgerald (2):
kunit: configs: Add some Cirrus Logic modules to all_tests
ASoC: cs-amp-lib-test: Don't select SND_SOC_CS_AMP_LIB

drivers/firmware/cirrus/Kconfig | 5 +----
sound/soc/codecs/Kconfig | 5 ++---
tools/testing/kunit/configs/all_tests.config | 2 ++
3 files changed, 5 insertions(+), 7 deletions(-)

--
2.39.5

Richard Fitzgerald

unread,
Apr 11, 2025, 8:36:21 AM4/11/25
to bro...@kernel.org, brendan...@linux.dev, davi...@google.com, rm...@google.com, npa...@redhat.com, linux-k...@vger.kernel.org, kuni...@googlegroups.com, linux-...@vger.kernel.org, pat...@opensource.cirrus.com
From: Nico Pache <npa...@redhat.com>

FW_CS_DSP gets enabled if KUNIT is enabled. The test should rather
depend on if the feature is enabled. Fix this by moving FW_CS_DSP to the
depends on clause.

Fixes: dd0b6b1f29b9 ("firmware: cs_dsp: Add KUnit testing of bin file download")
Signed-off-by: Nico Pache <npa...@redhat.com>
Signed-off-by: Richard Fitzgerald <r...@opensource.cirrus.com>
---
drivers/firmware/cirrus/Kconfig | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/firmware/cirrus/Kconfig b/drivers/firmware/cirrus/Kconfig
index 0a883091259a..e3c2e38b746d 100644
--- a/drivers/firmware/cirrus/Kconfig
+++ b/drivers/firmware/cirrus/Kconfig
@@ -6,14 +6,11 @@ config FW_CS_DSP

config FW_CS_DSP_KUNIT_TEST_UTILS
tristate
- depends on KUNIT && REGMAP
- select FW_CS_DSP

config FW_CS_DSP_KUNIT_TEST
tristate "KUnit tests for Cirrus Logic cs_dsp" if !KUNIT_ALL_TESTS
- depends on KUNIT && REGMAP
+ depends on KUNIT && REGMAP && FW_CS_DSP
default KUNIT_ALL_TESTS
- select FW_CS_DSP
select FW_CS_DSP_KUNIT_TEST_UTILS
help
This builds KUnit tests for cs_dsp.
--
2.39.5

Richard Fitzgerald

unread,
Apr 11, 2025, 8:36:22 AM4/11/25
to bro...@kernel.org, brendan...@linux.dev, davi...@google.com, rm...@google.com, npa...@redhat.com, linux-k...@vger.kernel.org, kuni...@googlegroups.com, linux-...@vger.kernel.org, pat...@opensource.cirrus.com
Depend on SND_SOC_CS_AMP_LIB instead of selecting it.

KUNIT_ALL_TESTS should only build tests for components that are
already being built, it should not cause other stuff to be added
to the build.

Fixes: 177862317a98 ("ASoC: cs-amp-lib: Add KUnit test for calibration helpers")
Signed-off-by: Richard Fitzgerald <r...@opensource.cirrus.com>
---
sound/soc/codecs/Kconfig | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 870eb90116f1..c388676ce380 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -776,10 +776,9 @@ config SND_SOC_CS_AMP_LIB
tristate

config SND_SOC_CS_AMP_LIB_TEST
- tristate "KUnit test for Cirrus Logic cs-amp-lib"
- depends on KUNIT
+ tristate "KUnit test for Cirrus Logic cs-amp-lib" if !KUNIT_ALL_TESTS
+ depends on SND_SOC_CS_AMP_LIB && KUNIT
default KUNIT_ALL_TESTS
- select SND_SOC_CS_AMP_LIB
help
This builds KUnit tests for the Cirrus Logic common
amplifier library.
--
2.39.5

David Gow

unread,
Apr 12, 2025, 2:33:39 AM4/12/25
to Richard Fitzgerald, bro...@kernel.org, brendan...@linux.dev, rm...@google.com, npa...@redhat.com, linux-k...@vger.kernel.org, kuni...@googlegroups.com, linux-...@vger.kernel.org, pat...@opensource.cirrus.com
On Fri, 11 Apr 2025 at 20:36, Richard Fitzgerald
<r...@opensource.cirrus.com> wrote:
>
> This series fixes the KConfig for cs_dsp and cs-amp-lib tests so that
> CONFIG_KUNIT_ALL_TESTS doesn't cause them to add modules to the build.
>
> Patch 1 adds the ASoC CS35L56 driver to KUnit all_tests.config so that
> cs_dsp and cs-amp-lib will be included in the test build.
>
> Patch 2 and 3 fixup the KConfig entries for cs_dsp and cs-amp-lib.

This looks great to me.

The series is:
Reviewed-by: David Gow <davi...@google.com>


Do you want us to take this (either the whole thing, or just the first
patch) via the KUnit tree, or will you take it yourself? Either should
work here.

Cheers,
-- David

Mark Brown

unread,
Apr 14, 2025, 9:56:47 AM4/14/25
to brendan...@linux.dev, davi...@google.com, rm...@google.com, npa...@redhat.com, Richard Fitzgerald, linux-k...@vger.kernel.org, kuni...@googlegroups.com, linux-...@vger.kernel.org, pat...@opensource.cirrus.com
On Fri, 11 Apr 2025 13:36:05 +0100, Richard Fitzgerald wrote:
> This series fixes the KConfig for cs_dsp and cs-amp-lib tests so that
> CONFIG_KUNIT_ALL_TESTS doesn't cause them to add modules to the build.
>
> Patch 1 adds the ASoC CS35L56 driver to KUnit all_tests.config so that
> cs_dsp and cs-amp-lib will be included in the test build.
>
> Patch 2 and 3 fixup the KConfig entries for cs_dsp and cs-amp-lib.
>
> [...]

Applied to

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

Thanks!

[1/3] kunit: configs: Add some Cirrus Logic modules to all_tests
commit: 1aa495a6572f8641da4ec4cd32210deca61bed64
[2/3] ASoC: cs-amp-lib-test: Don't select SND_SOC_CS_AMP_LIB
commit: 96014d91cffb335d3b396771524ff2aba3549865
[3/3] firmware: cs_dsp: tests: Depend on FW_CS_DSP rather then enabling it
commit: a0b887f6eb9a0d1be3c57d00b0f3ba8408d3018a

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

Reply all
Reply to author
Forward
0 new messages