Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) #!/bin/bash
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) # Modules specific tests cases
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) # protect against multiple inclusion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) if [ $FILE_MODULE ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 	return 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 	FILE_MODULE=DONE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) source cpu.sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) source cpufreq.sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) source governor.sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) # Check basic insmod/rmmod
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) # $1: module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) test_basic_insmod_rmmod()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	printf "** Test: Running ${FUNCNAME[0]} **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	printf "Inserting $1 module\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	# insert module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	insmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 		printf "Insmod $1 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 		exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	printf "Removing $1 module\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	# remove module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	rmmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 		printf "rmmod $1 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 		exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) # Insert cpufreq driver module and perform basic tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) # $1: cpufreq-driver module to insert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) # $2: If we want to play with CPUs (1) or not (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) module_driver_test_single()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	printf "** Test: Running ${FUNCNAME[0]} for driver $1 and cpus_hotplug=$2 **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	if [ $2 -eq 1 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 		# offline all non-boot CPUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		for_each_non_boot_cpu offline_cpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	# insert module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	printf "Inserting $1 module\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	insmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		printf "Insmod $1 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	if [ $2 -eq 1 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		# online all non-boot CPUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		for_each_non_boot_cpu online_cpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	# run basic tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	cpufreq_basic_tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	# remove module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	printf "Removing $1 module\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	rmmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		printf "rmmod $1 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	# There shouldn't be any cpufreq directories now.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	for_each_cpu cpu_should_not_have_cpufreq_directory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) # $1: cpufreq-driver module to insert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) module_driver_test()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	printf "** Test: Running ${FUNCNAME[0]} **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	# check if module is present or not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	ls $1 > /dev/null
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		printf "$1: not present in `pwd` folder\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	# test basic module tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	test_basic_insmod_rmmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	# Do simple module test
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	module_driver_test_single $1 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	# Remove CPUs before inserting module and then bring them back
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	module_driver_test_single $1 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) # find governor name based on governor module name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) # $1: governor module name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) find_gov_name()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	if [ $1 = "cpufreq_ondemand.ko" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		printf "ondemand"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	elif [ $1 = "cpufreq_conservative.ko" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		printf "conservative"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	elif [ $1 = "cpufreq_userspace.ko" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		printf "userspace"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	elif [ $1 = "cpufreq_performance.ko" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		printf "performance"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	elif [ $1 = "cpufreq_powersave.ko" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		printf "powersave"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	elif [ $1 = "cpufreq_schedutil.ko" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		printf "schedutil"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) # $1: governor string, $2: governor module, $3: policy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) # example: module_governor_test_single "ondemand" "cpufreq_ondemand.ko" 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) module_governor_test_single()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	printf "** Test: Running ${FUNCNAME[0]} for $3 **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	backup_governor $3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	# switch to new governor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	printf "Switch from $CUR_GOV to $1\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	switch_show_governor $3 $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	# try removing module, it should fail as governor is used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	printf "Removing $2 module\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	rmmod $2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	if [ $? = 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		printf "WARN: rmmod $2 succeeded even if governor is used\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		insmod $2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		printf "Pass: unable to remove $2 while it is being used\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	# switch back to old governor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	printf "Switchback to $CUR_GOV from $1\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	restore_governor $3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) # Insert cpufreq governor module and perform basic tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) # $1: cpufreq-governor module to insert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) module_governor_test()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	printf "** Test: Running ${FUNCNAME[0]} **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	# check if module is present or not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	ls $1 > /dev/null
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		printf "$1: not present in `pwd` folder\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	# test basic module tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	test_basic_insmod_rmmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	# insert module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	printf "Inserting $1 module\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	insmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		printf "Insmod $1 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	# switch to new governor for each cpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	for_each_policy module_governor_test_single $(find_gov_name $1) $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	# remove module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	printf "Removing $1 module\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	rmmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		printf "rmmod $1 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) # test modules: driver and governor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) # $1: driver module, $2: governor module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) module_test()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	printf "** Test: Running ${FUNCNAME[0]} **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	# check if modules are present or not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	ls $1 $2 > /dev/null
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		printf "$1 or $2: is not present in `pwd` folder\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	# TEST1: Insert gov after driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	# insert driver module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	printf "Inserting $1 module\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	insmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 		printf "Insmod $1 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	# run governor tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	module_governor_test $2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	# remove driver module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	printf "Removing $1 module\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	rmmod $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		printf "rmmod $1 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	# TEST2: Insert driver after governor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	# insert governor module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	printf "Inserting $2 module\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	insmod $2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 		printf "Insmod $2 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	# run governor tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	module_driver_test $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	# remove driver module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	printf "Removing $2 module\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	rmmod $2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	if [ $? != 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		printf "rmmod $2 failed\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) }