[PATCH powerdebug] Check null pointer before dereferencing

2014-06-25 Thread Salman Ahmed
Fixes the below issue:
 - check if pointer t is null before de-referencing

diff --git a/gpio.c b/gpio.c
index 39480b0..5db17e7 100644
--- a/gpio.c
+++ b/gpio.c
@@ -273,9 +273,11 @@ static int gpio_display(bool refresh)
 static int gpio_change(int keyvalue)
 {
struct tree *t = display_get_row_data(GPIO);
-   struct gpio_info *gpio = t->private;
+   if (!t)
+   return -1;

-   if (!t || !gpio)
+   struct gpio_info *gpio = t->private;
+   if (!gpio)
return -1;

switch (keyvalue) {


-- 
Thanks,
Salman Ahmed

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Test Result Summary of Linux Linaro ubuntu 14.06 Release.

2014-06-25 Thread Botao Sun
Linaro 14.06 Release (Calendar Week 26): Here is test result summary for
Linux Linaro ubuntu Trusty image on following boards:

1) Samsung Arndale;
2) TI Panda 4430;
3) TI Panda 4460.

1. Samsung Arndale + Linux Linaro Trusty (Column BB):

https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AgB-fT5LL31CdGZJSFdTUWFFYVdhZl8wMFpxLXd2TXc#gid=0

2. TI Panda 4430 + Linux Linaro Trusty (Column BI):

https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEwwZkhrZ1VYUEg2LTlQZzR0RlhzM3c#gid=3

3. TI Panda 4460 + Linux Linaro Trusty (Column BI):

https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEwwZkhrZ1VYUEg2LTlQZzR0RlhzM3c#gid=4

For consolidated test result spreadsheet, please visit this link below:

https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AgB-fT5LL31CdDdWZ1JJYWFITGt0dlpQVEFnRjc1Umc&usp=drive_web#gid=11

Thank you.


Best Regards
Botao Sun
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-06-25 Thread Sanjay Singh Rawat

hi Lisa,

Can we have this in way like, mask for cpuhotplug. I believe out
of cpu0-N one will be permanent. We can pass it like cpu_hotplug_mask=cpuX
and skip hotplugging that specific cpu only.

On Wednesday 25 June 2014 09:48 AM, Lisa Nguyen wrote:

Pass hotplug_cpu_start=0 to make check like
these examples below:

sudo make -C cpuhotplug hotplug_cpu_start=0 check
sudo make hotplug_cpu_start=0 check

to enable cpuhotplug to run on cpu0 to N.

The hotplug_cpu_start variable will take the default
value of 1 if no value is passed so cpuhotplug will
run on cpu1 to N.

This fixes bug #49:
https://bugs.linaro.org/show_bug.cgi?id=49

Signed-off-by: Lisa Nguyen 
---
  Makefile|4 +++-
  cpuhotplug/Makefile |2 +-
  cpuhotplug/cpuhotplug_02.sh |2 +-
  cpuhotplug/cpuhotplug_03.sh |2 +-
  cpuhotplug/cpuhotplug_04.sh |2 +-
  cpuhotplug/cpuhotplug_05.sh |2 +-
  cpuhotplug/cpuhotplug_06.sh |2 +-
  cpuhotplug/cpuhotplug_07.sh |2 +-
  cpuhotplug/cpuhotplug_08.sh |6 +-
  9 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 731619d..24bbd59 100644
--- a/Makefile
+++ b/Makefile
@@ -22,13 +22,15 @@
  #   - initial API and implementation
  #
  
+hotplug_cpu_start?=1

+
  all:
@(cd utils; $(MAKE))
  
  check:

@(cd utils; $(MAKE) check)
@(cd cpufreq; $(MAKE) check)
-   @(cd cpuhotplug; $(MAKE) check)
+   @(cd cpuhotplug; $(MAKE) hotplug_cpu_start=${hotplug_cpu_start} check)
@(cd cpuidle; $(MAKE) check)
  # @(cd suspend; $(MAKE) check)
@(cd thermal; $(MAKE) check)
diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile
index df0b8f4..a6670c3 100644
--- a/cpuhotplug/Makefile
+++ b/cpuhotplug/Makefile
@@ -21,5 +21,5 @@
  # Daniel Lezcano  (IBM Corporation)
  #   - initial API and implementation
  #
-
+export hotplug_cpu_start?=1
  include ../Test.mk
diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh
index 3157307..3f678b9 100755
--- a/cpuhotplug/cpuhotplug_02.sh
+++ b/cpuhotplug/cpuhotplug_02.sh
@@ -33,7 +33,7 @@ check_state() {
  local state=
  shift 1
  
-if [ "$cpu" == "cpu0" ]; then

+if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
return 0
  fi
  
diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh

index 13a0ce9..57ff40e 100755
--- a/cpuhotplug/cpuhotplug_03.sh
+++ b/cpuhotplug/cpuhotplug_03.sh
@@ -33,7 +33,7 @@ check_affinity_fails() {
  local dirpath=$CPU_PATH/$1
  local ret=
  
-if [ "$cpu" == "cpu0" ]; then

+if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
return 0
  fi
  
diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh

index 394a512..9c08fba 100755
--- a/cpuhotplug/cpuhotplug_04.sh
+++ b/cpuhotplug/cpuhotplug_04.sh
@@ -36,7 +36,7 @@ check_task_migrate() {
  local pid=
  local ret=
  
-if [ "$cpu" == "cpu0" ]; then

+if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
return 0
  fi
  
diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh

index a8eb312..f5eb994 100755
--- a/cpuhotplug/cpuhotplug_05.sh
+++ b/cpuhotplug/cpuhotplug_05.sh
@@ -32,7 +32,7 @@ check_procinfo() {
  local cpuid=${cpu:3}
  local ret=
  
-if [ "$cpu" == "cpu0" ]; then

+if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
return 0
  fi
  
diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh

index 347906d..93fbadd 100755
--- a/cpuhotplug/cpuhotplug_06.sh
+++ b/cpuhotplug/cpuhotplug_06.sh
@@ -32,7 +32,7 @@ check_procinfo() {
  local cpuid=${cpu:3}
  local ret=
  
-if [ "$cpu" == "cpu0" ]; then

+if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
return 0
  fi
  
diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh

index eaeba77..2457891 100755
--- a/cpuhotplug/cpuhotplug_07.sh
+++ b/cpuhotplug/cpuhotplug_07.sh
@@ -34,7 +34,7 @@ check_notification() {
  local pid=
  local ret=
  
-if [ "$cpu" == "cpu0" ]; then

+if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
return 0
  fi
  
diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh

index 9e2c355..52e1fc2 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_cpu_start -ne 0 ]; then
+   echo $[ ( $RANDOM % $1 )  + 1 ]
+else
+   echo $[ ( $RANDOM % $1 ) ]
+fi
  }
  
  random_stress() {


--
sanjay

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-06-25 Thread Milosz Wasilewski
On 25 June 2014 15:39, Sanjay Singh Rawat  wrote:
> hi Lisa,
>
> Can we have this in way like, mask for cpuhotplug. I believe out
> of cpu0-N one will be permanent. We can pass it like cpu_hotplug_mask=cpuX

Sanjay,
Do you mean that one CPU will not be tested always? I don't think this
assumption is correct. You only need to make sure you don't unplug all
CPUs at the same time. IMHO all CPUs should be checked if user wishes
to do so.

milosz

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-06-25 Thread Sanjay Singh Rawat


On Wednesday 25 June 2014 08:13 PM, Milosz Wasilewski wrote:

On 25 June 2014 15:39, Sanjay Singh Rawat  wrote:

hi Lisa,

Can we have this in way like, mask for cpuhotplug. I believe out
of cpu0-N one will be permanent. We can pass it like cpu_hotplug_mask=cpuX

Sanjay,
Do you mean that one CPU will not be tested always? I don't think this
assumption is correct. You only need to make sure you don't unplug all
CPUs at the same time. IMHO all CPUs should be checked if user wishes
to do so.


Milosz,

Yes i meant that. Hmm, i think i am missing the understanding here. So 
now all cpu are hotpluggable?


milosz


--
sanjay


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-06-25 Thread Amit Kucheria
On Wed, Jun 25, 2014 at 8:21 PM, Sanjay Singh Rawat
 wrote:
> Milosz,
>
> Yes i meant that. Hmm, i think i am missing the understanding here. So now
> all cpu are hotpluggable?

Technically any cpu can be hotpluggable. But you need to have atleast
one plugged in at anytime else there won't be a kernel left ;)

But some platforms had constraints preventing cpu0 from being
hotplugged, hence the initial constraint in the scripts. We now want
to allow cpu0 to be hotplugged as well so that we can test platforms
where such a constraint no longer exists.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-06-25 Thread Sanjay Singh Rawat


On Wednesday 25 June 2014 08:38 PM, Amit Kucheria wrote:

On Wed, Jun 25, 2014 at 8:21 PM, Sanjay Singh Rawat
 wrote:

Milosz,

Yes i meant that. Hmm, i think i am missing the understanding here. So now
all cpu are hotpluggable?

Technically any cpu can be hotpluggable. But you need to have atleast
one plugged in at anytime else there won't be a kernel left ;)

But some platforms had constraints preventing cpu0 from being


this was the doubt, thanks for the clarification Amit

hotplugged, hence the initial constraint in the scripts. We now want
to allow cpu0 to be hotplugged as well so that we can test platforms
where such a constraint no longer exists.


--
sanjay


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev