mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-09 00:46:17 +00:00
After loading the module with load failure injection enabled don't try check the alive state. Also limit the number of failure points to existing ones, to reduce the run time of the test. v2: - make VT binding/snd module loading part of reload and VT bind fail silently (Chris) Signed-off-by: Imre Deak <imre.deak@intel.com>
85 lines
1.8 KiB
Bash
Executable File
85 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Testcase: Reload the drm module
|
|
#
|
|
# ... we've broken this way too often :(
|
|
#
|
|
|
|
SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
|
|
. $SOURCE_DIR/drm_lib.sh
|
|
|
|
# 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
|
|
echo unbinding $vtcon: `cat $vtcon/name`
|
|
echo 0 > $vtcon/bind
|
|
fi
|
|
done
|
|
|
|
# The sound driver uses our power well
|
|
pkill alsactl
|
|
rmmod snd_hda_intel &> /dev/null
|
|
|
|
#ignore errors in ips - gen5 only
|
|
rmmod intel_ips &> /dev/null
|
|
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)
|
|
rmmod drm_kms_helper &> /dev/null
|
|
rmmod drm &> /dev/null
|
|
|
|
if lsmod | grep i915 &> /dev/null ; then
|
|
echo WARNING: i915.ko still loaded!
|
|
return $IGT_EXIT_FAILURE
|
|
else
|
|
echo module successfully unloaded
|
|
fi
|
|
|
|
modprobe i915 $*
|
|
|
|
if [ -f /sys/class/vtconsole/vtcon1/bind ]; then
|
|
echo 1 > /sys/class/vtconsole/vtcon1/bind
|
|
fi
|
|
|
|
modprobe snd_hda_intel
|
|
}
|
|
|
|
function finish_load() {
|
|
# does the device exist?
|
|
if $SOURCE_DIR/gem_alive > /dev/null ; then
|
|
echo "module successfully loaded again"
|
|
else
|
|
echo "failed to reload module successfully"
|
|
return $IGT_EXIT_FAILURE
|
|
fi
|
|
|
|
# then try to run something
|
|
if ! $SOURCE_DIR/gem_exec_store > /dev/null ; then
|
|
echo "failed to execute a simple batch after reload"
|
|
return $IGT_EXIT_FAILURE
|
|
fi
|
|
|
|
return $IGT_EXIT_SUCCESS
|
|
}
|
|
|
|
reload || exit $?
|
|
finish_load || exit $?
|
|
|
|
# Repeat the module reload trying to to generate faults
|
|
fault=1
|
|
for i in $(seq 0 4); do
|
|
reload inject_load_failure=$fault
|
|
fault=$(($fault * 2))
|
|
done
|
|
|
|
reload || exit $?
|
|
finish_load
|
|
|
|
exit $?
|