Skip to contentSkip to conversation

igt/drv_module_reload_basic: Do not require snd-hda-intel

PATCH In review Tvrtko Ursulin 2 participants 2 messages Apr 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igt/drv_module_reload_basic: Do not require snd-hda-intel

From: Tvrtko Ursulin <[email protected]>

Recent refactoring has made absence of snd-hda-intel a test failure do the respective modprobe being at the end of a reload function now.

Only fail in this case if module was previously unloaded.

---
 tests/drv_module_reload_basic | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tests/drv_module_reload_basic +5 -2
index fc508d7204b2..3bba796f0306 100755
@@ -11,6 +11,8 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
 # no other drm service should be running, so we can just unbind
 
 function reload() {
+	local snd_hda_intel_unloaded
+
 	echo Reloading i915.ko with $*
 
 	# we must kick away fbcon (but only fbcon)
@@ -23,7 +25,8 @@ function reload() {
 
 	# The sound driver uses our power well
 	pkill alsactl
-	rmmod snd_hda_intel &> /dev/null
+	snd_hda_intel_unloaded=0
+	rmmod snd_hda_intel &> /dev/null && snd_hda_intel_unloaded=1
 
 	#ignore errors in ips - gen5 only
 	rmmod intel_ips &> /dev/null
@@ -47,7 +50,7 @@ function reload() {
 		echo 1 > /sys/class/vtconsole/vtcon1/bind
 	fi
 
-	modprobe snd_hda_intel
+	modprobe -q snd_hda_intel || return $snd_hda_intel_unloaded
 }
 
 function finish_load() {
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 38 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Recent refactoring has made absence of snd-hda-intel a test failure do the respective modprobe being at the end of a reload function now.

Only fail in this case if module was previously unloaded.

---
 tests/drv_module_reload_basic | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tests/drv_module_reload_basic +4 -1
index fc508d7204b2..3bba796f0306 100755
@@ -11,6 +11,8 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
 # no other drm service should be running, so we can just unbind
 
 function reload() {
+	local snd_hda_intel_unloaded
+
 	echo Reloading i915.ko with $*
 
 	# we must kick away fbcon (but only fbcon)
@@ -23,7 +25,8 @@ function reload() {
 
 	# The sound driver uses our power well
 	pkill alsactl
-	rmmod snd_hda_intel &> /dev/null
+	snd_hda_intel_unloaded=0
+	rmmod snd_hda_intel &> /dev/null && snd_hda_intel_unloaded=1
 
 	#ignore errors in ips - gen5 only
 	rmmod intel_ips &> /dev/null

tests/drv_module_reload_basic function reload() { · line 53

Quoted 5 lines
tests/drv_module_reload_basic +1 -1
@@ -47,7 +50,7 @@ function reload() {
 		echo 1 > /sys/class/vtconsole/vtcon1/bind
 	fi
 
-	modprobe snd_hda_intel
+	modprobe -q snd_hda_intel || return $snd_hda_intel_unloaded

I'm sure that there is a better way to write this to allow easier extension of the bash function. (Writing it in C comes to mind!)

The code seems to dtrt since we must try reloading the snd_hda_intel even if wasn't loaded on the previous run.

So Reviewed-by: Chris Wilson <[email protected]> -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx