[PATCH] selftests: alsa: add config for required kernel options

Ben Copeland posted 1 patch 2 weeks, 4 days ago
tools/testing/selftests/alsa/config | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 tools/testing/selftests/alsa/config
[PATCH] selftests: alsa: add config for required kernel options
Posted by Ben Copeland 2 weeks, 4 days ago
The alsa kselftests are missing a config file to declare their required
kernel configuration options. This causes the utimer-test (timer_f.utimer)
to fail on kernels without CONFIG_SND_UTIMER enabled, as the
SNDRV_TIMER_IOCTL_CREATE ioctl returns -1.

Add the config file with the necessary sound configs so that
'make kselftest-merge' can enable them automatically.

Link: https://lore.kernel.org/linux-kselftest/0e9c25d3-efbd-433b-9fb1-0923010101b9@stanley.mountain/
Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
---
 tools/testing/selftests/alsa/config | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 tools/testing/selftests/alsa/config

diff --git a/tools/testing/selftests/alsa/config b/tools/testing/selftests/alsa/config
new file mode 100644
index 000000000000..810cc31f09b3
--- /dev/null
+++ b/tools/testing/selftests/alsa/config
@@ -0,0 +1,7 @@
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_PCM_TIMER=y
+CONFIG_SND_PCMTEST=m
+CONFIG_SND_UTIMER=y
+CONFIG_DEBUG_FS=y
-- 
2.53.0
Re: [PATCH] selftests: alsa: add config for required kernel options
Posted by Mark Brown 2 weeks, 4 days ago
On Thu, Mar 19, 2026 at 08:43:47AM +0000, Ben Copeland wrote:
> The alsa kselftests are missing a config file to declare their required
> kernel configuration options. This causes the utimer-test (timer_f.utimer)
> to fail on kernels without CONFIG_SND_UTIMER enabled, as the
> SNDRV_TIMER_IOCTL_CREATE ioctl returns -1.
> 
> Add the config file with the necessary sound configs so that
> 'make kselftest-merge' can enable them automatically.

These tests fit awkwardly into the config fragment stuff, since pcm-test
and mixer-test are mostly testing drivers we should in theory have every
single audio driver enabled as part of the fragment, but that is
annoying to maintain and bloaty.  Fortunately people usually put these
in their defconfigs so we actually do the right thing in practice most
of the time without the need to build a custom kernel.  On the other
hand the test-pcmtest-driver test requires a test module which *does*
need a config option so it requires a cutom config.

Separately to what we're doing here utimer-test ought to skip rather
than fail if the driver it needs isn't present just as a general
kselftest style thing, I see it's not doing that now.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.
Re: [PATCH] selftests: alsa: add config for required kernel options
Posted by Ben Copeland 2 weeks, 3 days ago
Hello Mark,

On Thu, 19 Mar 2026 at 11:36, Mark Brown <broonie@kernel.org> wrote:
>
> On Thu, Mar 19, 2026 at 08:43:47AM +0000, Ben Copeland wrote:
> > The alsa kselftests are missing a config file to declare their required
> > kernel configuration options. This causes the utimer-test (timer_f.utimer)
> > to fail on kernels without CONFIG_SND_UTIMER enabled, as the
> > SNDRV_TIMER_IOCTL_CREATE ioctl returns -1.
> >
> > Add the config file with the necessary sound configs so that
> > 'make kselftest-merge' can enable them automatically.
>
> These tests fit awkwardly into the config fragment stuff, since pcm-test
> and mixer-test are mostly testing drivers we should in theory have every
> single audio driver enabled as part of the fragment, but that is
> annoying to maintain and bloaty.  Fortunately people usually put these
> in their defconfigs so we actually do the right thing in practice most
> of the time without the need to build a custom kernel.  On the other
> hand the test-pcmtest-driver test requires a test module which *does*
> need a config option so it requires a cutom config.
>
> Separately to what we're doing here utimer-test ought to skip rather
> than fail if the driver it needs isn't present just as a general
> kselftest style thing, I see it's not doing that now.

Good point. I'll create a patch for this, as it should be handled
better, rather than failing.

>
> Please submit patches using subject lines reflecting the style for the
> subsystem, this makes it easier for people to identify relevant patches.
> Look at what existing commits in the area you're changing are doing and
> make sure your subject lines visually resemble what they're doing.
> There's no need to resubmit to fix this alone.

Thank you for fixing that up. I have noted that for next time.

Regards


Ben