From 53eea91534275934da4040930bd8a48ac5407f5c Mon Sep 17 00:00:00 2001 From: harajend Date: Sat, 22 Aug 2026 08:48:03 +0530 Subject: [PATCH] tools: kmod: remove snd_ump before snd_rawmidi On MIDI2-enabled kernels snd_ump is loaded even when nothing is using it, and it holds a reference on snd_rawmidi. sof_remove.sh has no entry for it, so removal fails: RMMOD snd_rawmidi rmmod: ERROR: Module snd_rawmidi is in use by: snd_ump /home/ubuntu/sof-test/tools/kmod/sof_remove.sh FAILED That aborts reload_drivers() and every subsequent test case that reloads the driver stack fails with it -- on a NVL-S run this turned into ~15 consecutive failures starting at check-sof-logger. Remove snd_ump just before snd_rawmidi. remove_module() already SKIPs modules that are not loaded, so this is a no-op on kernels built without CONFIG_SND_UMP. Co-Authored-By: Claude Opus 5 (1M context) --- tools/kmod/sof_remove.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/kmod/sof_remove.sh b/tools/kmod/sof_remove.sh index 8a8adb11..ad584250 100755 --- a/tools/kmod/sof_remove.sh +++ b/tools/kmod/sof_remove.sh @@ -346,6 +346,12 @@ remove_module snd_pcm remove_module snd_ctl_led remove_module snd_seq_midi remove_module snd_seq_midi_event +# MIDI 2.0 UMP support holds a reference on snd_rawmidi (and on snd_seq_device), +# so it has to go first. It gets loaded on MIDI2-enabled kernels even when +# nothing is using it, which made snd_rawmidi removal fail with +# rmmod: ERROR: Module snd_rawmidi is in use by: snd_ump +# aborting reload_drivers() and cascading into every driver-reload test case. +remove_module snd_ump remove_module snd_rawmidi remove_module snd_seq_dummy remove_module snd_seq