mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 01:16:18 +00:00
igt/drv_module_reload_basic: Rinse and repeat with addition module parameters
An idea for testing failure paths along module load is to use a parameter to perform fault injection. This rudimentary framework should get us started. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
9eacbd2acd
commit
f14d56c42d
@ -10,6 +10,9 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
|
||||
|
||||
# no other drm service should be running, so we can just unbind
|
||||
|
||||
function reload() {
|
||||
echo Reloading i915.ko with $*
|
||||
|
||||
# we must kick away fbcon (but only fbcon)
|
||||
for vtcon in /sys/class/vtconsole/vtcon*/ ; do
|
||||
if grep "frame buffer device" $vtcon/name > /dev/null ; then
|
||||
@ -24,7 +27,7 @@ rmmod snd_hda_intel &> /dev/null
|
||||
|
||||
#ignore errors in ips - gen5 only
|
||||
rmmod intel_ips &> /dev/null
|
||||
rmmod i915
|
||||
rmmod i915 || return $IGT_EXIT_SKIP
|
||||
#ignore errors in intel-gtt, often built-in
|
||||
rmmod intel-gtt &> /dev/null
|
||||
# drm may be used by other devices (nouveau, radeon, udl, etc)
|
||||
@ -33,12 +36,12 @@ rmmod drm &> /dev/null
|
||||
|
||||
if lsmod | grep i915 &> /dev/null ; then
|
||||
echo WARNING: i915.ko still loaded!
|
||||
exit $IGT_EXIT_FAILURE
|
||||
return $IGT_EXIT_FAILURE
|
||||
else
|
||||
echo module successfully unloaded
|
||||
fi
|
||||
|
||||
modprobe i915
|
||||
modprobe i915 $*
|
||||
echo 1 > /sys/class/vtconsole/vtcon1/bind
|
||||
|
||||
modprobe snd_hda_intel
|
||||
@ -48,13 +51,26 @@ if $SOURCE_DIR/gem_alive > /dev/null ; then
|
||||
echo "module successfully loaded again"
|
||||
else
|
||||
echo "failed to reload module successfully"
|
||||
exit $IGT_EXIT_FAILURE
|
||||
return $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
||||
# then try to run something
|
||||
if ! $SOURCE_DIR/gem_linear_blits --run-subtest basic > /dev/null ; then
|
||||
if ! $SOURCE_DIR/gem_exec_store > /dev/null ; then
|
||||
echo "failed to execute a simple batch after reload"
|
||||
exit $IGT_EXIT_FAILURE
|
||||
return $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
return $IGT_EXIT_SUCCESS
|
||||
}
|
||||
|
||||
reload || exit $?
|
||||
|
||||
# Repeat the module reload trying to to generate faults
|
||||
fault=1
|
||||
for i in $(seq 0 31); do
|
||||
reload i915.fault_injection=$fault
|
||||
fault=$(($fault * 2))
|
||||
done
|
||||
|
||||
reload
|
||||
exit $?
|
||||
|
Loading…
x
Reference in New Issue
Block a user