* [PATCH] selftests: ALSA: Skip utimer test when CONFIG_SND_UTIMER is not enabled
@ 2026-03-19 12:45 Ben Copeland
2026-03-19 16:05 ` Mark Brown
2026-03-27 9:30 ` Takashi Iwai
0 siblings, 2 replies; 3+ messages in thread
From: Ben Copeland @ 2026-03-19 12:45 UTC (permalink / raw)
To: Mark Brown, Jaroslav Kysela, Takashi Iwai, Shuah Khan
Cc: Ivan Orlov, Dan Carpenter, Anders Roxell, linux-sound,
linux-kselftest, linux-kernel, Ben Copeland
The timer_f.utimer test hard-fails with ASSERT_EQ when
SNDRV_TIMER_IOCTL_CREATE returns -1 on kernels without
CONFIG_SND_UTIMER. This causes the entire alsa kselftest suite to
report a failure rather than skipping the unsupported test.
When CONFIG_SND_UTIMER is not enabled, the ioctl is not recognised and
the kernel returns -ENOTTY. If the timer device or subdevice does not
exist, -ENXIO is returned. Skip the test in both cases, but still fail
on any other unexpected error.
Suggested-by: Mark Brown <broonie@kernel.org>
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/utimer-test.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/alsa/utimer-test.c b/tools/testing/selftests/alsa/utimer-test.c
index d221972cd8fb..1a9ff010cb11 100644
--- a/tools/testing/selftests/alsa/utimer-test.c
+++ b/tools/testing/selftests/alsa/utimer-test.c
@@ -15,6 +15,7 @@
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
+#include <errno.h>
#define FRAME_RATE 8000
#define PERIOD_SIZE 4410
@@ -52,7 +53,14 @@ FIXTURE_SETUP(timer_f) {
timer_dev_fd = open("/dev/snd/timer", O_RDONLY);
ASSERT_GE(timer_dev_fd, 0);
- ASSERT_EQ(ioctl(timer_dev_fd, SNDRV_TIMER_IOCTL_CREATE, self->utimer_info), 0);
+ if (ioctl(timer_dev_fd, SNDRV_TIMER_IOCTL_CREATE, self->utimer_info) < 0) {
+ int err = errno;
+
+ close(timer_dev_fd);
+ if (err == ENOTTY || err == ENXIO)
+ SKIP(return, "CONFIG_SND_UTIMER not enabled");
+ ASSERT_EQ(err, 0);
+ }
ASSERT_GE(self->utimer_info->fd, 0);
close(timer_dev_fd);
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests: ALSA: Skip utimer test when CONFIG_SND_UTIMER is not enabled
2026-03-19 12:45 [PATCH] selftests: ALSA: Skip utimer test when CONFIG_SND_UTIMER is not enabled Ben Copeland
@ 2026-03-19 16:05 ` Mark Brown
2026-03-27 9:30 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-03-19 16:05 UTC (permalink / raw)
To: Ben Copeland
Cc: Jaroslav Kysela, Takashi Iwai, Shuah Khan, Ivan Orlov,
Dan Carpenter, Anders Roxell, linux-sound, linux-kselftest,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
On Thu, Mar 19, 2026 at 12:45:21PM +0000, Ben Copeland wrote:
> The timer_f.utimer test hard-fails with ASSERT_EQ when
> SNDRV_TIMER_IOCTL_CREATE returns -1 on kernels without
> CONFIG_SND_UTIMER. This causes the entire alsa kselftest suite to
> report a failure rather than skipping the unsupported test.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests: ALSA: Skip utimer test when CONFIG_SND_UTIMER is not enabled
2026-03-19 12:45 [PATCH] selftests: ALSA: Skip utimer test when CONFIG_SND_UTIMER is not enabled Ben Copeland
2026-03-19 16:05 ` Mark Brown
@ 2026-03-27 9:30 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2026-03-27 9:30 UTC (permalink / raw)
To: Ben Copeland
Cc: Mark Brown, Jaroslav Kysela, Takashi Iwai, Shuah Khan, Ivan Orlov,
Dan Carpenter, Anders Roxell, linux-sound, linux-kselftest,
linux-kernel
On Thu, 19 Mar 2026 13:45:21 +0100,
Ben Copeland wrote:
>
> The timer_f.utimer test hard-fails with ASSERT_EQ when
> SNDRV_TIMER_IOCTL_CREATE returns -1 on kernels without
> CONFIG_SND_UTIMER. This causes the entire alsa kselftest suite to
> report a failure rather than skipping the unsupported test.
>
> When CONFIG_SND_UTIMER is not enabled, the ioctl is not recognised and
> the kernel returns -ENOTTY. If the timer device or subdevice does not
> exist, -ENXIO is returned. Skip the test in both cases, but still fail
> on any other unexpected error.
>
> Suggested-by: Mark Brown <broonie@kernel.org>
> Link: https://lore.kernel.org/linux-kselftest/0e9c25d3-efbd-433b-9fb1-0923010101b9@stanley.mountain/
> Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
Applied to for-next branch now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-27 9:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 12:45 [PATCH] selftests: ALSA: Skip utimer test when CONFIG_SND_UTIMER is not enabled Ben Copeland
2026-03-19 16:05 ` Mark Brown
2026-03-27 9:30 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox