aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisa Nguyen <lisa.nguyen@linaro.org>2014-07-04 10:24:30 +0530
committerSanjay Singh Rawat <sanjay.rawat@linaro.org>2014-07-04 10:29:23 +0530
commite232318568c550f6d1a5f435e93de156985746bf (patch)
treec37e9417a5c7929180cc7282c059702d61a25bba
parentfb5116ed247c3f15cba9c5d1b915468d8c168d27 (diff)
cpuhotplug: enable cpuhotplug on cpu0
By default, cpuhotplug does not run on cpu0. However, if we want to allow cpuhotplug to run on cpu0, then we must pass the parameter, hotplug_allow_cpu0=1, to make check. Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org> Reported-by: Milosz Wasilewski <milosz.wasilewski@linaro.org> Acked-by: Amit Kucheria <amit.kucheria@linaro.org>
-rw-r--r--Makefile4
-rw-r--r--cpuhotplug/Makefile2
-rwxr-xr-xcpuhotplug/cpuhotplug_02.sh2
-rwxr-xr-xcpuhotplug/cpuhotplug_03.sh2
-rwxr-xr-xcpuhotplug/cpuhotplug_04.sh2
-rwxr-xr-xcpuhotplug/cpuhotplug_05.sh2
-rwxr-xr-xcpuhotplug/cpuhotplug_06.sh2
-rwxr-xr-xcpuhotplug/cpuhotplug_07.sh2
-rwxr-xr-xcpuhotplug/cpuhotplug_08.sh6
-rw-r--r--include/functions.sh20
10 files changed, 30 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 731619d..d76deb7 100644
--- a/Makefile
+++ b/Makefile
@@ -21,14 +21,14 @@
# Torez Smith <torez.smith@linaro.org> (IBM Corporation)
# - initial API and implementation
#
-
+hotplug_allow_cpu0?=0
all:
@(cd utils; $(MAKE))
check:
@(cd utils; $(MAKE) check)
@(cd cpufreq; $(MAKE) check)
- @(cd cpuhotplug; $(MAKE) check)
+ @(cd cpuhotplug; $(MAKE) hotplug_allow_cpu0=${hotplug_allow_cpu0} check)
@(cd cpuidle; $(MAKE) check)
# @(cd suspend; $(MAKE) check)
@(cd thermal; $(MAKE) check)
diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile
index df0b8f4..6ee600d 100644
--- a/cpuhotplug/Makefile
+++ b/cpuhotplug/Makefile
@@ -21,5 +21,5 @@
# Daniel Lezcano <daniel.lezcano@linaro.org> (IBM Corporation)
# - initial API and implementation
#
-
+export hotplug_allow_cpu0?=0
include ../Test.mk
diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh
index 3157307..d2bb5b4 100755
--- a/cpuhotplug/cpuhotplug_02.sh
+++ b/cpuhotplug/cpuhotplug_02.sh
@@ -34,7 +34,7 @@ check_state() {
shift 1
if [ "$cpu" == "cpu0" ]; then
- return 0
+ is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
fi
set_offline $cpu
diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh
index 13a0ce9..2a5ae48 100755
--- a/cpuhotplug/cpuhotplug_03.sh
+++ b/cpuhotplug/cpuhotplug_03.sh
@@ -34,7 +34,7 @@ check_affinity_fails() {
local ret=
if [ "$cpu" == "cpu0" ]; then
- return 0
+ is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
fi
set_offline $cpu
diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh
index 394a512..7938e7d 100755
--- a/cpuhotplug/cpuhotplug_04.sh
+++ b/cpuhotplug/cpuhotplug_04.sh
@@ -37,7 +37,7 @@ check_task_migrate() {
local ret=
if [ "$cpu" == "cpu0" ]; then
- return 0
+ is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
fi
taskset 0x$cpumask $CPUBURN $cpu &
diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh
index a8eb312..4042f2c 100755
--- a/cpuhotplug/cpuhotplug_05.sh
+++ b/cpuhotplug/cpuhotplug_05.sh
@@ -33,7 +33,7 @@ check_procinfo() {
local ret=
if [ "$cpu" == "cpu0" ]; then
- return 0
+ is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
fi
set_offline $cpu
diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh
index 347906d..0461e37 100755
--- a/cpuhotplug/cpuhotplug_06.sh
+++ b/cpuhotplug/cpuhotplug_06.sh
@@ -33,7 +33,7 @@ check_procinfo() {
local ret=
if [ "$cpu" == "cpu0" ]; then
- return 0
+ is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
fi
set_offline $cpu
diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh
index eaeba77..a3526be 100755
--- a/cpuhotplug/cpuhotplug_07.sh
+++ b/cpuhotplug/cpuhotplug_07.sh
@@ -35,7 +35,7 @@ check_notification() {
local ret=
if [ "$cpu" == "cpu0" ]; then
- return 0
+ is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
fi
# damn ! udevadm is buffering the output, we have to use a temp file
diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh
index 9e2c355..00315a4 100755
--- a/cpuhotplug/cpuhotplug_08.sh
+++ b/cpuhotplug/cpuhotplug_08.sh
@@ -28,7 +28,11 @@
source ../include/functions.sh
function randomize() {
- echo $[ ( $RANDOM % $1 ) + 1 ]
+ if [ $hotplug_allow_cpu0 -eq 0 ]; then
+ echo $[ ( $RANDOM % $1 ) + 1 ]
+ else
+ echo $[ ( $RANDOM % $1 ) ]
+ fi
}
random_stress() {
diff --git a/include/functions.sh b/include/functions.sh
index 6d75e34..dd716ef 100644
--- a/include/functions.sh
+++ b/include/functions.sh
@@ -285,10 +285,12 @@ check_cpuhotplug_files() {
shift 1
for i in $@; do
- # skip check for cpu0
- if [ `echo $dirpath | grep -c "cpu0"` -eq 1 ]; then
- continue
- fi
+ if [ `echo $dirpath | grep -c "cpu0"` -eq 1 ]; then
+ if [ $hotplug_allow_cpu0 -eq 0 ]; then
+ continue
+ fi
+ fi
+
check_file $i $dirpath || return 1
done
@@ -372,3 +374,13 @@ is_root() {
fi
return $ret
}
+
+is_cpu0_hotplug_allowed() {
+ local status=$1
+
+ if [ $status -eq 1 ]; then
+ return 0
+ else
+ return 1
+ fi
+}