Skip to contentSkip to conversation

tests: debug log lsmod on module unload failure

PATCH In review Jani Nikula 2 participants 3 messages Oct 18, 2016 – Oct 21, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: debug log lsmod on module unload failure

It's a bit verbose, but should only happen on errors. This should help debug the snd_hda_intel unload issues.

---

UNTESTED!!!

---
 tests/drv_module_reload_basic | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
tests/drv_module_reload_basic +10 -2
index a8d628dd96bd..b8cad88133e9 100755
@@ -33,14 +33,22 @@ function reload() {
 	pkill alsactl
 	snd_hda_intel_unloaded=0
 	if mod_loaded snd_hda_intel; then
-		rmmod snd_hda_intel && snd_hda_intel_unloaded=1
+		if rmmod snd_hda_intel; then
+			snd_hda_intel_unloaded=1
+		else
+			lsmod >&2
+		fi
 	fi
 
 	# gen5 only
 	if mod_loaded intel_ips; then
 		rmmod intel_ips
 	fi
-	rmmod i915 || return $IGT_EXIT_SKIP
+
+	if ! rmmod i915; then
+		lsmod >&2
+		return $IGT_EXIT_SKIP
+	fi
 	#ignore errors in intel-gtt, often built-in
 	rmmod intel-gtt &> /dev/null
 	# drm may be used by other devices (nouveau, radeon, udl, etc)
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jani Nikula

It's a bit verbose, but should only happen on errors. This should help debug the snd_hda_intel unload issues.

---

UNTESTED!!!

This sounds scary but LGTM.

Quoted 40 lines
---
 tests/drv_module_reload_basic | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
tests/drv_module_reload_basic +10 -2
index a8d628dd96bd..b8cad88133e9 100755
@@ -33,14 +33,22 @@ function reload() {
 	pkill alsactl
 	snd_hda_intel_unloaded=0
 	if mod_loaded snd_hda_intel; then
-		rmmod snd_hda_intel && snd_hda_intel_unloaded=1
+		if rmmod snd_hda_intel; then
+			snd_hda_intel_unloaded=1
+		else
+			lsmod >&2
+		fi
 	fi
 
 	# gen5 only
 	if mod_loaded intel_ips; then
 		rmmod intel_ips
 	fi
-	rmmod i915 || return $IGT_EXIT_SKIP
+
+	if ! rmmod i915; then
+		lsmod >&2
+		return $IGT_EXIT_SKIP
+	fi
 	#ignore errors in intel-gtt, often built-in
 	rmmod intel-gtt &> /dev/null
 	# drm may be used by other devices (nouveau, radeon, udl, etc)
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
Quoted 6 lines · Petri Latvala
Quoted 5 lines · Jani Nikula

It's a bit verbose, but should only happen on errors. This should help debug the snd_hda_intel unload issues.

Quoted 7 lines
Quoted 3 lines

---

UNTESTED!!!

This sounds scary but LGTM.

Thanks, I gave this a bit of testing, and pushed.

BR,
Jani.

Quoted 42 lines
Quoted 42 lines

---
 tests/drv_module_reload_basic | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
tests/drv_module_reload_basic +10 -2
index a8d628dd96bd..b8cad88133e9 100755
@@ -33,14 +33,22 @@ function reload() {
 	pkill alsactl
 	snd_hda_intel_unloaded=0
 	if mod_loaded snd_hda_intel; then
-		rmmod snd_hda_intel && snd_hda_intel_unloaded=1
+		if rmmod snd_hda_intel; then
+			snd_hda_intel_unloaded=1
+		else
+			lsmod >&2
+		fi
 	fi
 
 	# gen5 only
 	if mod_loaded intel_ips; then
 		rmmod intel_ips
 	fi
-	rmmod i915 || return $IGT_EXIT_SKIP
+
+	if ! rmmod i915; then
+		lsmod >&2
+		return $IGT_EXIT_SKIP
+	fi
 	#ignore errors in intel-gtt, often built-in
 	rmmod intel-gtt &> /dev/null
 	# drm may be used by other devices (nouveau, radeon, udl, etc)
Signature · 6 lines
2.1.4

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