Switch Android builds over to use the tip toolchain

2011-10-03 Thread Chao Yang
Hi,

In order to switch to the new toolchain in each cycle more smoothly, it's
been decided that Android builds will be using the tip toolchain until the
formal toolchain is released in every month. The toolchain 4.6 daily build
has already been setup, which can be found in
https://android-build.linaro.org/builds/~linaro-android/toolchain-4.6-bzr/.
Since
Android 1109 has already been successfully released with toolchain 1109 and
the new cycle has already started, the android builds will switch to use the
tip toolchain from now on. The toolchain for the following builds have been
switched to the tip toolchain. Should you have any problems, please feel
free to let me know. Thanks.

staging-snowball
staging-panda
staging-origen
staging-imx53
panda
beagle

Best regards
-- 

Chao Yang
Android Platform Team
Linaro.org │ Open source software for ARM SoCs
Follow Linaro:
http://www.facebook.com/pages/Linaro/155974581091106
http://twitter.com/#!/linaroorg
http://www.linaro.org/linaro-blog/
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH v2 1/7] clk: Add a generic clock infrastructure

2011-10-03 Thread Turquette, Mike
On Mon, Oct 3, 2011 at 3:02 PM, Rob Herring  wrote:
> Mike,
>
> On 09/22/2011 05:26 PM, Mike Turquette wrote:
>
>> diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
>> index 6db161f..e2a9719 100644
>> --- a/drivers/clk/clkdev.c
>> +++ b/drivers/clk/clkdev.c
>> @@ -23,6 +23,13 @@
>>  static LIST_HEAD(clocks);
>>  static DEFINE_MUTEX(clocks_mutex);
>>
>> +/* For USE_COMMON_STRUCT_CLK, these are provided in clk.c, but not exported
>> + * through other headers; we don't want them used anywhere but here. */
>> +#ifdef CONFIG_USE_COMMON_STRUCT_CLK
>> +extern int __clk_get(struct clk *clk);
>> +extern void __clk_put(struct clk *clk);
>> +#endif
>> +
>
> This is dead code left from prior versions.

Indeed it is.  Will pull it out for V3.

Thanks,
Mike

> Rob
>

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


Re: [PATCH v2 1/7] clk: Add a generic clock infrastructure

2011-10-03 Thread Rob Herring
Mike,

On 09/22/2011 05:26 PM, Mike Turquette wrote:

> diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
> index 6db161f..e2a9719 100644
> --- a/drivers/clk/clkdev.c
> +++ b/drivers/clk/clkdev.c
> @@ -23,6 +23,13 @@
>  static LIST_HEAD(clocks);
>  static DEFINE_MUTEX(clocks_mutex);
>  
> +/* For USE_COMMON_STRUCT_CLK, these are provided in clk.c, but not exported
> + * through other headers; we don't want them used anywhere but here. */
> +#ifdef CONFIG_USE_COMMON_STRUCT_CLK
> +extern int __clk_get(struct clk *clk);
> +extern void __clk_put(struct clk *clk);
> +#endif
> +

This is dead code left from prior versions.

Rob

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


Re: BUGREPORTED work item state

2011-10-03 Thread James Westby
On Sun, 2 Oct 2011 21:48:55 -0500, Zach Pfeffer  wrote:
> > 2. do we need to update
> > https://wiki.linaro.org/Process/WorkItemsHowto#Work_items_in_the_whiteboard
> > ?
> 
> I think we should. BUGREPORTED seemed to fill a void as David and I
> were going through each item that the other fields didn't. For
> reference:

Updating the wiki page isn't all that needs to happen.

Any unknown statuses are treated by status.linaro.org as TODO, and a
warning is generated to alert people to check whether that is correct
and act accordingly.

If we want to use BUGREPORTED then the code will have to be changed to
understand that (and map it to an existing status probably) so that the
workitem counts are correct, and the warning is no longer generated.

Thanks,

James

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


Re: [PATCH v2 1/7] clk: Add a generic clock infrastructure

2011-10-03 Thread Mark Brown
On Mon, Oct 03, 2011 at 05:43:09PM +0100, Russell King - ARM Linux wrote:
> On Mon, Oct 03, 2011 at 05:31:08PM +0100, Mark Brown wrote:

[Not being many off-SoC clocks]
> > I dunno, I get the impression that some of this is due to the current
> > limitations of the clock API rather than due to a lack of clocks -
> > perhaps that's specific to the applications I look at, though.
> > applications 

> The clk API per-se has nothing to do with how clocks are registered.
> There are two things that are the clk API:

Right, it's consumer side only which is the limitation I'm talking about
- at the minute it's only possible to use the clk API for on-SoC clocks
(or at least clocks that the SoC cares about), we don't have a clock API
for cross platform clock providers.  I don't know if getting a cross
platform implementation will change that situation much.

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


Re: [PATCH v2 1/7] clk: Add a generic clock infrastructure

2011-10-03 Thread Russell King - ARM Linux
On Mon, Oct 03, 2011 at 05:31:08PM +0100, Mark Brown wrote:
> I dunno, I get the impression that some of this is due to the current
> limitations of the clock API rather than due to a lack of clocks -
> perhaps that's specific to the applications I look at, though.
> applications 

The clk API per-se has nothing to do with how clocks are registered.
There are two things that are the clk API:

1. clkdev - which deals with translating devices + connection IDs to
   struct clk.  This has no ordering requirements wrt requiring
   parents to be "initialized" before their children (it has no care
   about that at all because it's not within its definition.)

   For this, registration is about connecting device + connection IDs
   to a struct clk.

2. the driver API, defining how the opaque struct clk is looked up,
   obtained and then manipulated.  This has no 'registration' stuff.

So, whether clocks are a tree or flat is unspecified.  It's unspecified
whether there's any particular order required.

In fact, with a clock tree, it's entirely possible that only the leaf
clocks will be 'registered' with clkdev.  How the rest of the clock tree
is initialized is beyond the scope of the driver clk API.

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


Re: [PATCH v2 1/7] clk: Add a generic clock infrastructure

2011-10-03 Thread Mark Brown
On Mon, Oct 03, 2011 at 10:24:52AM -0500, Rob Herring wrote:
> On 10/03/2011 09:25 AM, Mark Brown wrote:

> > This isn't in any way specific to clocks, right now the likely solution
> > looks to be Grant's changes for retrying probe() as new devices come on
> > line.  With that devices can return a code from their probe() which
> > tells the driver core that they couldn't get all the resources they need
> > and that it should retry the probe() if more devices come on-line.

> Except SOC clocks are initialized very early before timers are up and
> there can be a very high number of dependencies (every clock except
> fixed clocks). With the driver probe retry, retrying is the exception,
> not the rule.

> Retrying would require every caller to maintain a list of clks to
> retry. With 2 stages, you can move that into the core clock code.

They don't need to maintain a list of clocks to retry, they need to
unwind when probe() fails.  But yes.

> There are not typically a large number of board-level/driver created
> clocks, so ensuring correct register order is not really a problem. In
> cases where there is a cross-driver dependency, the probe retry is a
> good solution.

I dunno, I get the impression that some of this is due to the current
limitations of the clock API rather than due to a lack of clocks -
perhaps that's specific to the applications I look at, though.
applications 

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


Re: debuild & no secret keys

2011-10-03 Thread Tom Gall
Thanks for the help everyone. It was the .devscripts file that I
hadn't copied over which as it turned out was specifying which key was
to be used through DEBSIGN_KEYID.  It's always the simple things!

On Sun, Oct 2, 2011 at 4:40 PM, James Westby  wrote:
> On Fri, 30 Sep 2011 16:20:12 -0500, Tom Gall  wrote:
>> Hi All,
>>
>> I'm setting up a new machine and I'm guessing I must have missed a
>> step or a file.
>>
>> When I debuild -S -sa it's complaining about my secret key not being found.
>>
>> gpg: skipped "Tom Gall ": secret key not available
>> gpg: /tmp/debsign.Or3BKbui/live-build_3.0~a21-1linaro9~natty1.dsc:
>> clearsign failed: secret key not available
>> debsign: gpg error occurred!  Aborting
>>
>>
>> Yet if I gpg -k on both a "good" machine and this new box I see the
>> exact same set of keys listed.
>
> https://wiki.ubuntu.com/UbuntuDevelopment/Uploading#Signing_the_package
>
> has some tips on debugging this sort of thing that may help you.
>
> Thanks,
>
> James
>

-- 
Regards,
Tom

"We want great men who, when fortune frowns will not be discouraged."
- Colonel Henry Knox
Linaro.org │ Open source software for ARM SoCs
w) tom.gall att linaro.org
w) tom_gall att vnet.ibm.com
h) tom_gall att mac.com

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


Re: [PATCH v2 1/7] clk: Add a generic clock infrastructure

2011-10-03 Thread Rob Herring
On 10/03/2011 09:25 AM, Mark Brown wrote:
> On Mon, Oct 03, 2011 at 09:17:30AM -0500, Rob Herring wrote:
>> On 09/22/2011 05:26 PM, Mike Turquette wrote:
> 
> A lot of stuff that should really have been cut plus...
> 
>>> +   if (clk->ops->get_parent)
>>> +   /* We don't to lock against prepare/enable here, as
>>> +* the clock is not yet accessible from anywhere */
>>> +   clk->parent = clk->ops->get_parent(clk->hw);
> 
>> I don't think this is going to work. This implies that the parent clock
>> is already registered. For simple clk trees, that's probably not an
>> issue, but for chips with lots of muxing it will be impossible to get
>> the order correct for all cases. This is not an issue today as most
>> clocks are statically created.
> 
>> I think what is needed is a 2 stage init. The 1st stage to create all
>> the clocks and a 2nd stage to build the tree once all clocks are created.
> 
>> Tracking the parents using struct clk_hw instead would help as long as
>> clocks are still statically allocated. However, that won't help for
>> devicetree.
> 
> This isn't in any way specific to clocks, right now the likely solution
> looks to be Grant's changes for retrying probe() as new devices come on
> line.  With that devices can return a code from their probe() which
> tells the driver core that they couldn't get all the resources they need
> and that it should retry the probe() if more devices come on-line.

Except SOC clocks are initialized very early before timers are up and
there can be a very high number of dependencies (every clock except
fixed clocks). With the driver probe retry, retrying is the exception,
not the rule.

Retrying would require every caller to maintain a list of clks to
retry. With 2 stages, you can move that into the core clock code.

There are not typically a large number of board-level/driver created
clocks, so ensuring correct register order is not really a problem. In
cases where there is a cross-driver dependency, the probe retry is a
good solution.

Rob

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


Re: [PATCH v2 1/7] clk: Add a generic clock infrastructure

2011-10-03 Thread Mark Brown
On Mon, Oct 03, 2011 at 09:17:30AM -0500, Rob Herring wrote:
> On 09/22/2011 05:26 PM, Mike Turquette wrote:

A lot of stuff that should really have been cut plus...

> > +   if (clk->ops->get_parent)
> > +   /* We don't to lock against prepare/enable here, as
> > +* the clock is not yet accessible from anywhere */
> > +   clk->parent = clk->ops->get_parent(clk->hw);

> I don't think this is going to work. This implies that the parent clock
> is already registered. For simple clk trees, that's probably not an
> issue, but for chips with lots of muxing it will be impossible to get
> the order correct for all cases. This is not an issue today as most
> clocks are statically created.

> I think what is needed is a 2 stage init. The 1st stage to create all
> the clocks and a 2nd stage to build the tree once all clocks are created.

> Tracking the parents using struct clk_hw instead would help as long as
> clocks are still statically allocated. However, that won't help for
> devicetree.

This isn't in any way specific to clocks, right now the likely solution
looks to be Grant's changes for retrying probe() as new devices come on
line.  With that devices can return a code from their probe() which
tells the driver core that they couldn't get all the resources they need
and that it should retry the probe() if more devices come on-line.

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


Re: [PATCH v2 1/7] clk: Add a generic clock infrastructure

2011-10-03 Thread Rob Herring
On 09/22/2011 05:26 PM, Mike Turquette wrote:
> From: Jeremy Kerr 
> 
> We currently have ~21 definitions of struct clk in the ARM architecture,
> each defined on a per-platform basis. This makes it difficult to define
> platform- (or architecture-) independent clock sources without making
> assumptions about struct clk, and impossible to compile two
> platforms with different struct clks into a single image.
> 
> This change is an effort to unify struct clk where possible, by defining
> a common struct clk, and a set of clock operations. Different clock
> implementations can set their own operations, and have a standard
> interface for generic code. The callback interface is exposed to the
> kernel proper, while the clock implementations only need to be seen by
> the platform internals.
> 
> The interface is split into two halves:
> 
>  * struct clk, which is the generic-device-driver interface. This
>provides a set of functions which drivers may use to request
>enable/disable, query or manipulate in a hardware-independent manner.
> 
>  * struct clk_hw and struct clk_hw_ops, which is the hardware-specific
>interface. Clock drivers implement the ops, which allow the core
>clock code to implement the generic 'struct clk' API.
> 
> This allows us to share clock code among platforms, and makes it
> possible to dynamically create clock devices in platform-independent
> code.
> 
> Platforms can enable the generic struct clock through
> CONFIG_GENERIC_CLK. In this case, the clock infrastructure consists of a
> common, opaque struct clk, and a set of clock operations (defined per
> type of clock):
> 
>   struct clk_hw_ops {
>   int (*prepare)(struct clk_hw *);
>   void(*unprepare)(struct clk_hw *);
>   int (*enable)(struct clk_hw *);
>   void(*disable)(struct clk_hw *);
>   unsigned long   (*recalc_rate)(struct clk_hw *);
>   int (*set_rate)(struct clk_hw *,
>   unsigned long, unsigned long *);
>   long(*round_rate)(struct clk_hw *, unsigned long);
>   int (*set_parent)(struct clk_hw *, struct clk *);
>   struct clk *(*get_parent)(struct clk_hw *);
>   };
> 
> Platform clock code can register a clock through clk_register, passing a
> set of operations, and a pointer to hardware-specific data:
> 
>   struct clk_hw_foo {
>   struct clk_hw clk;
>   void __iomem *enable_reg;
>   };
> 
>   #define to_clk_foo(c) offsetof(c, clk_hw_foo, clk)
> 
>   static int clk_foo_enable(struct clk_hw *clk)
>   {
>   struct clk_foo *foo = to_clk_foo(clk);
>   raw_writeb(foo->enable_reg, 1);
>   return 0;
>   }
> 
>   struct clk_hw_ops clk_foo_ops = {
>   .enable = clk_foo_enable,
>   };
> 
> And in the platform initialisation code:
> 
>   struct clk_foo my_clk_foo;
> 
>   void init_clocks(void)
>   {
>   my_clk_foo.enable_reg = ioremap(...);
> 
>   clk_register(&clk_foo_ops, &my_clk_foo, NULL);
>   }
> 
> Changes from Thomas Gleixner .
> 
> The common clock definitions are based on a development patch from Ben
> Herrenschmidt .
> 
> TODO:
> 
>  * We don't keep any internal reference to the clock topology at present.
> 
> Signed-off-by: Jeremy Kerr 
> Signed-off-by: Thomas Gleixner 
> Signed-off-by: Mark Brown 
> Signed-off-by: Mike Turquette 
> ---
> Changes since v1:
> Create a dummy clk_unregister and prototype/document it and clk_register
> Constify struct clk_hw_ops
> Remove spinlock.h header, include kernel.h
> Use EOPNOTSUPP instead of ENOTSUPP
> Add might_sleep to clk_prepare/clk_unprepare stubs
> Properly init children hlist and child_node
> Whitespace and typo fixes
> 
>  drivers/clk/Kconfig  |3 +
>  drivers/clk/Makefile |1 +
>  drivers/clk/clk.c|  232 
> ++
>  drivers/clk/clkdev.c |7 ++
>  include/linux/clk.h  |  140 +++---
>  5 files changed, 371 insertions(+), 12 deletions(-)
>  create mode 100644 drivers/clk/clk.c
> 
> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> index 3530927..c53ed59 100644
> --- a/drivers/clk/Kconfig
> +++ b/drivers/clk/Kconfig
> @@ -5,3 +5,6 @@ config CLKDEV_LOOKUP
>  
>  config HAVE_MACH_CLKDEV
>   bool
> +
> +config GENERIC_CLK
> + bool
> diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
> index 07613fa..570d5b9 100644
> --- a/drivers/clk/Makefile
> +++ b/drivers/clk/Makefile
> @@ -1,2 +1,3 @@
>  
>  obj-$(CONFIG_CLKDEV_LOOKUP)  += clkdev.o
> +obj-$(CONFIG_GENERIC_CLK)+= clk.o
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> new file mode 100644
> index 000..1cd7315
> --- /dev/null
> +++ b/drivers/clk/clk.c
> @@ -0,0 +1,232 @@
> +/*
> + * Copyright (C) 2010-2011 Canonical Ltd 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foun

[pm-qa] do sanity check before jumping in the next tests

2011-10-03 Thread Daniel Lezcano
Check all the cpus are online before the tests
Check all the cpus are back online after the tests.

Signed-off-by: Daniel Lezcano 
---
 cpuhotplug/1_sanity_check.sh  |   39 +++
 cpuhotplug/1_sanity_check.txt |1 +
 cpuhotplug/z_sanity_check.sh  |   39 +++
 cpuhotplug/z_sanity_check.txt |1 +
 4 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 cpuhotplug/1_sanity_check.sh
 create mode 100644 cpuhotplug/1_sanity_check.txt
 create mode 100644 cpuhotplug/z_sanity_check.sh
 create mode 100644 cpuhotplug/z_sanity_check.txt

diff --git a/cpuhotplug/1_sanity_check.sh b/cpuhotplug/1_sanity_check.sh
new file mode 100644
index 000..50ebbcc
--- /dev/null
+++ b/cpuhotplug/1_sanity_check.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# PM-QA validation test suite for the power management on Linux
+#
+# Copyright (C) 2011, Linaro Limited.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
+#
+# Contributors:
+# Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL :
+
+source ../include/functions.sh
+
+sanity_check() {
+   local ret=$(cat $CPU_PATH/offline)
+   if [ -z "$ret" ]; then
+   return 0
+   else
+   return 1
+   fi
+}
+
+check "all cpu are online" "sanity_check"
diff --git a/cpuhotplug/1_sanity_check.txt b/cpuhotplug/1_sanity_check.txt
new file mode 100644
index 000..8930419
--- /dev/null
+++ b/cpuhotplug/1_sanity_check.txt
@@ -0,0 +1 @@
+ensure all the cpus are online before the tests
diff --git a/cpuhotplug/z_sanity_check.sh b/cpuhotplug/z_sanity_check.sh
new file mode 100644
index 000..43051ac
--- /dev/null
+++ b/cpuhotplug/z_sanity_check.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# PM-QA validation test suite for the power management on Linux
+#
+# Copyright (C) 2011, Linaro Limited.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
+#
+# Contributors:
+# Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL :
+
+source ../include/functions.sh
+
+sanity_check() {
+   local ret=$(cat $CPU_PATH/offline)
+   if [ -z "$ret" ]; then
+   return 0
+   else
+   return 1
+   fi
+}
+
+check "all cpu are back online" "sanity_check"
diff --git a/cpuhotplug/z_sanity_check.txt b/cpuhotplug/z_sanity_check.txt
new file mode 100644
index 000..2b6c2fa
--- /dev/null
+++ b/cpuhotplug/z_sanity_check.txt
@@ -0,0 +1 @@
+ensure all the cpus are online when the tests are finished
-- 
1.7.1


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


Re: [pm-qa] change header to specify 'on Linux'

2011-10-03 Thread Daniel Lezcano
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/03/2011 11:32 AM, Amit Kucheria wrote:
> Ack
> 

Applied.

- -- 
  Linaro.org ? Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOiaN5AAoJEAKBbMCpUGYATFMH/2gkuvdwNGuFm6Q0tcZMhEXy
BmobiT+jA+Lsx9T2C+qA5kooklMXfqNlJSuU3TgP2OT9TqpWqr2Tp9S1sVy48cEI
BY5ygcdXwZRsvLMByrK3TxIOr6EQqBtSETE/r5QpJwYzypGCyZHqdpOBNDLCeEYJ
32YrkT0B91mOJfvnxvWZ8eIoWMJGUpBr4WUW5FnCAKs4eSdoGk/X6US+miq2Bsfj
4q1/mQJnuMgEfiW4HUiibitHvon6zcvl00PujkyagutEHmszLFNK9BcBo/luJNsa
fMBYHsduSD6J0w6ev2UtIU/UXGbeTWZ5ivopz7ue5xeL6nJRtbpIa1ZY9hvEqh8=
=toDi
-END PGP SIGNATURE-

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


Re: [pm-qa 02/10] add the makefile for cpuhotplug

2011-10-03 Thread Daniel Lezcano
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/03/2011 10:39 AM, Amit Kucheria wrote:
> On Mon, Oct 3, 2011 at 11:18 AM, Daniel Lezcano
>  wrote:
>> Signed-off-by: Daniel Lezcano > ---

[ ... ]

> Otherwise, ack for the patchset.

All patchset applied.

Thanks
  -- Daniel

- -- 
  Linaro.org ? Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOiaNbAAoJEAKBbMCpUGYAzu4IAKkKVL2/beHajl5f4HFm+E0B
oMyMoTQiGuupkyn/oQDr8GEpuQDTbJn6FOA7toIKAeXk4X307IxpCJ/jtDAqEBMz
sxLZiatSZvEtmi1p4Ay1K7KRb6lVbk3XXMUCvMtBFsnW+MqmvLsgJDg67RkKL/9r
ajCuVFppqJOW8LxMK+7JOqD82jSVNNkYLRcScTqmQLqtwGZhb4UY3MBwx/VvTmfl
8YhrSL5Twb6thA7MEtZRTJ2eBT3LRqLtst92HqPpzwfKCbEH91IjqKxlhdy5W23n
pos9v7OQ1MjAMg+Byi9sY77Usqn+CsPlQ+TSHDtAZ6PZ0dSe00YxydoHvvAaoDM=
=r95h
-END PGP SIGNATURE-

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


Re: [PATCH] ARM: S3C2410: Remove section mismatch warning

2011-10-03 Thread Tushar Behera

Hi Russell,

On Monday 03 October 2011 03:29 PM, Russell King - ARM Linux wrote:

On Mon, Oct 03, 2011 at 03:10:41PM +0530, Tushar Behera wrote:

Some of the functions and structures did not have _init or __initdata
attributes, even though they were referenced from functions / structures
with those attribute, resulting in section mismatches.


Firstly - it's a good idea to include the warnings which you're fixing
in the commit log text, so that people know exactly what is being fixed.


Thanks for your review.

Sure, I will add it in next revision.

[ snip ]


diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c
index 28ad20d..153cb2f 100644
--- a/arch/arm/mach-s3c2416/irq.c
+++ b/arch/arm/mach-s3c2416/irq.c
@@ -234,7 +234,7 @@ static int __init s3c2416_irq_add(struct sys_device *sysdev)
return 0;
  }

-static struct sysdev_driver s3c2416_irq_driver = {
+static struct sysdev_driver s3c2416_irq_driver __initdata = {
.add= s3c2416_irq_add,
  };



I remain entirely unconvinced that this is correct.  As a result of
the "sysdev_driver_register(&s3c2416_sysclass,&s3c2416_irq_driver);"
call, this structure is placed on a list.

If this structure is marked __initdata, then the memory behind the
structure will be freed and overwritten - however, it's still on a
list which might be walked.  Such a walk would cause a kernel oops
or might even be an exploitable security hole if that page ends up
in userspace - especially as said structure contains function calls
which would be called in privileged mode.



The function s3c2416_irq_add() is defined with __init attribute. Also a 
cascade of functions called from s3c2416_irq_add() are also defined with 
__init attribute.


Would it be a good idea to remove __init attribute of all these 
functions (there are 2 of them) called from s3c2416_irq_add() instead?



The same comment applies to the other sysdev driver structures you're
marking __initdata too.


--
Tushar Behera

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


Re: [PATCH] ARM: S3C2410: Remove section mismatch warning

2011-10-03 Thread Russell King - ARM Linux
On Mon, Oct 03, 2011 at 03:10:41PM +0530, Tushar Behera wrote:
> Some of the functions and structures did not have _init or __initdata
> attributes, even though they were referenced from functions / structures
> with those attribute, resulting in section mismatches.

Firstly - it's a good idea to include the warnings which you're fixing
in the commit log text, so that people know exactly what is being fixed.

> diff --git a/arch/arm/mach-s3c2410/usb-simtec.c 
> b/arch/arm/mach-s3c2410/usb-simtec.c
> index 29bd3d9..3a1028c 100644
> --- a/arch/arm/mach-s3c2410/usb-simtec.c
> +++ b/arch/arm/mach-s3c2410/usb-simtec.c
> @@ -104,7 +104,7 @@ static struct s3c2410_hcd_info usb_simtec_info __initdata 
> = {
>  };
>  
>  
> -int usb_simtec_init(void)
> +int __init usb_simtec_init(void)
>  {
>   int ret;
>  

This one looks fine.

> diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c
> index 28ad20d..153cb2f 100644
> --- a/arch/arm/mach-s3c2416/irq.c
> +++ b/arch/arm/mach-s3c2416/irq.c
> @@ -234,7 +234,7 @@ static int __init s3c2416_irq_add(struct sys_device 
> *sysdev)
>   return 0;
>  }
>  
> -static struct sysdev_driver s3c2416_irq_driver = {
> +static struct sysdev_driver s3c2416_irq_driver __initdata = {
>   .add= s3c2416_irq_add,
>  };
>  

I remain entirely unconvinced that this is correct.  As a result of
the "sysdev_driver_register(&s3c2416_sysclass, &s3c2416_irq_driver);"
call, this structure is placed on a list.

If this structure is marked __initdata, then the memory behind the
structure will be freed and overwritten - however, it's still on a
list which might be walked.  Such a walk would cause a kernel oops
or might even be an exploitable security hole if that page ends up
in userspace - especially as said structure contains function calls
which would be called in privileged mode.

The same comment applies to the other sysdev driver structures you're
marking __initdata too.

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


[PATCH] ARM: S3C2410: Remove section mismatch warning

2011-10-03 Thread Tushar Behera
Some of the functions and structures did not have _init or __initdata
attributes, even though they were referenced from functions / structures
with those attribute, resulting in section mismatches.

Signed-off-by: Tushar Behera 
---

The patch is rebased on v3.1-rc8.

The patch has only been build tested, they are not boot tested on any
hardware.

 arch/arm/mach-s3c2410/usb-simtec.c |2 +-
 arch/arm/mach-s3c2410/usb-simtec.h |2 +-
 arch/arm/mach-s3c2416/irq.c|2 +-
 arch/arm/mach-s3c2440/clock.c  |4 ++--
 arch/arm/mach-s3c2443/irq.c|2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-s3c2410/usb-simtec.c 
b/arch/arm/mach-s3c2410/usb-simtec.c
index 29bd3d9..3a1028c 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -104,7 +104,7 @@ static struct s3c2410_hcd_info usb_simtec_info __initdata = 
{
 };
 
 
-int usb_simtec_init(void)
+int __init usb_simtec_init(void)
 {
int ret;
 
diff --git a/arch/arm/mach-s3c2410/usb-simtec.h 
b/arch/arm/mach-s3c2410/usb-simtec.h
index 03842ed..43cc88f 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.h
+++ b/arch/arm/mach-s3c2410/usb-simtec.h
@@ -12,5 +12,5 @@
  * published by the Free Software Foundation.
 */
 
-extern int usb_simtec_init(void);
+extern int __init usb_simtec_init(void);
 
diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c
index 28ad20d..153cb2f 100644
--- a/arch/arm/mach-s3c2416/irq.c
+++ b/arch/arm/mach-s3c2416/irq.c
@@ -234,7 +234,7 @@ static int __init s3c2416_irq_add(struct sys_device *sysdev)
return 0;
 }
 
-static struct sysdev_driver s3c2416_irq_driver = {
+static struct sysdev_driver s3c2416_irq_driver __initdata = {
.add= s3c2416_irq_add,
 };
 
diff --git a/arch/arm/mach-s3c2440/clock.c b/arch/arm/mach-s3c2440/clock.c
index f9e6bda..3b3bec5 100644
--- a/arch/arm/mach-s3c2440/clock.c
+++ b/arch/arm/mach-s3c2440/clock.c
@@ -108,7 +108,7 @@ static struct clk s3c2440_clk_ac97 = {
.ctrlbit= S3C2440_CLKCON_CAMERA,
 };
 
-static int s3c2440_clk_add(struct sys_device *sysdev)
+static int __init s3c2440_clk_add(struct sys_device *sysdev)
 {
struct clk *clock_upll;
struct clk *clock_h;
@@ -137,7 +137,7 @@ static int s3c2440_clk_add(struct sys_device *sysdev)
return 0;
 }
 
-static struct sysdev_driver s3c2440_clk_driver = {
+static struct sysdev_driver s3c2440_clk_driver __initdata = {
.add= s3c2440_clk_add,
 };
 
diff --git a/arch/arm/mach-s3c2443/irq.c b/arch/arm/mach-s3c2443/irq.c
index 83ecb11..1d483d9 100644
--- a/arch/arm/mach-s3c2443/irq.c
+++ b/arch/arm/mach-s3c2443/irq.c
@@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct sys_device *sysdev)
return 0;
 }
 
-static struct sysdev_driver s3c2443_irq_driver = {
+static struct sysdev_driver s3c2443_irq_driver __initdata = {
.add= s3c2443_irq_add,
 };
 
-- 
1.7.4.1


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


Re: [pm-qa] change header to specify 'on Linux'

2011-10-03 Thread Amit Kucheria
Ack

On Mon, Oct 3, 2011 at 12:08 PM, Daniel Lezcano
 wrote:
> Specify the test suite can be run on Linux because it is not
> ARM specific.
>
> Signed-off-by: Daniel Lezcano 
> ---
>  Makefile                                      |    2 +-
>  Test.mk                                       |    2 +-
>  cpufreq/Makefile                              |    2 +-
>  cpufreq/cpufreq_01.sh                         |    2 +-
>  cpufreq/cpufreq_02.sh                         |    2 +-
>  cpufreq/cpufreq_03.sh                         |    2 +-
>  cpufreq/cpufreq_04.sh                         |    2 +-
>  cpufreq/cpufreq_05.sh                         |    2 +-
>  cpufreq/cpufreq_06.sh                         |    2 +-
>  cpufreq/cpufreq_07.sh                         |    2 +-
>  cpufreq/cpufreq_08.sh                         |    2 +-
>  cpufreq/cpufreq_09.sh                         |    2 +-
>  cpuhotplug/Makefile                           |    2 +-
>  cpuhotplug/cpuhotplug_01.sh                   |    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                   |    2 +-
>  include/functions.sh                          |    2 +-
>  sched_mc/Makefile                             |    2 +-
>  sched_mc/sched_01.sh                          |    2 +-
>  sched_mc/sched_02.sh                          |    2 +-
>  sched_mc/sched_03.sh                          |    2 +-
>  sched_mc/sched_04.sh                          |    2 +-
>  testcases.awk                                 |    2 +-
>  testcases/Makefile                            |    2 +-
>  testcases/cpufreq/Makefile                    |    2 +-
>  testcases/cpufreq/avail_freq01.sh             |    2 +-
>  testcases/cpufreq/avail_freq02.sh             |    2 +-
>  testcases/cpufreq/avail_gov01.sh              |    2 +-
>  testcases/cpufreq/avail_gov02.sh              |    2 +-
>  testcases/cpuhotplug/Makefile                 |    2 +-
>  testcases/cpuhotplug/cpu_hotplug_latency.sh   |    2 +-
>  testcases/cpuidle/Makefile                    |    2 +-
>  testcases/cpuidle/test_usb_cpuidle.c          |    2 +-
>  testcases/proof_o_concept/Makefile            |    2 +-
>  testcases/proof_o_concept/PM-list_c_states.sh |    2 +-
>  testcases/proof_o_concept/PM-list_p_states.sh |    2 +-
>  utils/Makefile                                |    2 +-
>  utils/cpuburn.c                               |    2 +-
>  utils/cpucycle.c                              |    2 +-
>  utils/nanosleep.c                             |    2 +-
>  45 files changed, 45 insertions(+), 45 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 478fec3..1560e98 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,5 +1,5 @@
>  #
> -# PM-QA validation test suite for the power management on ARM
> +# PM-QA validation test suite for the power management on Linux
>  #
>  # Copyright (C) 2011, Linaro Limited.
>  #
> diff --git a/Test.mk b/Test.mk
> index 3c387db..655527c 100644
> --- a/Test.mk
> +++ b/Test.mk
> @@ -1,5 +1,5 @@
>  #
> -# PM-QA validation test suite for the power management on ARM
> +# PM-QA validation test suite for the power management on Linux
>  #
>  # Copyright (C) 2011, Linaro Limited.
>  #
> diff --git a/cpufreq/Makefile b/cpufreq/Makefile
> index 762441f..a90620c 100644
> --- a/cpufreq/Makefile
> +++ b/cpufreq/Makefile
> @@ -1,5 +1,5 @@
>  #
> -# PM-QA validation test suite for the power management on ARM
> +# PM-QA validation test suite for the power management on Linux
>  #
>  # Copyright (C) 2011, Linaro Limited.
>  #
> diff --git a/cpufreq/cpufreq_01.sh b/cpufreq/cpufreq_01.sh
> index 8cfbce9..f4fc178 100755
> --- a/cpufreq/cpufreq_01.sh
> +++ b/cpufreq/cpufreq_01.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
>  #
> -# PM-QA validation test suite for the power management on ARM
> +# PM-QA validation test suite for the power management on Linux
>  #
>  # Copyright (C) 2011, Linaro Limited.
>  #
> diff --git a/cpufreq/cpufreq_02.sh b/cpufreq/cpufreq_02.sh
> index 212b2eb..aeecd45 100755
> --- a/cpufreq/cpufreq_02.sh
> +++ b/cpufreq/cpufreq_02.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
>  #
> -# PM-QA validation test suite for the power management on ARM
> +# PM-QA validation test suite for the power management on Linux
>  #
>  # Copyright (C) 2011, Linaro Limited.
>  #
> diff --git a/cpufreq/cpufreq_03.sh b/cpufreq/cpufreq_03.sh
> index 256a5c2..65aed52 100755
> --- a/cpufreq/cpufreq_03.sh
> +++ b/cpufreq/cpufreq_03.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
>  #
> -# PM-QA validation test suite for the power management on ARM
> +# PM-QA validation test suite for the power management on Linux
>  #
>  # Copyright (C) 2011, Linaro Limited.
>  #
> diff --git a/cpufreq/cpufreq_04.s

[pm-qa] change header to specify 'on Linux'

2011-10-03 Thread Daniel Lezcano
Specify the test suite can be run on Linux because it is not
ARM specific.

Signed-off-by: Daniel Lezcano 
---
 Makefile  |2 +-
 Test.mk   |2 +-
 cpufreq/Makefile  |2 +-
 cpufreq/cpufreq_01.sh |2 +-
 cpufreq/cpufreq_02.sh |2 +-
 cpufreq/cpufreq_03.sh |2 +-
 cpufreq/cpufreq_04.sh |2 +-
 cpufreq/cpufreq_05.sh |2 +-
 cpufreq/cpufreq_06.sh |2 +-
 cpufreq/cpufreq_07.sh |2 +-
 cpufreq/cpufreq_08.sh |2 +-
 cpufreq/cpufreq_09.sh |2 +-
 cpuhotplug/Makefile   |2 +-
 cpuhotplug/cpuhotplug_01.sh   |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   |2 +-
 include/functions.sh  |2 +-
 sched_mc/Makefile |2 +-
 sched_mc/sched_01.sh  |2 +-
 sched_mc/sched_02.sh  |2 +-
 sched_mc/sched_03.sh  |2 +-
 sched_mc/sched_04.sh  |2 +-
 testcases.awk |2 +-
 testcases/Makefile|2 +-
 testcases/cpufreq/Makefile|2 +-
 testcases/cpufreq/avail_freq01.sh |2 +-
 testcases/cpufreq/avail_freq02.sh |2 +-
 testcases/cpufreq/avail_gov01.sh  |2 +-
 testcases/cpufreq/avail_gov02.sh  |2 +-
 testcases/cpuhotplug/Makefile |2 +-
 testcases/cpuhotplug/cpu_hotplug_latency.sh   |2 +-
 testcases/cpuidle/Makefile|2 +-
 testcases/cpuidle/test_usb_cpuidle.c  |2 +-
 testcases/proof_o_concept/Makefile|2 +-
 testcases/proof_o_concept/PM-list_c_states.sh |2 +-
 testcases/proof_o_concept/PM-list_p_states.sh |2 +-
 utils/Makefile|2 +-
 utils/cpuburn.c   |2 +-
 utils/cpucycle.c  |2 +-
 utils/nanosleep.c |2 +-
 45 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/Makefile b/Makefile
index 478fec3..1560e98 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# PM-QA validation test suite for the power management on ARM
+# PM-QA validation test suite for the power management on Linux
 #
 # Copyright (C) 2011, Linaro Limited.
 #
diff --git a/Test.mk b/Test.mk
index 3c387db..655527c 100644
--- a/Test.mk
+++ b/Test.mk
@@ -1,5 +1,5 @@
 #
-# PM-QA validation test suite for the power management on ARM
+# PM-QA validation test suite for the power management on Linux
 #
 # Copyright (C) 2011, Linaro Limited.
 #
diff --git a/cpufreq/Makefile b/cpufreq/Makefile
index 762441f..a90620c 100644
--- a/cpufreq/Makefile
+++ b/cpufreq/Makefile
@@ -1,5 +1,5 @@
 #
-# PM-QA validation test suite for the power management on ARM
+# PM-QA validation test suite for the power management on Linux
 #
 # Copyright (C) 2011, Linaro Limited.
 #
diff --git a/cpufreq/cpufreq_01.sh b/cpufreq/cpufreq_01.sh
index 8cfbce9..f4fc178 100755
--- a/cpufreq/cpufreq_01.sh
+++ b/cpufreq/cpufreq_01.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# PM-QA validation test suite for the power management on ARM
+# PM-QA validation test suite for the power management on Linux
 #
 # Copyright (C) 2011, Linaro Limited.
 #
diff --git a/cpufreq/cpufreq_02.sh b/cpufreq/cpufreq_02.sh
index 212b2eb..aeecd45 100755
--- a/cpufreq/cpufreq_02.sh
+++ b/cpufreq/cpufreq_02.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# PM-QA validation test suite for the power management on ARM
+# PM-QA validation test suite for the power management on Linux
 #
 # Copyright (C) 2011, Linaro Limited.
 #
diff --git a/cpufreq/cpufreq_03.sh b/cpufreq/cpufreq_03.sh
index 256a5c2..65aed52 100755
--- a/cpufreq/cpufreq_03.sh
+++ b/cpufreq/cpufreq_03.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# PM-QA validation test suite for the power management on ARM
+# PM-QA validation test suite for the power management on Linux
 #
 # Copyright (C) 2011, Linaro Limited.
 #
diff --git a/cpufreq/cpufreq_04.sh b/cpufreq/cpufreq_04.sh
index 6fa81fa..a4ee5db 100755
--- a/cpufreq/cpufreq_04.sh
+++ b/cpufreq/cpufreq_04.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# PM-QA validation test suite for the power management on ARM
+# PM-QA validation test suite for the power management on Linux
 #
 # Copyright (C) 2011, Linar

Re: [pm-qa 02/10] add the makefile for cpuhotplug

2011-10-03 Thread Daniel Lezcano
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/03/2011 10:39 AM, Amit Kucheria wrote:
> On Mon, Oct 3, 2011 at 11:18 AM, Daniel Lezcano
>  wrote:
>> Signed-off-by: Daniel Lezcano > ---
>>  cpuhotplug/Makefile |   25 +
>>  1 files changed, 25 insertions(+), 0 deletions(-)
>>  create mode 100644 cpuhotplug/Makefile
>>
>> diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile
>> new file mode 100644
>> index 000..2225d82
>> --- /dev/null
>> +++ b/cpuhotplug/Makefile
>> @@ -0,0 +1,25 @@
>> +#
>> +# PM-QA validation test suite for the power management on ARM
> 
> s/on ARM/on Linux/ ?
> 
> None of these tests are ARM-specific and it might actually be nice if
> others adopted them too.

Ok, I will change the headers for the different files with a patch on
top of this patchset because it impacts all the headers.

> Otherwise, ack for the patchset.

Thanks for the review.

  -- Daniel
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOiXeCAAoJEAKBbMCpUGYA13kIAKDZzUFwG341FU5aOn5gI3ui
x1N4hbbu8nSDJhvqQJgbTDpJjgo9iCoOsB+SpO9bEORXmuo9Gks/NTimDRstLm2f
zpVV+en8isx7mtlBzkWaMRO3adOBinNGUhPvtzTdBheU88IgFiRugROn58CPNFqN
m4wVoG1hfbiz97AzFSoUBt7wr+ZIxVfBvqyoYLAyg4jjx3h6JFA+0WBAZQx5MzgI
CbOYYaNcYLZNz9mQRjHMLgcgEuUlscn3s2rxRuuH0S67w5osEmy7BcikujmIB51j
kVx4XdyB8gW2pN3fBUyIC2jnjRd2rEd2H+ryEMs9aBnuYlyrhdvCobHr3iOp5ek=
=W0jm
-END PGP SIGNATURE-

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


Re: [pm-qa 02/10] add the makefile for cpuhotplug

2011-10-03 Thread Amit Kucheria
On Mon, Oct 3, 2011 at 11:18 AM, Daniel Lezcano
 wrote:
> Signed-off-by: Daniel Lezcano  ---
>  cpuhotplug/Makefile |   25 +
>  1 files changed, 25 insertions(+), 0 deletions(-)
>  create mode 100644 cpuhotplug/Makefile
>
> diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile
> new file mode 100644
> index 000..2225d82
> --- /dev/null
> +++ b/cpuhotplug/Makefile
> @@ -0,0 +1,25 @@
> +#
> +# PM-QA validation test suite for the power management on ARM

s/on ARM/on Linux/ ?

None of these tests are ARM-specific and it might actually be nice if
others adopted them too.

Otherwise, ack for the patchset.

> +# Copyright (C) 2011, Linaro Limited.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License
> +# as published by the Free Software Foundation; either version 2
> +# of the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
> USA.
> +#
> +# Contributors:
> +#     Daniel Lezcano  (IBM Corporation)
> +#       - initial API and implementation
> +#
> +
> +include ../Test.mk
> --
> 1.7.1
>
>
> ___
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev
>

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


[pm-qa 04/10] check the cpu state is reflected in sysfs

2011-10-03 Thread Daniel Lezcano
Signed-off-by: Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL : 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_02
+
+source ../include/functions.sh
+
+check_state() {
+local cpu=$1
+local dirpath=$CPU_PATH/$1
+local state=
+shift 1
+
+if [ "$cpu" == "cpu0" ]; then
+   return 0
+fi
+
+set_offline $cpu
+state=$(get_online $cpu)
+
+check "cpu is offline" "test $state -eq 0"
+if [ $? -ne 0 ]; then
+   set_online $cpu
+   return 1
+fi
+
+set_online $cpu
+state=$(get_online $cpu)
+
+check "cpu is online" "test $state -eq 1"
+if [ $? -ne 0 ]; then
+   return 1
+fi
+
+return 0
+}
+
+for_each_cpu check_state
diff --git a/cpuhotplug/cpuhotplug_02.txt b/cpuhotplug/cpuhotplug_02.txt
new file mode 100644
index 000..4047c3a
--- /dev/null
+++ b/cpuhotplug/cpuhotplug_02.txt
@@ -0,0 +1 @@
+test the cpu state is reflected in sysfs
diff --git a/include/functions.sh b/include/functions.sh
index b2a8b47..b34d49b 100644
--- a/include/functions.sh
+++ b/include/functions.sh
@@ -175,6 +175,27 @@ get_min_frequency() {
 cat $dirpath
 }
 
+set_online() {
+local cpu=$1
+local dirpath=$CPU_PATH/$cpu
+
+echo 1 > $dirpath/online
+}
+
+set_offline() {
+local cpu=$1
+local dirpath=$CPU_PATH/$cpu
+
+echo 0 > $dirpath/online
+}
+
+get_online() {
+local cpu=$1
+local dirpath=$CPU_PATH/$cpu
+
+cat $dirpath/online
+}
+
 check() {
 
 local descr=$1
-- 
1.7.1


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


[pm-qa 10/10] do some stress test

2011-10-03 Thread Daniel Lezcano
Randomly offline/online a cpu

Signed-off-by: Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL : 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_08
+
+source ../include/functions.sh
+
+function randomize() {
+echo $[ ( $RANDOM % $1 )  + 1 ]
+}
+
+random_stress() {
+local cpu_present=$(cat /sys/devices/system/cpu/present | cut -d '-' -f 2)
+local cpurand=$(randomize $cpu_present)
+local ret=
+
+# randomize will in range "1-$cpu_present) so cpu0 is ignored
+set_offline cpu$cpurand
+ret=$?
+check "cpu$cpurand is offline" "test $ret -eq 0"
+
+set_online cpu$cpurand
+ret=$?
+check "cpu$cpurand is online" "test $ret -eq 0"
+}
+
+for i in $(seq 1 50); do random_stress || break; done
diff --git a/cpuhotplug/cpuhotplug_08.txt b/cpuhotplug/cpuhotplug_08.txt
new file mode 100644
index 000..ddfca55
--- /dev/null
+++ b/cpuhotplug/cpuhotplug_08.txt
@@ -0,0 +1 @@
+test userspace notification
-- 
1.7.1


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


[pm-qa 07/10] check /proc/cpuinfo when unplugging a cpu

2011-10-03 Thread Daniel Lezcano
Signed-off-by: Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL : 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_05
+
+source ../include/functions.sh
+
+check_procinfo() {
+local cpu=$1
+local cpuid=${cpu:3}
+local ret=
+
+if [ "$cpu" == "cpu0" ]; then
+   return 0
+fi
+
+set_offline $cpu
+
+TAB=$(printf "\t"); grep "processor$TAB: $cpuid" /proc/cpuinfo
+ret=$?
+
+check "offline processor not found in cpuinfo" "test $ret -ne 0"
+
+set_online $cpu
+}
+
+for_each_cpu check_procinfo
diff --git a/cpuhotplug/cpuhotplug_05.txt b/cpuhotplug/cpuhotplug_05.txt
new file mode 100644
index 000..9c4cfbf
--- /dev/null
+++ b/cpuhotplug/cpuhotplug_05.txt
@@ -0,0 +1 @@
+test cpus are reflected on /proc/cpuinfo correctly
-- 
1.7.1


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


[pm-qa 02/10] add the makefile for cpuhotplug

2011-10-03 Thread Daniel Lezcano
Signed-off-by: Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+include ../Test.mk
-- 
1.7.1


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


[pm-qa 06/10] check the task is migrated when offlining a cpu

2011-10-03 Thread Daniel Lezcano
Signed-off-by: Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL : 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_04
+
+CPUBURN=../utils/cpuburn
+source ../include/functions.sh
+
+check_task_migrate() {
+local cpu=$1
+local cpuid=${cpu:3}
+local cpumask=$((1 << cpuid))
+local dirpath=$CPU_PATH/$1
+local pid=
+local ret=
+
+if [ "$cpu" == "cpu0" ]; then
+   return 0
+fi
+
+taskset -c 0x$cpumask $CPUBURN $cpu &
+pid=$!
+sleep 1 # let taskset to do setaffinity before checking
+
+ret=$(taskset -p $pid | cut -d ':' -f 2)
+ret=$(echo $ret) # remove trailing whitespace
+ret=$(printf "%d" 0x$ret)
+check "affinity is set" "test $cpumask -eq $ret"
+
+sleep 1
+set_offline $cpu
+ret=$?
+
+check "offlining a cpu with affinity succeed" "test $ret -eq 0"
+
+ret=$(taskset -p $pid | cut -d ':' -f 2)
+ret=$(echo $ret)
+ret=$(printf "%d" 0x$ret)
+check "affinity changed" "test $cpumask -ne $ret"
+
+kill $pid
+
+# in any case we set the cpu online in case of the test fails
+set_online $cpu
+
+return 0
+}
+
+for_each_cpu check_task_migrate
diff --git a/cpuhotplug/cpuhotplug_04.txt b/cpuhotplug/cpuhotplug_04.txt
new file mode 100644
index 000..c0689a3
--- /dev/null
+++ b/cpuhotplug/cpuhotplug_04.txt
@@ -0,0 +1 @@
+test task is migrated with task affinity
-- 
1.7.1


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


[pm-qa 09/10] test the userspace notification

2011-10-03 Thread Daniel Lezcano
Signed-off-by: Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL : 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_07
+
+source ../include/functions.sh
+TMPFILE=cpuhotplug_07.tmp
+
+check_notification() {
+local cpu=$1
+local cpuid=${cpu:3}
+local pid=
+local ret=
+
+if [ "$cpu" == "cpu0" ]; then
+   return 0
+fi
+
+# damn ! udevadm is buffering the output, we have to use a temp file
+# to retrieve the output
+rm -f $TMPFILE
+udevadm monitor --kernel --subsystem-match=cpu > $TMPFILE &
+pid=$!
+
+set_offline $cpu
+set_online $cpu
+
+# let the time the notification to reach userspace
+# and buffered in the file
+sleep 1
+kill $pid
+
+grep "offline" $TMPFILE | grep -q "/devices/system/cpu/$cpu"
+ret=$?
+check "offline event was received" "test $ret -eq 0"
+
+grep "online" $TMPFILE | grep -q "/devices/system/cpu/$cpu"
+ret=$?
+check "online event was received" "test $ret -eq 0"
+
+rm -f $TMPFILE
+}
+
+for_each_cpu check_notification
diff --git a/cpuhotplug/cpuhotplug_07.txt b/cpuhotplug/cpuhotplug_07.txt
new file mode 100644
index 000..ddfca55
--- /dev/null
+++ b/cpuhotplug/cpuhotplug_07.txt
@@ -0,0 +1 @@
+test userspace notification
-- 
1.7.1


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


[pm-qa 03/10] check the files are present

2011-10-03 Thread Daniel Lezcano
Signed-off-by: Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL : 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_01
+
+source ../include/functions.sh
+
+FILES="online offline possible present"
+
+for i in $FILES; do
+check_file $i $CPU_PATH || return 1
+done
+
+for_each_cpu check_cpuhotplug_files online
diff --git a/cpuhotplug/cpuhotplug_01.txt b/cpuhotplug/cpuhotplug_01.txt
new file mode 100644
index 000..047f13a
--- /dev/null
+++ b/cpuhotplug/cpuhotplug_01.txt
@@ -0,0 +1 @@
+test the sysfs files are present
diff --git a/include/functions.sh b/include/functions.sh
index bff8e13..b2a8b47 100644
--- a/include/functions.sh
+++ b/include/functions.sh
@@ -236,6 +236,18 @@ check_topology_files() {
 return 0
 }
 
+check_cpuhotplug_files() {
+
+local dirpath=$CPU_PATH/$1
+shift 1
+
+for i in $@; do
+   check_file $i $dirpath || return 1
+done
+
+return 0
+}
+
 save_governors() {
 
 governors_backup=
-- 
1.7.1


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


[pm-qa 05/10] test the affinity does not work on an offline cpu

2011-10-03 Thread Daniel Lezcano
Signed-off-by: Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL : 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_03
+
+source ../include/functions.sh
+
+check_affinity_fails() {
+local cpu=$1
+local cpuid=${cpu:3}
+local dirpath=$CPU_PATH/$1
+local ret=
+
+if [ "$cpu" == "cpu0" ]; then
+   return 0
+fi
+
+set_offline $cpu
+
+taskset -c $cpuid /bin/true
+ret=$?
+check "setting affinity on cpu fails" "test $ret -ne 0"
+
+set_online $cpu
+
+return 0
+}
+
+for_each_cpu check_affinity_fails
\ No newline at end of file
diff --git a/cpuhotplug/cpuhotplug_03.txt b/cpuhotplug/cpuhotplug_03.txt
new file mode 100644
index 000..09eb1d9
--- /dev/null
+++ b/cpuhotplug/cpuhotplug_03.txt
@@ -0,0 +1 @@
+test the affinity does not work on an offline cpu
-- 
1.7.1


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


[pm-qa 08/10] check /proc/interrupts when offlining a cpu

2011-10-03 Thread Daniel Lezcano
Signed-off-by: Daniel Lezcano  (IBM Corporation)
+#   - initial API and implementation
+#
+
+# URL : 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_06
+
+source ../include/functions.sh
+
+check_procinfo() {
+local cpu=$1
+local cpuid=${cpu:3}
+local ret=
+
+if [ "$cpu" == "cpu0" ]; then
+   return 0
+fi
+
+set_offline $cpu
+
+grep "CPU$cpuid" /proc/interrupts
+ret=$?
+
+check "offline processor not found in interrupts" "test $ret -ne 0"
+
+set_online $cpu
+}
+
+for_each_cpu check_procinfo
diff --git a/cpuhotplug/cpuhotplug_06.txt b/cpuhotplug/cpuhotplug_06.txt
new file mode 100644
index 000..1edab7c
--- /dev/null
+++ b/cpuhotplug/cpuhotplug_06.txt
@@ -0,0 +1 @@
+test interrupts show the right configuration in /proc/interrupts
-- 
1.7.1


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


[pm-qa 01/10] factor out check_file function

2011-10-03 Thread Daniel Lezcano
Signed-off-by: Daniel Lezcano http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: BUGREPORTED work item state

2011-10-03 Thread Marcin Juszkiewicz
W dniu 03.10.2011 04:48, Zach Pfeffer pisze:
> On 30 September 2011 13:22, Fathi Boudra  wrote:
>> Hi Zach,
>>
>> I noticed that you introduced BUGREPORTED on Android blueprints for
>> the work items.
>> It raised a couple of questions:
>> 1. what does BUGREPORTED means ?
> 
> When David Zinmann and I were going through each WI and closing out
> 11.09, a few BPs were done, except for one or two issues. These issues
> were bugs, so instead of filing a new WI in 11.10 we just marked the
> WI as BUGREPORTED and linked the bug to the 11.09. BUGREPORTED seemed
> to unambiguously mark a hand off between the BP tracking and the bug
> system.

You know that linked bug counts as work item too? So if you have work
item for each you reported a bug you can drop it from whiteboard once it
got linked.

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