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) # protect against multiple inclusion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) if [ $FILE_CPUFREQ ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 	return 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 	FILE_CPUFREQ=DONE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) source cpu.sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) # $1: cpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) cpu_should_have_cpufreq_directory()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 	if [ ! -d $CPUROOT/$1/cpufreq ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 		printf "Warning: No cpufreq directory present for $1\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) cpu_should_not_have_cpufreq_directory()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	if [ -d $CPUROOT/$1/cpufreq ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 		printf "Warning: cpufreq directory present for $1\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) for_each_policy()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	policies=$(ls $CPUFREQROOT| grep "policy[0-9].*")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	for policy in $policies; do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 		$@ $policy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) for_each_policy_concurrent()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	policies=$(ls $CPUFREQROOT| grep "policy[0-9].*")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	for policy in $policies; do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 		$@ $policy &
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) # $1: Path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) read_cpufreq_files_in_dir()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	local files=`ls $1`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	printf "Printing directory: $1\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	for file in $files; do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 		if [ -f $1/$file ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 			printf "$file:"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 			cat $1/$file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 		else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 			printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 			read_cpufreq_files_in_dir "$1/$file"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) read_all_cpufreq_files()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	printf "** Test: Running ${FUNCNAME[0]} **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	read_cpufreq_files_in_dir $CPUFREQROOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	printf "%s\n\n" "------------------------------------------------"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) # UPDATE CPUFREQ FILES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) # $1: directory path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) update_cpufreq_files_in_dir()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	local files=`ls $1`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	printf "Updating directory: $1\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	for file in $files; do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		if [ -f $1/$file ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 			# file is writable ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 			local wfile=$(ls -l $1/$file | awk '$1 ~ /^.*w.*/ { print $NF; }')
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 			if [ ! -z $wfile ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 				# scaling_setspeed is a special file and we
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 				# should skip updating it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 				if [ $file != "scaling_setspeed" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 					local val=$(cat $1/$file)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 					printf "Writing $val to: $file\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 					echo $val > $1/$file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 				fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 			fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 			printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 			update_cpufreq_files_in_dir "$1/$file"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) # Update all writable files with their existing values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) update_all_cpufreq_files()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	printf "** Test: Running ${FUNCNAME[0]} **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	update_cpufreq_files_in_dir $CPUFREQROOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	printf "%s\n\n" "------------------------------------------------"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) # CHANGE CPU FREQUENCIES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) # $1: policy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) find_current_freq()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	cat $CPUFREQROOT/$1/scaling_cur_freq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) # $1: policy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) # $2: frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) set_cpu_frequency()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	printf "Change frequency for $1 to $2\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	echo $2 > $CPUFREQROOT/$1/scaling_setspeed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) # $1: policy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) test_all_frequencies()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	local filepath="$CPUFREQROOT/$1"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	backup_governor $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	local found=$(switch_governor $1 "userspace")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	if [ $found = 1 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		printf "${FUNCNAME[0]}: userspace governor not available for: $1\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	printf "Switched governor for $1 to userspace\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	local freqs=$(cat $filepath/scaling_available_frequencies)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	printf "Available frequencies for $1: $freqs\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	# Set all frequencies one-by-one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	for freq in $freqs; do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		set_cpu_frequency $1 $freq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	printf "\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	restore_governor $1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) # $1: loop count
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) shuffle_frequency_for_all_cpus()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	printf "** Test: Running ${FUNCNAME[0]} for $1 loops **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	for i in `seq 1 $1`; do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		for_each_policy test_all_frequencies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	printf "\n%s\n\n" "------------------------------------------------"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) # Basic cpufreq tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) cpufreq_basic_tests()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	printf "*** RUNNING CPUFREQ SANITY TESTS ***\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	printf "====================================\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	count=$(count_cpufreq_managed_cpus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	if [ $count = 0 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		printf "No cpu is managed by cpufreq core, exiting\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		printf "CPUFreq manages: $count CPUs\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	# Detect & print which CPUs are not managed by cpufreq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	print_unmanaged_cpus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	# read/update all cpufreq files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	read_all_cpufreq_files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	update_all_cpufreq_files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	# hotplug cpus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	reboot_cpus 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	# Test all frequencies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	shuffle_frequency_for_all_cpus 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	# Test all governors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	shuffle_governors_for_all_cpus 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) # Suspend/resume
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) # $1: "suspend" or "hibernate", $2: loop count
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) do_suspend()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	printf "** Test: Running ${FUNCNAME[0]}: Trying $1 for $2 loops **\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	# Is the directory available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	if [ ! -d $SYSFS/power/ -o ! -f $SYSFS/power/state ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 		printf "$SYSFS/power/state not available\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 		return 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	if [ $1 = "suspend" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		filename="mem"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	elif [ $1 = "hibernate" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 		filename="disk"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		printf "$1 is not a valid option\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		return 1
^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) 	if [ -n $filename ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 		present=$(cat $SYSFS/power/state | grep $filename)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 		if [ -z "$present" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 			printf "Tried to $1 but $filename isn't present in $SYSFS/power/state\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 			return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		for i in `seq 1 $2`; do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 			printf "Starting $1\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 			echo $filename > $SYSFS/power/state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 			printf "Came out of $1\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 			printf "Do basic tests after finishing $1 to verify cpufreq state\n\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 			cpufreq_basic_tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 		done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) }