Re: [PATCH] mac80211_hwsim: correctly register the platform driver

2013-04-24 Thread Martin Pitt
Hello Sasha,

Sasha Levin [2013-04-24  0:40 -0400]:
> Not registering a platform_driver would make us access garbage
> when the platform callbacks under driver_register() kicks in.
> 
> Signed-off-by: Sasha Levin 

Ah, thanks for catching this! I applied that patch and verified that
it still works well.

Tested-By: Martin Pitt 

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


signature.asc
Description: Digital signature


Re: [PATCH v2] arm64: compiling issue, need add include/asm/vga.h file

2013-04-24 Thread Chen Gang
On 2013年04月24日 18:42, Catalin Marinas wrote:
> On Wed, Apr 24, 2013 at 11:20:32AM +0100, Chen Gang wrote:
>> For compiling with allmodconfig, need vga.h file, so generate it which
>> just only include the asm-generic one.
>>
>> It is firstly used by drivers/gpu/drm/drm_irq.c.
>>
>> The related error:
>> include/video/vga.h:22:21: fatal error: asm/vga.h: No such file or directory
>>
>> Signed-off-by: Chen Gang 
>> ---
>>  arch/arm64/include/asm/vga.h |   21 +
>>  1 files changed, 21 insertions(+), 0 deletions(-)
>>  create mode 100644 arch/arm64/include/asm/vga.h
> 
> As Will said, please use asm/Kbuild.
> 

OK, I will send.

>> diff --git a/arch/arm64/include/asm/vga.h b/arch/arm64/include/asm/vga.h
>> new file mode 100644
>> index 000..1c49d51
>> --- /dev/null
>> +++ b/arch/arm64/include/asm/vga.h
>> @@ -0,0 +1,21 @@
>> +/*
>> + * Copyright (C) 2012 ARM Ltd.
> 
> ARM copyright? You either work for ARM or there is a copyright
> assignment between you and ARM ;)
> 

:-)

-- 
Chen Gang

Asianux Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3 v14] iommu/fsl: Add additional iommu attributes required by the PAMU driver.

2013-04-24 Thread Joerg Roedel
On Tue, Apr 23, 2013 at 02:10:25PM +, Sethi Varun-B16395 wrote:
> I think it's fine to have the header under linux, actually I also the
> intel-iommu header under linux.

Yes, the difference is that VT-d runs on x86 and on ia64. So there is no
single arch where the header could be placed. The amd-iommu.h file on
the other hand is x86 only and should also be moved to asm/, as I just
found out :)

And as long as PAMU is only needed on a single architecture the header
should also be arch-specific. If that changes someday the header can be
moved to a generic place.


Joerg


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] arm64: compiling issue, need add include/asm/vga.h file

2013-04-24 Thread Chen Gang
On 2013年04月24日 18:23, Will Deacon wrote:
> On Wed, Apr 24, 2013 at 11:20:32AM +0100, Chen Gang wrote:
>> > 
>> > For compiling with allmodconfig, need vga.h file, so generate it which
>> > just only include the asm-generic one.
>> > 
>> > It is firstly used by drivers/gpu/drm/drm_irq.c.
>> > 
>> > The related error:
>> > include/video/vga.h:22:21: fatal error: asm/vga.h: No such file or 
>> > directory
>> > 
>> > Signed-off-by: Chen Gang 
>> > ---
>> >  arch/arm64/include/asm/vga.h |   21 +
>> >  1 files changed, 21 insertions(+), 0 deletions(-)
>> >  create mode 100644 arch/arm64/include/asm/vga.h
>> > 
>> > diff --git a/arch/arm64/include/asm/vga.h b/arch/arm64/include/asm/vga.h
>> > new file mode 100644
>> > index 000..1c49d51
>> > --- /dev/null
>> > +++ b/arch/arm64/include/asm/vga.h
>> > @@ -0,0 +1,21 @@
>> > +/*
>> > + * Copyright (C) 2012 ARM 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 Foundation.
>> > + *
>> > + * 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, see .
>> > + */
>> > +#ifndef ASMARM_VGA_H
>> > +#define ASMARM_VGA_H
>> > +
>> > +#include 
>> > +
>> > +#endif /* ASMARM_VGA_H */
> Can't you just add this as a generic-y entry in asm/Kbuild?

OK, thanks, I need send patch v3.

-- 
Chen Gang

Asianux Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC] device-tree.git automatic sync from linux.git

2013-04-24 Thread Ian Campbell
Hi,

First off apologies for the large CC list -- I think this catches the
arch list for all the arches with device tree source in the tree.

Various folks have expressed an interest in eventually splitting the
device tree bindings out of the Linux git repository into a separate
tree. This should help reduce the cross talk between the code and the
bindings and to make it difficult to accidentally "co-evolve" the
bindings and the code (i.e. break compatibility) etc. There are also
other projects (such as Xen) which would also like to use device-tree as
an OS agnostic description of the hardware.

I was talking to Grant about this at this Spring's LinaroConnect in Hong
Kong and as a first step he was interested in a device-tree.git
repository which is automatically kept insync with the main Linux tree.
Somehow I found myself volunteering to set up that tree.

An RFC repository can be found at:
http://xenbits.xen.org/gitweb/?p=people/ianc/device-tree-rebasing.git

This is created using git filter-branch and retains the full history for
the device tree source files up to v3.9-rc8.

The master branch contains everything including the required build
infrastructure while upstream/master and upstream/dts contain the most
recently converted upstream master branch and the pristine converted
version respectively. Each upstream tag T is paired with a tag T-dts
which is the converted version of that tag.

Note that the tree will be potentially rebasing (hence the name) for the
time being while I'm still smoothing out the conversion process.

The paths to include in the conversion are described in
scripts/rewrite-paths.sed. The generic cases are:
arch/ARCH/boot/dts/*.dts and *.dts? (for dtsi and dtsp etc)
arch/ARCH/boot/*.dts and *.dts?
arch/ARCH/include/dts/* (currently unused?)
which become src/ARCH/*.dts and *.dts? plus src/ARCH/include/*

There are also some special cases for some arches which don't follow
this pattern and for older versions of the kernel which were less
consistent. The paths were gleaned from git ls-tree + grep on every tag
in the tree, so if a file was added and moved between two rcs then the
original path may not be covered (so the move will look like it just
adds the files).

In principal this supports the new .dtsp files and includes the required
include paths in the conversion but none of them seem to be in mainline
yet, so we'll have to see!

The initial conversion took in excess of 40 hours (running out of a
ramdisk) so even if the result is stable in terms of commit ids etc a
fresh conversion every time isn't an option for a ~daily sync so I had
to create a slightly hacked around git-filter-branch (found in
scripts/git-filter-branch) to support incremental filtering, which I
intend to send to the git folks soon. 

Please let me know what you think.

Ian.

[0] real2533m32.142s
user2393m35.039s
sys 343m44.385s


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2 V2] iommu/amd: Add workaround for ERBT1312

2013-04-24 Thread Joerg Roedel
On Tue, Apr 23, 2013 at 09:22:45AM -0400, Don Dutile wrote:
> Given other threads on this mail list (and I've seen crashes with same 
> problem)
> where this type of logging during a flood of IOMMU errors will lock up the 
> machine,
> is there something that can be done to break the do-while loop after n 
> iterations
> have been exec'd, so the kernel can progress during a crash ?

In the case of an IOMMU error flood this loop will only run until the
event-log/ppr-log overflows. So it should not turn into an endless loop.


Joerg


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[v3.9-rc8]: kernel BUG at mm/memcontrol.c:3994! (was: Re: [BUG][s390x] mm: system crashed)

2013-04-24 Thread Heiko Carstens
On Thu, Apr 18, 2013 at 09:13:03AM +0200, Heiko Carstens wrote:
> Ok, thanks for verifying! I'll look into it; hopefully I can reproduce it
> here as well.

That seems to be a common code bug. I can easily trigger the VM_BUG_ON()
below (when I force the system to swap):

[   48.347963] [ cut here ]
[   48.347972] kernel BUG at mm/memcontrol.c:3994!
[   48.348012] illegal operation: 0001 [#1] SMP 
[   48.348015] Modules linked in:
[   48.348017] CPU: 1 Not tainted 3.9.0-rc8+ #38
[   48.348020] Process mmap2 (pid: 635, task: 29476100, ksp: 
2e91b938)
[   48.348022] Krnl PSW : 0704f0018000 0026552c 
(__mem_cgroup_uncharge_common+0x2c4/0x33c)
[   48.348032]R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:3 PM:0 
EA:3
   Krnl GPRS: 0008 0009 03d1002a9200 

[   48.348039] 006812d8 03ffdf339000 
321a6f98
[   48.348043]03fffce11000  0001 
03d1002a9200
[   48.348046]0001 00681b88 2e91bc18 
2e91bbd0
[   48.348057] Krnl Code: 0026551e: c0e5fffaa2a1brasl   
%r14,1b9a60
  00265524: a7f4ff7dbrc 
15,26541e
 #00265528: a7f40001brc 
15,26552a
 >0026552c: e3c0b8200124stg 
%r12,6176(%r11)
  00265532: a7f4ff57brc 
15,2653e0
  00265536: e310b8280104lg  
%r1,6184(%r11)
  0026553c: a71b0001aghi%r1,1
  00265540: e310b8280124stg 
%r1,6184(%r11)
[   48.348099] Call Trace:
[   48.348100] ([<03d1002a91c0>] 0x3d1002a91c0)
[   48.348102]  [<002404aa>] page_remove_rmap+0xf2/0x16c
[   48.348106]  [<00232dc8>] unmap_single_vma+0x494/0x7d8
[   48.348107]  [<00233ac0>] unmap_vmas+0x50/0x74
[   48.348109]  [<002396ec>] unmap_region+0x9c/0x110
[   48.348110]  [<0023bd18>] do_munmap+0x284/0x470
[   48.348111]  [<0023bf56>] vm_munmap+0x52/0x70
[   48.348113]  [<0023cf32>] SyS_munmap+0x3a/0x4c
[   48.348114]  [<00665e14>] sysc_noemu+0x22/0x28
[   48.348118]  [<03fffcf187b2>] 0x3fffcf187b2
[   48.348119] Last Breaking-Event-Address:
[   48.348120]  [<00265528>] __mem_cgroup_uncharge_common+0x2c0/0x33c

Looking at the code, the code flow is:

page_remove_rmap() -> mem_cgroup_uncharge_page() -> 
__mem_cgroup_uncharge_common()

Note that in mem_cgroup_uncharge_page() the page in question passed the check:

[...]
if (PageSwapCache(page))
return;
[...]

and just a couple of instructions later the VM_BUG_ON() within
__mem_cgroup_uncharge_common() triggers:

[...]
if (mem_cgroup_disabled())
return NULL;

VM_BUG_ON(PageSwapCache(page));
[...]

Which means that another cpu changed the pageflags concurrently. In fact,
looking at the dump a different cpu is indeed busy with running kswapd.

So.. this seems to be somewhat broken. Anyone familiar with memcontrol?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] arm64: compiling issue, need add include/asm/vga.h file

2013-04-24 Thread Catalin Marinas
On Wed, Apr 24, 2013 at 11:20:32AM +0100, Chen Gang wrote:
> For compiling with allmodconfig, need vga.h file, so generate it which
> just only include the asm-generic one.
> 
> It is firstly used by drivers/gpu/drm/drm_irq.c.
> 
> The related error:
> include/video/vga.h:22:21: fatal error: asm/vga.h: No such file or directory
> 
> Signed-off-by: Chen Gang 
> ---
>  arch/arm64/include/asm/vga.h |   21 +
>  1 files changed, 21 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm64/include/asm/vga.h

As Will said, please use asm/Kbuild.

> diff --git a/arch/arm64/include/asm/vga.h b/arch/arm64/include/asm/vga.h
> new file mode 100644
> index 000..1c49d51
> --- /dev/null
> +++ b/arch/arm64/include/asm/vga.h
> @@ -0,0 +1,21 @@
> +/*
> + * Copyright (C) 2012 ARM Ltd.

ARM copyright? You either work for ARM or there is a copyright
assignment between you and ARM ;)

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 14/14] perf tools: Add document for perf-ftrace command

2013-04-24 Thread Namhyung Kim
On Tue, 23 Apr 2013 11:53:53 -0400, Steven Rostedt wrote:
> On Tue, 2013-04-23 at 17:31 +0900, Namhyung Kim wrote:
>> +  'perf ftrace live ' to see a live trace of kernel functions
>> +  via trace_pipe during executing the .  If  is not
>> +  specified, one of target options (-p, -a or -C) should be given.  It
>
> one of *the* target options
>
>> +  just print out the result to stdout and doesn't save any files.
>
> just *prints* out the result

Thank you for fixing the grammar!  It's one of the hardest job for me to
write a document - even a short one. :)

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: "attempt to move .org backwards" still show up

2013-04-24 Thread Michael Neuling
Mike Qiu  wrote:

> 于 2013/4/24 16:31, Michael Ellerman 写道:
> > On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:
> >> Hi all
> >>
> >> I get an error message when I compile the source code in Power7 platform
> >> use the newest upstream kernel.
> > Hi Mike,
> >
> > It depends on what your .config is. What defconfig are you building?
> I just copy the config file from /boot/config.* to .config and use make
> menuconfig
> change nothing by manually, then save.

Can you post the resulting config here?

Do you have commit in your tree?
  commit 087aa036eb79f24b856893190359ba812b460f45
  Author: Chen Gang 
  powerpc: make additional room in exception vector area

Mikey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 02/14] perf util: Use evsel->name to get tracepoint_paths

2013-04-24 Thread Namhyung Kim
On Tue, 23 Apr 2013 09:07:20 -0400, Steven Rostedt wrote:
>> +
>> +if (pos->name && strchr(pos->name, ':')) {
>> +char *str = strchr(pos->name, ':');
>
> Why not make the above into:
>
>   if (pos->name && (str = strchr(pos->name, ':'))) {
>
> ?

I wanted not to have an assignment in an if condition, just for my
preference.  I will change it.

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ARM: S5pv210: compiling issue, ARM_S3C64XX_CPUFREQ need CONFIG_CPU_FREQ_TABLE=y

2013-04-24 Thread Chen Gang

For arm S5pv210 with allmodconfig, ARM_S3C64XX_CPUFREQ need 
CONFIG_CPU_FREQ_TABLE=y, or will cause compiling issue.

The related operation:
+ arm-linux-gnu-ld -EL -p --no-undefined -X --build-id -X -o .tmp_vmlinux1 -T 
/root/linux-next/arch/arm/kernel/vmlinux.lds arch/arm/kernel/head.o 
init/built-in.o --start-group usr/built-in.o arch/arm/nwfpe/built-in.o 
arch/arm/vfp/built-in.o arch/arm/kernel/built-in.o arch/arm/mm/built-in.o 
arch/arm/common/built-in.o arch/arm/net/built-in.o arch/arm/crypto/built-in.o 
arch/arm/mach-s5pv210/built-in.o arch/arm/plat-samsung/built-in.o 
kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o 
security/built-in.o crypto/built-in.o block/built-in.o arch/arm/lib/lib.a 
lib/lib.a arch/arm/lib/built-in.o lib/built-in.o drivers/built-in.o 
sound/built-in.o firmware/built-in.o net/built-in.o --end-group

The related errors:
drivers/built-in.o: In function `s5pv210_target':
drivers/cpufreq/s5pv210-cpufreq.c:225: undefined reference to 
`cpufreq_frequency_table_target'
drivers/cpufreq/s5pv210-cpufreq.c:237: undefined reference to 
`cpufreq_frequency_table_target'
drivers/built-in.o: In function `s5pv210_verify_speed':
drivers/cpufreq/s5pv210-cpufreq.c:182: undefined reference to 
`cpufreq_frequency_table_verify'
drivers/built-in.o: In function `s5pv210_cpu_init':
drivers/cpufreq/s5pv210-cpufreq.c:556: undefined reference to 
`cpufreq_frequency_table_get_attr'
drivers/cpufreq/s5pv210-cpufreq.c:560: undefined reference to 
`cpufreq_frequency_table_cpuinfo'
make: *** [vmlinux] Error 1

Signed-off-by: Chen Gang 
---
 drivers/cpufreq/Kconfig.arm |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index bce2195..bbcd719 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -187,6 +187,7 @@ config ARM_S3C64XX_CPUFREQ
 config ARM_S5PV210_CPUFREQ
bool "Samsung S5PV210 and S5PC110"
depends on CPU_S5PV210
+   select CPU_FREQ_TABLE
default y
help
  This adds the CPUFreq driver for Samsung S5PV210 and
-- 
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86, efi: Fix a build warning

2013-04-24 Thread Matt Fleming
On 24/04/13 11:09, Borislav Petkov wrote:
> From: Borislav Petkov 
> 
> Fix this:
> 
> arch/x86/boot/compressed/eboot.c: In function ‘setup_efi_vars’:
> arch/x86/boot/compressed/eboot.c:269:2: warning: passing argument 1 of 
> ‘efi_call_phys’ makes pointer from integer without a cast [enabled by default]
> In file included from arch/x86/boot/compressed/eboot.c:12:0:
> /w/kernel/linux/arch/x86/include/asm/efi.h:8:33: note: expected ‘void *’ but 
> argument is of type ‘long unsigned int’
> 
> after cc5a080c5d40 ("efi: Pass boot services variable info to runtime
> code").
> 
> Cc: Matthew Garrett 
> Cc: Matt Fleming 
> Signed-off-by: Borislav Petkov 
> ---
>  arch/x86/boot/compressed/eboot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] arm64: compiling issue, need add include/asm/vga.h file

2013-04-24 Thread Will Deacon
On Wed, Apr 24, 2013 at 11:20:32AM +0100, Chen Gang wrote:
> 
> For compiling with allmodconfig, need vga.h file, so generate it which
> just only include the asm-generic one.
> 
> It is firstly used by drivers/gpu/drm/drm_irq.c.
> 
> The related error:
> include/video/vga.h:22:21: fatal error: asm/vga.h: No such file or directory
> 
> Signed-off-by: Chen Gang 
> ---
>  arch/arm64/include/asm/vga.h |   21 +
>  1 files changed, 21 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm64/include/asm/vga.h
> 
> diff --git a/arch/arm64/include/asm/vga.h b/arch/arm64/include/asm/vga.h
> new file mode 100644
> index 000..1c49d51
> --- /dev/null
> +++ b/arch/arm64/include/asm/vga.h
> @@ -0,0 +1,21 @@
> +/*
> + * Copyright (C) 2012 ARM 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 Foundation.
> + *
> + * 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, see .
> + */
> +#ifndef ASMARM_VGA_H
> +#define ASMARM_VGA_H
> +
> +#include 
> +
> +#endif /* ASMARM_VGA_H */

Can't you just add this as a generic-y entry in asm/Kbuild?

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] arm64: compiling issue, need add include/asm/vga.h file

2013-04-24 Thread Chen Gang

For compiling with allmodconfig, need vga.h file, so generate it which
just only include the asm-generic one.

It is firstly used by drivers/gpu/drm/drm_irq.c.

The related error:
include/video/vga.h:22:21: fatal error: asm/vga.h: No such file or directory

Signed-off-by: Chen Gang 
---
 arch/arm64/include/asm/vga.h |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm64/include/asm/vga.h

diff --git a/arch/arm64/include/asm/vga.h b/arch/arm64/include/asm/vga.h
new file mode 100644
index 000..1c49d51
--- /dev/null
+++ b/arch/arm64/include/asm/vga.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2012 ARM 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 Foundation.
+ *
+ * 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, see .
+ */
+#ifndef ASMARM_VGA_H
+#define ASMARM_VGA_H
+
+#include 
+
+#endif /* ASMARM_VGA_H */
-- 
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V6 3/3] efi: Distinguish between "remaining space" and actually used space

2013-04-24 Thread Matthew Garrett
On Wed, 2013-04-24 at 18:08 +0800, joeyli wrote:

> It causes the garbage size increased and remaining_size decreased. But
> we still can create new variable because active_size doesn't increase
> due to we delete variable before create new. So, the condition
> "remaining_size - size < storage_size / 2" will not really hit because
> active_size condition is pass.

That's fine - the (limited) information we have from Samsung is that
there's no problem if all the space is dirty, only if all the space is
marked as active.

-- 
Matthew Garrett | mj...@srcf.ucam.org
N�r��yb�X��ǧv�^�)޺{.n�+{zX����ܨ}���Ơz�:+v���zZ+��+zf���h���~i���z��w���?�&�)ߢf��^jǫy�m��@A�a���
0��h���i

Re: [PATCH] x86_32: Fix module version table mismatch.

2013-04-24 Thread James Hogan
On 24/04/13 02:00, H. Peter Anvin wrote:
> On 04/23/2013 05:52 PM, H. Peter Anvin wrote:
>> On 04/23/2013 05:40 AM, Tetsuo Handa wrote:
>>> Commit a4b6a77b "module: fix symbol versioning with symbol prefixes" broke
>>> loading of net/ipv6/ipv6.ko built with CONFIG_MODVERSIONS=y for x86_32.
>>
>> This really does seem to be the offending commit, although I'm still
>> confused how the heck that is possible.
>>
> 
> OK, now I grok.
> 
> The bug is the use of VMLINUX_SYMBOL_STR(%s) which expands at the time
> the output of modpost is compiled.  However, VMLINUX_SYMBOL_STR() unlike
> __VMLINUX_SYMBOL_STR() does macro expansion on its argument, which is
> actively wrong here.

Yes, nasty bug there (sorry!)

> I think the choice is either to change this to __VMLINUX_SYMBOL_STR() or
> re-introduce CONFIG_SYMBOL_PREFIX (or its equivalent) so that modprobe
> can emit it at compile time

Using __VMLINUX_SYMBOL_STR looks like the correct solution to me.

> (assuming there even should *be* a prefix on
> the symbol here, i.e. that the compiler won't add it.)

[__]VMLINUX_SYMBOL_STR expands to a string (e.g. "_" "memcmp" or just
"memcmp") so the compiler won't touch it.

> 
> Either way -- James, Rusty, this is in your court.

How does the patch below look? I presume this is preferred over
making VMLINUX_SYMBOL_STR non-argument-expanding?

Thanks
James

Subject: [PATCH 1/1] modpost: fix unwanted VMLINUX_SYMBOL_STR expansion

Commit a4b6a77b77ba4f526392612c2365797fab956014 ("module: fix symbol
versioning with symbol prefixes") broke the MODVERSIONS loading of any
module using memcmp (e.g. ipv6) on x86_32, as it's defined to
__builtin_memcmp which is expanded by VMLINUX_SYMBOL_STR. Use
__VMLINUX_SYMBOL_STR instead which doesn't expand the argument.

Reported-by: Tetsuo Handa 
Signed-off-by: James Hogan 
Cc: Rusty Russell 
Cc: Andy Shevchenko 
Cc: H. Peter Anvin 
---
 scripts/mod/modpost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 1f90961..a4be8e1 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1957,7 +1957,7 @@ static int add_versions(struct buffer *b, struct module 
*mod)
s->name, mod->name);
continue;
}
-   buf_printf(b, "\t{ %#8x, VMLINUX_SYMBOL_STR(%s) },\n",
+   buf_printf(b, "\t{ %#8x, __VMLINUX_SYMBOL_STR(%s) },\n",
   s->crc, s->name);
}
 
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V6 3/3] efi: Distinguish between "remaining space" and actually used space

2013-04-24 Thread joeyli
Hi all, 

於 一,2013-04-15 於 13:09 -0700,Matthew Garrett 提到:
> EFI implementations distinguish between space that is actively used by a
> variable and space that merely hasn't been garbage collected yet. Space
> that hasn't yet been garbage collected isn't available for use and so isn't
> counted in the remaining_space field returned by QueryVariableInfo().
> 
> Combined with commit 68d9298 this can cause problems. Some implementations
> don't garbage collect until the remaining space is smaller than the maximum
> variable size, and as a result check_var_size() will always fail once more
> than 50% of the variable store has been used even if most of that space is
> marked as available for garbage collection. The user is unable to create
> new variables, and deleting variables doesn't increase the remaining space.
> 
> The problem that 68d9298 was attempting to avoid was one where certain
> platforms fail if the actively used space is greater than 50% of the
> available storage space. We should be able to calculate that by simply
> summing the size of each available variable and subtracting that from
> the total storage space. With luck this will fix the problem described in
> https://bugzilla.kernel.org/show_bug.cgi?id=55471 without permitting
> damage to occur to the machines 68d9298 was attempting to fix.
> 
> Signed-off-by: Matthew Garrett 
> ---
>  arch/x86/platform/efi/efi.c | 109 
> +---
>  1 file changed, 102 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
> index e844d82..a3f03cd 100644
> --- a/arch/x86/platform/efi/efi.c
> +++ b/arch/x86/platform/efi/efi.c
...
> @@ -1039,8 +1122,20 @@ efi_status_t efi_query_variable_store(u32 attributes, 
> unsigned long size)
>   if (status != EFI_SUCCESS)
>   return status;
>  
> - if (!storage_size || size > remaining_size || size > max_size ||
> - (remaining_size - size) < (storage_size / 2))
> + /*
> +  * Some firmware implementations refuse to boot if there's insufficient
> +  * space in the variable store. We account for that by refusing the
> +  * write if permitting it would reduce the available space to under
> +  * 50%. However, some firmware won't reclaim variable space until
> +  * after the used (not merely the actively used) space drops below
> +  * a threshold. We can approximate that case with the value calculated
> +  * above. If both the firmware and our calculations indicate that the
> +  * available space would drop below 50%, refuse the write.
> +  */
> +
> + if (!storage_size || size > remaining_size ||
> + ((active_size + size + VAR_METADATA_SIZE > storage_size / 2) &&
> +  (remaining_size - size < storage_size / 2)))

I am afraid it could not completely avoid to brick Samsung machines when
binding active_size and remaining_size logic with AND.

I don't have machine for testing, but my concern is we can run
delete/create variables many cycles at runtime for trigger brick Samsung
machines.
It causes the garbage size increased and remaining_size decreased. But
we still can create new variable because active_size doesn't increase
due to we delete variable before create new. So, the condition
"remaining_size - size < storage_size / 2" will not really hit because
active_size condition is pass.

And, here also can not use OR for binding active_size and remaining_size
logic, that causes many machines will not trigger garbage collection
because remaining_size will never tight.

Please let me know if I lost any other conditions or background
information.


Thanks a lot!
Joey Lee

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] x86, efi: Fix a build warning

2013-04-24 Thread Borislav Petkov
From: Borislav Petkov 

Fix this:

arch/x86/boot/compressed/eboot.c: In function ‘setup_efi_vars’:
arch/x86/boot/compressed/eboot.c:269:2: warning: passing argument 1 of 
‘efi_call_phys’ makes pointer from integer without a cast [enabled by default]
In file included from arch/x86/boot/compressed/eboot.c:12:0:
/w/kernel/linux/arch/x86/include/asm/efi.h:8:33: note: expected ‘void *’ but 
argument is of type ‘long unsigned int’

after cc5a080c5d40 ("efi: Pass boot services variable info to runtime
code").

Cc: Matthew Garrett 
Cc: Matt Fleming 
Signed-off-by: Borislav Petkov 
---
 arch/x86/boot/compressed/eboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 8615f7581820..41de115a55b7 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -266,7 +266,7 @@ static efi_status_t setup_efi_vars(struct boot_params 
*params)
while (data && data->next)
data = (struct setup_data *)(unsigned long)data->next;
 
-   status = efi_call_phys4(sys_table->runtime->query_variable_info,
+   status = efi_call_phys4((void *)sys_table->runtime->query_variable_info,
EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS, _size,
-- 
1.8.2.135.g7b592fa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC] The meaning of local_cpulist and local_cpus

2013-04-24 Thread Bian LuLu
Hi all,

Recently, i read some codes of PCI portions. I think
local_cpulist is a list about one kind of CPU and
local_cpus is a mask of CPU. But i am not sure when
and how i should use these two parameters.

See http://lxr.linux.no/linux+v3.5.4/drivers/pci/pci-sysfs.c#L390 for
details.

Would anyone please give me some suggestions?
Thanks in advance ;-)


Thanks
Lulu Bian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v8 8/8] ARM: dts: add pinctrl property for spi node for atmel SoC

2013-04-24 Thread Mark Brown
On Wed, Apr 03, 2013 at 02:03:52PM +0800, Wenyou Yang wrote:
> Signed-off-by: Wenyou Yang 

Applied, thanks.


signature.asc
Description: Digital signature


Re: [PATCH v8 7/8] ARM: dts: add spi nodes for the atmel boards

2013-04-24 Thread Mark Brown
On Wed, Apr 03, 2013 at 02:03:05PM +0800, Wenyou Yang wrote:
> From: Richard Genoud 

Applied, thanks.


signature.asc
Description: Digital signature


Re: [PATCH v8 6/8] ARM: dts: add spi nodes for atmel SoC

2013-04-24 Thread Mark Brown
On Wed, Apr 03, 2013 at 02:02:18PM +0800, Wenyou Yang wrote:
> From: Richard Genoud 
> 
> Signed-off-by: Richard Genoud 

Applied, thanks.


signature.asc
Description: Digital signature


Re: [PATCH v8 5/8] ARM: at91: add clocks for spi dt entries

2013-04-24 Thread Mark Brown
On Wed, Apr 03, 2013 at 02:01:22PM +0800, Wenyou Yang wrote:
> From: Richard Genoud 

Applied, thanks.


signature.asc
Description: Digital signature


Re: [PATCH v8 4/8] spi/spi-atmel: BUG: fix doesn' support 16 bits transfers using PIO

2013-04-24 Thread Mark Brown
On Wed, Apr 03, 2013 at 02:00:05PM +0800, Wenyou Yang wrote:
> From: Richard Genoud 
> 
> Fix using PIO transfer mode only support 8 bits transfer, doesn't support 16 
> bits.

This doesn't apply to my -next branch, please check and regenerate.


signature.asc
Description: Digital signature


Re: [PATCH v8 3/8] spi/spi-atmel: add dmaengine support

2013-04-24 Thread Mark Brown
On Wed, Apr 03, 2013 at 01:59:19PM +0800, Wenyou Yang wrote:
> From: Nicolas Ferre 
> 
> Add dmaengine support.
> 
> Using "has_dma_support" member of struct is used to select
> the transfer mode: dmaengine or pdc.

Applied, thanks.


signature.asc
Description: Digital signature


[PATCH] dma: tegra: implement suspend/resume callbacks

2013-04-24 Thread Laxman Dewangan
Implement suspend/resume callbacks to store APB DMA channel's
register on suspend and restore APB DMA channel's register on
resume.

Signed-off-by: Laxman Dewangan 
---
 drivers/dma/tegra20-apb-dma.c |   65 +
 1 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 5a0b66c..ce19340 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -199,6 +200,7 @@ struct tegra_dma_channel {
 
/* Channel-slave specific configuration */
struct dma_slave_config dma_sconfig;
+   struct tegra_dma_channel_regs   channel_reg;
 };
 
 /* tegra_dma: Tegra DMA specific information */
@@ -1440,11 +1442,74 @@ static int tegra_dma_runtime_resume(struct device *dev)
return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int tegra_dma_pm_suspend(struct device *dev)
+{
+   struct tegra_dma *tdma = dev_get_drvdata(dev);
+   int i;
+   int ret;
+
+   /* Enable clock before accessing register */
+   ret = tegra_dma_runtime_resume(dev);
+   if (ret < 0)
+   return ret;
+
+   tdma->reg_gen = tdma_read(tdma, TEGRA_APBDMA_GENERAL);
+   for (i = 0; i < tdma->chip_data->nr_channels; i++) {
+   struct tegra_dma_channel *tdc = >channels[i];
+   struct tegra_dma_channel_regs *ch_reg = >channel_reg;
+
+   ch_reg->csr = tdc_read(tdc, TEGRA_APBDMA_CHAN_CSR);
+   ch_reg->ahb_ptr = tdc_read(tdc, TEGRA_APBDMA_CHAN_AHBPTR);
+   ch_reg->apb_ptr = tdc_read(tdc, TEGRA_APBDMA_CHAN_APBPTR);
+   ch_reg->ahb_seq = tdc_read(tdc, TEGRA_APBDMA_CHAN_AHBSEQ);
+   ch_reg->apb_seq = tdc_read(tdc, TEGRA_APBDMA_CHAN_APBSEQ);
+   }
+
+   /* Disable clock */
+   tegra_dma_runtime_suspend(dev);
+   return 0;
+}
+
+static int tegra_dma_pm_resume(struct device *dev)
+{
+   struct tegra_dma *tdma = dev_get_drvdata(dev);
+   int i;
+   int ret;
+
+   /* Enable clock before accessing register */
+   ret = tegra_dma_runtime_resume(dev);
+   if (ret < 0)
+   return ret;
+
+   tdma_write(tdma, TEGRA_APBDMA_GENERAL, tdma->reg_gen);
+   tdma_write(tdma, TEGRA_APBDMA_CONTROL, 0);
+   tdma_write(tdma, TEGRA_APBDMA_IRQ_MASK_SET, 0xul);
+
+   for (i = 0; i < tdma->chip_data->nr_channels; i++) {
+   struct tegra_dma_channel *tdc = >channels[i];
+   struct tegra_dma_channel_regs *ch_reg = >channel_reg;
+
+   tdc_write(tdc, TEGRA_APBDMA_CHAN_APBSEQ, ch_reg->apb_seq);
+   tdc_write(tdc, TEGRA_APBDMA_CHAN_APBPTR, ch_reg->apb_ptr);
+   tdc_write(tdc, TEGRA_APBDMA_CHAN_AHBSEQ, ch_reg->ahb_seq);
+   tdc_write(tdc, TEGRA_APBDMA_CHAN_AHBPTR, ch_reg->ahb_ptr);
+   tdc_write(tdc, TEGRA_APBDMA_CHAN_CSR,
+   (ch_reg->csr & ~TEGRA_APBDMA_CSR_ENB));
+   }
+
+   /* Disable clock */
+   tegra_dma_runtime_suspend(dev);
+   return 0;
+}
+#endif
+
 static const struct dev_pm_ops tegra_dma_dev_pm_ops = {
 #ifdef CONFIG_PM_RUNTIME
.runtime_suspend = tegra_dma_runtime_suspend,
.runtime_resume = tegra_dma_runtime_resume,
 #endif
+   SET_SYSTEM_SLEEP_PM_OPS(tegra_dma_pm_suspend, tegra_dma_pm_resume)
 };
 
 static struct platform_driver tegra_dmac_driver = {
-- 
1.7.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] swap: redirty page if page write fails on swap file

2013-04-24 Thread Jerome Marchand
On 04/22/2013 10:37 PM, Andrew Morton wrote:
> On Wed, 17 Apr 2013 14:11:55 +0200 Jerome Marchand  
> wrote:
> 
>>
>> Since commit 62c230b, swap_writepage() calls direct_IO on swap files.
>> However, in that case page isn't redirtied if I/O fails, and is therefore
>> handled afterwards as if it has been successfully written to the swap
>> file, leading to memory corruption when the page is eventually swapped
>> back in.
>> This patch sets the page dirty when direct_IO() fails. It fixes a memory
>> corruption that happened while using swap-over-NFS.
>>
>> ...
>>
>> --- a/mm/page_io.c
>> +++ b/mm/page_io.c
>> @@ -222,6 +222,8 @@ int swap_writepage(struct page *page, struct 
>> writeback_control *wbc)
>>  if (ret == PAGE_SIZE) {
>>  count_vm_event(PSWPOUT);
>>  ret = 0;
>> +} else {
>> +set_page_dirty(page);
>>  }
>>  return ret;
>>  }
> 
> So what happens to the page now?  It remains dirty and the kernel later
> tries to write it again?

Yes. Also, AS_EIO or AS_ENOSPC is set to the address space flags (in this
case, swapper_space).

> And if that write also fails, the page is
> effectively leaked until process exit?

AFAICT, there is no special handling for that page afterwards, so if all
subsequent attempts fail, it's indeed going to stay in memory until freed.

Jerome


> 
> 
> Aside: Mel, __swap_writepage() is fairly hair-raising.  It unlocks the
> page before doing the IO and doesn't set PageWriteback().  Why such an
> exception from normal handling?
> 
> Also, what is protecting the page from concurrent reclaim or exit()
> during the above swap_writepage()?
> 
> Seems that the code needs a bunch of fixes or a bunch of comments
> explaining why it is safe and why it has to be this way.
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] regulator: max8973: Don't override control1 variable when set ramp delay bits

2013-04-24 Thread Mark Brown
On Wed, Apr 24, 2013 at 12:14:55AM +0800, Axel Lin wrote:
> Current code overrides control1 variable when setting ramp delay bits.
> Fix it by just setting ramp_delay bits.

Applied, thanks.  Laxman, please check your acks can be cut'n'pasted -
there's regularly things I need to fix up by hand.


signature.asc
Description: Digital signature


Re: [RFC 00/14] perf tools: Introduce new 'ftrace' command

2013-04-24 Thread Namhyung Kim
Hi Ingo,

On Wed, 24 Apr 2013 08:50:18 +0200, Ingo Molnar wrote:
> * Pekka Enberg  wrote:
>
>> Hello,
>> 
>> On Tue, 2013-04-23 at 17:30 +0900, Namhyung Kim wrote:
>> >> This patchset implements a front-end tool for kernel's ftrace.  It
>> >> uses function_graph tracer by default and normal function tracer is
>> >> also supported.  (Of course you need to enable those tracers in your
>> >> kernel first.)
>> 
>> On Tue, Apr 23, 2013 at 6:58 PM, Steven Rostedt  wrote:
>> > Very nice Namhyung, thanks for doing this. I did a quick run through of
>> > the patches and I have no complaints about them. I'm not sure how the
>> > others will feel about it.
>> 
>> I also skimmed through the patches and they look like a reasonable
>> starting point. So FWIW,
>> 
>> Acked-by: Pekka Enberg 
>> 
>> Are there any plans in trying to consolidate 'perf trace' and this? As
>> a user I don't really care what the underlying mechanism and would
>> like things to just work out of the box.
>
> Exactly. I'd love to see ftrace and perf trace unified.
>
> I have no objections against having a 'perf ftrace' interim step - as long 
> as it's really a temporary migration construct, not something we intend to 
> keep forever.

Hmm.. okay.

I think it'd be great if perf trace can cover both of kernel and user
spaces.  But function tracing in userspace looks impossible IMHO.

So how about changing perf trace to receive proposed sub-commands
(live/record/show/report) and following options:

  --kernel::do ftrace (for kernel functions)
  --syscall::   do system call tracing (what perf trace does now)


But I think we need to have an agreement on the file/directory format to
support multiple recorder threads first.  Any comments on this issue?

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2 1/4] perf: Add hardware breakpoint address mask

2013-04-24 Thread Will Deacon
On Tue, Apr 23, 2013 at 04:18:46PM +0100, Jacob Shin wrote:
> On Tue, Apr 23, 2013 at 04:02:40PM +0100, Will Deacon wrote:
> > On Tue, Apr 23, 2013 at 03:40:57PM +0100, Jacob Shin wrote:
> > > >   perf stat -e mem:0x1000/0xf:w a.out
> > 
> > Are you saying that this command would count any write to:
> > 
> > 0x1000
> > 0x1001
> > ...
> > 0x100e
> > 0x100f
> > 
> > ?
> > 
> > If so, that differs from the ARM debug architecture in that the mask is 
> > called
> > `byte-address-select', so a mask of 0b1001 would count accesses at +0 bytes
> > and +3 bytes from the base address. Is that possible to describe with your
> > masking scheme and a single watchpoint?
> > 
> > A mask of 0xf, would count +0, +1, +2 and +3 (essentially bp_len == 4).
> > 
> > Unfortunately, that means I can't just invert the mask like I originally
> > thought.
> 
> Ah, .. that is different .
> 
> Our hardware matches on the breakpoint if:
> 
>   (physical_address & ~bp_addr_mask) == (bp_addr & ~bp_addr_mask)
> 
> In other words, the mask says which of the bp_addr bits hardware should
> ignore when matching.
> 
> .. it would be great if we can come up with userland interface that works
> for both archs. I'm coming up empty at the moment ..

After a bit of thought, I *think* the ARM mechanism is more expressive, and
you could describe your masking in terms of byte-address-select. The
downside is that we'd end up with much larger masks, which could be argued
as counter-intuitive from a user's point of view.

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: OOM-killer and strange RSS value in 3.9-rc7

2013-04-24 Thread Michal Hocko
[CCing SL.B people and linux-mm list]

Just for quick summary. The reporter sees OOM situations with almost
whole memory filled with slab memory. This is a powerpc machine with 4G
RAM.
/proc/slabinfo shows that almost whole slab occupied memory is on
free lists which for some reason don't get freed under memory pressure.
kmalloc-* caches seem to be most affected. For reference:
$ awk 
'{active_size=$2*$4;num_size=$3*$4;active_sum+=active_size;num_sum+=num_size; 
printf "%s: %d %d\n", $1, active_size, num_size}END{printf "sum: %d %d\n", 
active_sum, num_sum}' a | sort -k3 -n | tail -n10
kmemleak_object: 94664384 112746000
pgtable-2^12: 107937792 113246208
kmalloc-8192: 59334656 122159104
kmalloc-32768: 36175872 137887744
task_struct: 27080016 241293920
kmalloc-2048: 17317888 306446336
kmalloc-96: 8734848 307652928
kmalloc-16384: 54919168 516620288
kmalloc-512: 17211392 1226833920
sum: 865488272 3598335904

It is not clear who consumes that memory and the reporter claims this is
vanilla 3.9-rc7 kernel without any third party modules loaded. The issue
seems to be present only with CONFIG_SLUB.

On Wed 24-04-13 12:48:48, Han Pingtian wrote:
> On Tue, Apr 23, 2013 at 03:15:58PM +0200, Michal Hocko wrote:
> > On Tue 23-04-13 12:22:34, Han Pingtian wrote:
> > > On Mon, Apr 22, 2013 at 01:40:52PM +0200, Michal Hocko wrote:
> > > > [...]
> > > > > -CONFIG_SLUB_DEBUG=y
> > > > > -# CONFIG_COMPAT_BRK is not set
> > > > > -# CONFIG_SLAB is not set
> > > > > -CONFIG_SLUB=y
> > > > > +CONFIG_COMPAT_BRK=y
> > > > > +CONFIG_SLAB=y
> > > > 
> > > > I would start with the bad config and SLUB changed to SLAB in the first
> > > > step, though.
> > > > 
> > > Yep, after I changed bad config to use SLAB, the problem disppears after
> > > using the new kernel. Looks like something wrong in SLUB?
> > 
> > It seems so or maybe there is a different issue which is just made
> > visible by SLUB or it is an arch specific problem.
> > What is the workload that triggers this behavior? Can you reduce it to a
> > minimum test case?
> > 
> I can trigger this behavior just with "make -j 64" to rebuild kernel
> from source code. In fact, just after a fresh reboot, I haven't run
> anything, the memory is almost all used or leaked:

The following is right after boot or make -j64?

> # uname -a
> Linux riblp3.upt.austin.ibm.com 3.9.0-rc7 #7 SMP Tue Apr 23 22:49:09 CDT 2013 
> ppc64 ppc64 ppc64 GNU/Linux
> # free -m
>  total   used   free sharedbuffers cached
> Mem:  3788   3697 90  0  1143
> -/+ buffers/cache:   3552235
> Swap: 4031  5   4026
> # awk '{print $1":", $2*$4/1024/1024, $3*$4/1024/1024}' /proc/slabinfo |sort 
> -k 3 -n
> #: 0 0
> bip-128: 0 0
> bsg_cmd: 0 0
> configfs_dir_cache: 0 0
> dma-kmalloc-1024: 0 0
> dma-kmalloc-128: 0 0
> dma-kmalloc-131072: 0 0
> dma-kmalloc-16: 0 0
> dma-kmalloc-16384: 0 0
> dma-kmalloc-192: 0 0
> dma-kmalloc-2048: 0 0
> dma-kmalloc-256: 0 0
> dma-kmalloc-32: 0 0
> dma-kmalloc-32768: 0 0
> dma-kmalloc-4096: 0 0
> dma-kmalloc-512: 0 0
> dma-kmalloc-64: 0 0
> dma-kmalloc-65536: 0 0
> dma-kmalloc-8: 0 0
> dma-kmalloc-8192: 0 0
> dma-kmalloc-96: 0 0
> dm_rq_target_io: 0 0
> dm_uevent: 0 0
> dquot: 0 0
> ext4_allocation_context: 0 0
> ext4_extent_status: 0 0
> ext4_free_data: 0 0
> ext4_inode_cache: 0 0
> ext4_io_end: 0 0
> ext4_io_page: 0 0
> ext4_xattr: 0 0
> isofs_inode_cache: 0 0
> jbd2_journal_head: 0 0
> jbd2_revoke_record_s: 0 0
> kcopyd_job: 0 0
> kmalloc-131072: 0 0
> net_namespace: 0 0
> nfsd4_delegations: 0 0
> nfsd4_openowners: 0 0
> nfs_direct_cache: 0 0
> pid_namespace: 0 0
> rtas_flash_cache: 0 0
> scsi_tgt_cmd: 0 0
> slabinfo: 0 0
> tw_sock_TCPv6: 0 0
> UDP-Lite: 0 0
> UDPLITEv6: 0 0
> xfs_dquot: 0 0
> mqueue_inode_cache: 0.0623779 0.0623779
> tw_sock_TCP: 0.0625 0.0625
> hugetlbfs_inode_cache: 0.124146 0.124146
> taskstats: 0.186745 0.186745
> fscache_cookie_jar: 0.187454 0.187454
> ip_fib_trie: 0.187454 0.187454
> bip-256: 0.249756 0.249756
> shared_policy_node: 0.249939 0.249939
> nfs_inode_cache: 0.25 0.25
> rpc_inode_cache: 0.311279 0.311279
> UDPv6: 0.553711 0.553711
> kmem_cache_node: 0.5625 0.5625
> dio: 0.622559 0.622559
> TCPv6: 0.622559 0.622559
> blkdev_queue: 0.679443 0.679443
> bdev_cache: 0.748535 0.748535
> xfs_efd_item: 0.994873 0.994873
> fsnotify_event_holder: 1.18721 1.18721
> nf_conntrack_c102d400: 1.18721 1.18721
> kmem_cache: 1.23047 1.23047
> TCP: 1.96875 1.96875
> UDP: 2.12085 2.12085
> xfs_btree_cur: 2.24945 2.24945
> buffer_head: 2.4369 2.4369
> posix_timers_cache: 2.55812 2.55812
> xfs_ili: 3.36841 3.36841
> blkdev_ioc: 3.37418 3.37418
> bip-16: 3.6731 3.6731
> xfs_da_state: 3.99121 3.99121
> xfs_trans: 3.99902 3.99902
> shmem_inode_cache: 4.24429 4.24429
> blkdev_requests: 4.67949 4.67949
> ext4_system_zone: 4.68636 4.68636
> radix_tree_node: 4.79664 4.79664
> sigqueue: 4.93027 4.93027
> fsnotify_event: 4.93629 4.93629
> kmalloc-8: 4.9375 4.9375
> 

[PATCH 04/26] perf tools: Move programs check into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving programs check into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 24 
 tools/perf/config/Makefile | 10 ++
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 518d540..e543234 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -58,6 +58,14 @@ $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
 CC = $(CROSS_COMPILE)gcc
 AR = $(CROSS_COMPILE)ar
 
+RM  = rm -f
+MKDIR   = mkdir
+FIND= find
+INSTALL = install
+FLEX= flex
+BISON   = bison
+STRIP  ?= strip
+
 # include config/Makefile by default and rule out
 # non-config cases
 config := 1
@@ -102,7 +110,6 @@ CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables 
-Wall -Wextra -std=gnu99
 EXTLIBS = -lpthread -lrt -lelf -lm
 ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
-D_GNU_SOURCE
 ALL_LDFLAGS = $(LDFLAGS)
-STRIP ?= strip
 
 # Among the variables below, these:
 #   perfexecdir
@@ -139,13 +146,6 @@ lib = lib
 
 export prefix bindir sharedir sysconfdir
 
-RM = rm -f
-MKDIR = mkdir
-FIND = find
-INSTALL = install
-FLEX = flex
-BISON= bison
-
 # sparse is architecture-neutral, which means that we need to tell it
 # explicitly what architecture to check for. Fix this up for yours..
 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
@@ -154,14 +154,6 @@ ifneq ($(MAKECMDGOALS),clean)
 ifneq ($(MAKECMDGOALS),tags)
 -include config/feature-tests.mak
 
-ifeq ($(call get-executable,$(FLEX)),)
-   dummy := $(error Error: $(FLEX) is missing on this system, please 
install it)
-endif
-
-ifeq ($(call get-executable,$(BISON)),)
-   dummy := $(error Error: $(BISON) is missing on this system, please 
install it)
-endif
-
 ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror 
-fstack-protector-all,-fstack-protector-all),y)
CFLAGS := $(CFLAGS) -fstack-protector-all
 endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index fe317c2..04bf8ac 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -32,3 +32,13 @@ endif
 ifeq ($(NO_PERF_REGS),0)
 BASIC_CFLAGS += -DHAVE_PERF_REGS
 endif
+
+-include config/feature-tests.mak
+
+ifeq ($(call get-executable,$(FLEX)),)
+   dummy := $(error Error: $(FLEX) is missing on this system, please 
install it)
+endif
+
+ifeq ($(call get-executable,$(BISON)),)
+   dummy := $(error Error: $(BISON) is missing on this system, please 
install it)
+endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 02/26] perf tools: Fix tab vs spaces issue in Makefile ifdef/endif

2013-04-24 Thread Jiri Olsa
Unmatched spaces/tabs Makefile indentation could make the
Makefile fails. While the tabed line could be considered
sometimes as follow up for rule command, the mixed space
tab meses up with makefile if conditions.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index b0f164b..c8fb0fd 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -90,7 +90,7 @@ endif
 
 # Treat warnings as errors unless directed not to
 ifneq ($(WERROR),0)
-   CFLAGS_WERROR := -Werror
+  CFLAGS_WERROR := -Werror
 endif
 
 ifeq ("$(origin DEBUG)", "command line")
@@ -819,10 +819,10 @@ endif
 ifdef NO_DEMANGLE
BASIC_CFLAGS += -DNO_DEMANGLE
 else
-ifdef HAVE_CPLUS_DEMANGLE
+   ifdef HAVE_CPLUS_DEMANGLE
EXTLIBS += -liberty
BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
-else
+   else
FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) 
-DPACKAGE='perf' -lbfd
has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd)
ifeq ($(has_bfd),y)
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/26] perf tools: Move compiler and linker flags check into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving compiler and linker flags check into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 110 -
 tools/perf/config/Makefile |  66 +++
 2 files changed, 85 insertions(+), 91 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index e543234..55382f9 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -52,6 +52,20 @@ include config/utilities.mak
 #
 # Define NO_LIBNUMA if you do not want numa perf benchmark
 
+ifeq ($(srctree),)
+srctree := $(patsubst %/,%,$(dir $(shell pwd)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+#$(info Determined 'srctree' to be $(srctree))
+endif
+
+ifneq ($(objtree),)
+#$(info Determined 'objtree' to be $(objtree))
+endif
+
+ifneq ($(OUTPUT),)
+#$(info Determined 'OUTPUT' to be $(OUTPUT))
+endif
+
 $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
 
@@ -66,6 +80,9 @@ FLEX= flex
 BISON   = bison
 STRIP  ?= strip
 
+LK_DIR = ../lib/lk/
+TRACE_EVENT_DIR = ../lib/traceevent/
+
 # include config/Makefile by default and rule out
 # non-config cases
 config := 1
@@ -84,33 +101,10 @@ ifeq ($(config),1)
 include config/Makefile
 endif
 
-# Treat warnings as errors unless directed not to
-ifneq ($(WERROR),0)
-  CFLAGS_WERROR := -Werror
-endif
-
-ifeq ("$(origin DEBUG)", "command line")
-  PERF_DEBUG = $(DEBUG)
-endif
-ifndef PERF_DEBUG
-  CFLAGS_OPTIMIZE = -O6
-endif
-
-ifdef PARSER_DEBUG
-   PARSER_DEBUG_BISON  := -t
-   PARSER_DEBUG_FLEX   := -d
-   PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG
-endif
-
 ifdef NO_NEWT
NO_SLANG=1
 endif
 
-CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra 
-std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) 
$(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS)
-EXTLIBS = -lpthread -lrt -lelf -lm
-ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
-D_GNU_SOURCE
-ALL_LDFLAGS = $(LDFLAGS)
-
 # Among the variables below, these:
 #   perfexecdir
 #   template_dir
@@ -150,71 +144,6 @@ export prefix bindir sharedir sysconfdir
 # explicitly what architecture to check for. Fix this up for yours..
 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),tags)
--include config/feature-tests.mak
-
-ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror 
-fstack-protector-all,-fstack-protector-all),y)
-   CFLAGS := $(CFLAGS) -fstack-protector-all
-endif
-
-ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror 
-Wstack-protector,-Wstack-protector),y)
-   CFLAGS := $(CFLAGS) -Wstack-protector
-endif
-
-ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror 
-Wvolatile-register-var,-Wvolatile-register-var),y)
-   CFLAGS := $(CFLAGS) -Wvolatile-register-var
-endif
-
-ifndef PERF_DEBUG
-   ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) 
-D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y)
-   CFLAGS := $(CFLAGS) -D_FORTIFY_SOURCE=2
-   endif
-endif
-
-### --- END CONFIGURATION SECTION ---
-
-ifeq ($(srctree),)
-srctree := $(patsubst %/,%,$(dir $(shell pwd)))
-srctree := $(patsubst %/,%,$(dir $(srctree)))
-#$(info Determined 'srctree' to be $(srctree))
-endif
-
-ifneq ($(objtree),)
-#$(info Determined 'objtree' to be $(objtree))
-endif
-
-ifneq ($(OUTPUT),)
-#$(info Determined 'OUTPUT' to be $(OUTPUT))
-endif
-
-BASIC_CFLAGS = \
-   -Iutil/include \
-   -Iarch/$(ARCH)/include \
-   $(if $(objtree),-I$(objtree)/arch/$(ARCH)/include/generated/uapi) \
-   -I$(srctree)/arch/$(ARCH)/include/uapi \
-   -I$(srctree)/arch/$(ARCH)/include \
-   $(if $(objtree),-I$(objtree)/include/generated/uapi) \
-   -I$(srctree)/include/uapi \
-   -I$(srctree)/include \
-   -I$(OUTPUT)util \
-   -Iutil \
-   -I. \
-   -I$(TRACE_EVENT_DIR) \
-   -I../lib/ \
-   -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-
-BASIC_LDFLAGS =
-
-ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
-   BIONIC := 1
-   EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
-   EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
-   BASIC_CFLAGS += -I.
-endif
-endif # MAKECMDGOALS != tags
-endif # MAKECMDGOALS != clean
-
 # Guard against environment variables
 BUILTIN_OBJS =
 LIB_H =
@@ -227,9 +156,6 @@ SCRIPT_SH += perf-archive.sh
 grep-libs = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
 
-LK_DIR = ../lib/lk/
-TRACE_EVENT_DIR = ../lib/traceevent/
-
 LK_PATH=$(LK_DIR)
 
 ifneq ($(OUTPUT),)
@@ -543,6 +469,8 @@ PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
 ifneq ($(MAKECMDGOALS),clean)
 ifneq ($(MAKECMDGOALS),tags)
 
+-include config/feature-tests.mak
+
 # We choose to avoid "if .. else if .. else .. endif 

[PATCH 01/26] perf tools: Add automated make test suite

2013-04-24 Thread Jiri Olsa
Adding automated test for testing the build process.
To run it you need to be in perf directory or specify
one with PERF variable. It's also possible to specify
optional Makefile to test via MK variable.

Whole suite is executed twice, the second time with
O=/tmp/xxx option added.

To run the whole suite:
  $ make -f tests/make
  - make_pure: cd . && make -f Makefile
test: test -x ./perf
  - make_clean_all: cd . && make -f Makefile clean all
test: test -x ./perf
  - make_python_perf_so: cd . && make -f Makefile python/perf.so
test: test -f ./python/perf.so
  - make_debug: cd . && make -f Makefile DEBUG=1
test: test -x ./perf
  - make_no_libperl: cd . && make -f Makefile NO_LIBPERL=1
test: test -x ./perf

You see command line for 'make_pure' test right away,
and the output is stored into 'make_pure' file.

To run simple test:
  $ make -f tests/make make_debug
  - make_debug: cd . && make -f Makefile DEBUG=1
test: test -x ./perf

At this moment tests checks for successfull build
and for existence of several built files. Additional
after-build checks could be added.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/tests/make | 141 ++
 1 file changed, 141 insertions(+)
 create mode 100644 tools/perf/tests/make

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
new file mode 100644
index 000..6fdc8f5
--- /dev/null
+++ b/tools/perf/tests/make
@@ -0,0 +1,141 @@
+ifndef PERF
+PERF := .
+endif
+
+ifndef MK
+MK := Makefile
+endif
+
+# standard single make variable specified
+make_clean_all  := clean all
+make_python_perf_so := python/perf.so
+make_debug  := DEBUG=1
+make_no_libperl := NO_LIBPERL=1
+make_no_libpython   := NO_LIBPYTHON=1
+make_no_scripts := NO_LIBPYTHON=1 NO_LIBPERL=1
+make_no_newt:= NO_NEWT=1
+make_no_slang   := NO_SLANG=1
+make_no_gtk2:= NO_GTK2=1
+make_no_ui  := NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
+make_no_demangle:= NO_DEMANGLE=1
+make_no_libelf  := NO_LIBELF=1
+make_no_libunwind   := NO_LIBUNWIND=1
+make_no_backtrace   := NO_BACKTRACE=1
+make_no_libnuma := NO_LIBNUMA=1
+make_no_libaudit:= NO_LIBAUDIT=1
+make_no_libbionic   := NO_LIBBIONIC=1
+make_tags   := tags
+make_cscope := cscope
+make_help   := help
+make_doc:= doc
+make_perf_o := perf.o
+make_util_map_o := util/map.o
+
+# all the NO_* variable combined
+make_minimal:= NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
+make_minimal+= NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
+make_minimal+= NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
+
+# $(run) contains all available tests
+run := make_pure
+run += make_clean_all
+run += make_python_perf_so
+run += make_debug
+run += make_no_libperl
+run += make_no_libpython
+run += make_no_scripts
+run += make_no_newt
+run += make_no_slang
+run += make_no_gtk2
+run += make_no_ui
+run += make_no_demangle
+run += make_no_libelf
+run += make_no_libunwind
+run += make_no_backtrace
+run += make_no_libnuma
+run += make_no_libaudit
+run += make_no_libbionic
+run += make_tags
+run += make_cscope
+run += make_help
+run += make_doc
+run += make_perf_o
+run += make_util_map_o
+run += make_minimal
+
+# $(run_O) contains same portion of $(run) tests with '_O' attached
+# to distinguish O=... tests
+run_O := $(addsuffix _O,$(run))
+
+# disable some tests for O=...
+run_O := $(filter-out make_python_perf_so_O,$(run_O))
+
+# define test for each compile as 'test_NAME' variable
+# with the test itself as a value
+test_make_tags   = test -f tags
+test_make_cscope = test -f cscope.out
+
+test_make_tags_O   := $(test_make_tags)
+test_make_cscope_O := $(test_make_cscope)
+
+test_ok  := true
+test_make_help   := $(test_ok)
+test_make_doc:= $(test_ok)
+test_make_help_O := $(test_ok)
+test_make_doc_O  := $(test_ok)
+
+test_make_python_perf_so := test -f $(PERF)/python/perf.so
+
+test_make_perf_o := test -f $(PERF)/perf.o
+test_make_util_map_o := test -f $(PERF)/util/map.o
+
+# Kbuild tests only
+#test_make_python_perf_so_O := test -f $$TMP/tools/perf/python/perf.so
+#test_make_perf_o_O := test -f $$TMP/tools/perf/perf.o
+#test_make_util_map_o_O := test -f $$TMP/tools/perf/util/map.o
+
+test_make_perf_o_O := true
+test_make_util_map_o_O := true
+
+test_default = test -x $(PERF)/perf
+test = $(if $(test_$1),$(test_$1),$(test_default))
+
+test_default_O = test -x $$TMP/perf
+test_O = $(if $(test_$1),$(test_$1),$(test_default_O))
+
+all:
+
+ifdef DEBUG
+d := $(info run   $(run))
+d := $(info run_O $(run_O))
+endif
+
+MAKEFLAGS := --no-print-directory
+
+clean := @cd $(PERF); make -s -f $(MK) clean >/dev/null
+
+$(run):
+   $(call clean) && \
+   cmd="cd 

[PATCH 09/26] perf tools: Move libaudit check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving libaudit check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile|  9 +
 tools/perf/config/Makefile | 11 +++
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 332d421..b738e01 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -507,14 +507,7 @@ ifndef NO_LIBUNWIND
 endif
 
 ifndef NO_LIBAUDIT
-   FLAGS_LIBAUDIT = $(ALL_CFLAGS) $(ALL_LDFLAGS) -laudit
-   ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y)
-   msg := $(warning No libaudit.h found, disables 'trace' tool, 
please install audit-libs-devel or libaudit-dev);
-   else
-   BASIC_CFLAGS += -DLIBAUDIT_SUPPORT
-   BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
-   EXTLIBS += -laudit
-   endif
+   BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
 endif
 
 ifndef NO_SLANG
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 92c395f..52d6fe9 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -197,3 +197,14 @@ ifndef NO_LIBUNWIND
BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS)
BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS)
 endif # NO_LIBUNWIND
+
+ifndef NO_LIBAUDIT
+   FLAGS_LIBAUDIT = $(ALL_CFLAGS) $(ALL_LDFLAGS) -laudit
+   ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y)
+   msg := $(warning No libaudit.h found, disables 'trace' tool, 
please install audit-libs-devel or libaudit-dev);
+   NO_LIBAUDIT := 1
+   else
+   BASIC_CFLAGS += -DLIBAUDIT_SUPPORT
+   EXTLIBS += -laudit
+   endif
+endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 06/26] perf tools: Move libelf check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving libelf check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 46 -
 tools/perf/config/Makefile | 47 ++
 2 files changed, 47 insertions(+), 46 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 55382f9..c309a5b 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -475,45 +475,6 @@ ifneq ($(MAKECMDGOALS),tags)
 # because maintaining the nesting to match is a pain.  If
 # we had "elif" things would have been much nicer...
 
-ifdef NO_LIBELF
-   NO_DWARF := 1
-   NO_DEMANGLE := 1
-   NO_LIBUNWIND := 1
-else
-FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
-ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
-   FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS)
-   ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
-   LIBC_SUPPORT := 1
-   endif
-   ifeq ($(BIONIC),1)
-   LIBC_SUPPORT := 1
-   endif
-   ifeq ($(LIBC_SUPPORT),1)
-   msg := $(warning No libelf found, disables 'probe' tool, please 
install elfutils-libelf-devel/libelf-dev);
-
-   NO_LIBELF := 1
-   NO_DWARF := 1
-   NO_DEMANGLE := 1
-   else
-   msg := $(error No gnu/libc-version.h found, please install 
glibc-dev[el]/glibc-static);
-   endif
-else
-   # for linking with debug library, run like:
-   # make DEBUG=1 LIBDW_DIR=/opt/libdw/
-   ifdef LIBDW_DIR
-   LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
-   LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
-   endif
-
-   FLAGS_DWARF=$(ALL_CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) 
$(ALL_LDFLAGS) $(EXTLIBS)
-   ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
-   msg := $(warning No libdw.h found or old libdw.h found or 
elfutils is older than 0.138, disables dwarf support. Please install new 
elfutils-devel/libdw-dev);
-   NO_DWARF := 1
-   endif # Dwarf support
-endif # SOURCE_LIBELF
-endif # NO_LIBELF
-
 # There's only x86 (both 32 and 64) support for CFI unwind so far
 ifneq ($(ARCH),x86)
NO_LIBUNWIND := 1
@@ -555,13 +516,6 @@ BUILTIN_OBJS := $(filter-out 
$(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS))
 LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
 
 else # NO_LIBELF
-BASIC_CFLAGS += -DLIBELF_SUPPORT
-
-FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
-ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
-   BASIC_CFLAGS += -DLIBELF_MMAP
-endif
-
 ifndef NO_DWARF
 ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
msg := $(warning DWARF register mappings have not been defined for 
architecture $(ARCH), DWARF support disabled);
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 9ce522a..ef09d6c 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -108,3 +108,50 @@ ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
BASIC_CFLAGS += -I.
 endif
+
+ifdef NO_LIBELF
+   NO_DWARF := 1
+   NO_DEMANGLE := 1
+   NO_LIBUNWIND := 1
+else
+FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
+ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
+   FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS)
+   ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
+   LIBC_SUPPORT := 1
+   endif
+   ifeq ($(BIONIC),1)
+   LIBC_SUPPORT := 1
+   endif
+   ifeq ($(LIBC_SUPPORT),1)
+   msg := $(warning No libelf found, disables 'probe' tool, please 
install elfutils-libelf-devel/libelf-dev);
+
+   NO_LIBELF := 1
+   NO_DWARF := 1
+   NO_DEMANGLE := 1
+   else
+   msg := $(error No gnu/libc-version.h found, please install 
glibc-dev[el]/glibc-static);
+   endif
+else
+   # for linking with debug library, run like:
+   # make DEBUG=1 LIBDW_DIR=/opt/libdw/
+   ifdef LIBDW_DIR
+   LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
+   LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
+   endif
+
+   FLAGS_DWARF=$(ALL_CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) 
$(ALL_LDFLAGS) $(EXTLIBS)
+   ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
+   msg := $(warning No libdw.h found or old libdw.h found or 
elfutils is older than 0.138, disables dwarf support. Please install new 
elfutils-devel/libdw-dev);
+   NO_DWARF := 1
+   endif # Dwarf support
+endif # SOURCE_LIBELF
+endif # NO_LIBELF
+
+ifndef NO_LIBELF
+BASIC_CFLAGS += -DLIBELF_SUPPORT

[PATCH 13/26] perf tools: Move libpython check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving libpython check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 68 ++
 tools/perf/config/Makefile | 63 ++
 2 files changed, 66 insertions(+), 65 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index d0ab4d4..899ef12 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -198,8 +198,6 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
 #
 PROGRAMS += $(OUTPUT)perf
 
-LANG_BINDINGS =
-
 # what 'all' will build and 'install' will install, in perfexecdir
 ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
 
@@ -537,69 +535,9 @@ ifndef NO_LIBPERL
LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
 endif
 
-disable-python = $(eval $(disable-python_code))
-define disable-python_code
-  BASIC_CFLAGS += -DNO_LIBPYTHON
-  $(if $(1),$(warning No $(1) was found))
-  $(warning Python support will not be built)
-endef
-
-override PYTHON := \
-  $(call get-executable-or-default,PYTHON,python)
-
-ifndef PYTHON
-  $(call disable-python,python interpreter)
-else
-
-  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
-
-  ifdef NO_LIBPYTHON
-$(call disable-python)
-  else
-
-override PYTHON_CONFIG := \
-  $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
-
-ifndef PYTHON_CONFIG
-  $(call disable-python,python-config tool)
-else
-
-  PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
-
-  PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
-  PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
-  PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
-  PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
-  FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
-
-  ifneq ($(call 
try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python),y)
-$(call disable-python,Python.h (for Python 2.x))
-  else
-
-ifneq ($(call 
try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version),y)
-  $(warning Python 3 is not yet supported; please set)
-  $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
-  $(warning If you also have Python 2 installed, then)
-  $(warning try something like:)
-  $(warning $(and ,))
-  $(warning $(and ,)  make PYTHON=python2)
-  $(warning $(and ,))
-  $(warning Otherwise, disable Python support entirely:)
-  $(warning $(and ,))
-  $(warning $(and ,)  make NO_LIBPYTHON=1)
-  $(warning $(and ,))
-  $(error   $(and ,))
-else
-  ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
-  EXTLIBS += $(PYTHON_EMBED_LIBADD)
-  LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
-  LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
-  LANG_BINDINGS += $(OUTPUT)python/perf.so
-endif
-
-  endif
-endif
-  endif
+ifndef NO_LIBPYTHON
+   LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
+   LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
 endif
 
 ifdef NO_DEMANGLE
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 2c9e0a5..d5e0386 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -261,3 +261,66 @@ else
EXTLIBS += $(PERL_EMBED_LIBADD)
endif
 endif
+
+disable-python = $(eval $(disable-python_code))
+define disable-python_code
+  BASIC_CFLAGS += -DNO_LIBPYTHON
+  $(if $(1),$(warning No $(1) was found))
+  $(warning Python support will not be built)
+  NO_LIBPYTHON := 1
+endef
+
+override PYTHON := \
+  $(call get-executable-or-default,PYTHON,python)
+
+ifndef PYTHON
+  $(call disable-python,python interpreter)
+else
+
+  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+
+  ifdef NO_LIBPYTHON
+$(call disable-python)
+  else
+
+override PYTHON_CONFIG := \
+  $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
+
+ifndef PYTHON_CONFIG
+  $(call disable-python,python-config tool)
+else
+
+  PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
+
+  PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
+  PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
+  PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
+  PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
+  FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
+
+  ifneq ($(call 
try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python),y)
+$(call disable-python,Python.h (for Python 2.x))
+

[PATCH 08/26] perf tools: Move libunwind check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving libunwind check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 24 
 tools/perf/config/Makefile | 27 +++
 2 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index fd45172..332d421 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -475,26 +475,6 @@ ifneq ($(MAKECMDGOALS),tags)
 # because maintaining the nesting to match is a pain.  If
 # we had "elif" things would have been much nicer...
 
-# There's only x86 (both 32 and 64) support for CFI unwind so far
-ifneq ($(ARCH),x86)
-   NO_LIBUNWIND := 1
-endif
-
-ifndef NO_LIBUNWIND
-# for linking with debug library, run like:
-# make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
-ifdef LIBUNWIND_DIR
-   LIBUNWIND_CFLAGS  := -I$(LIBUNWIND_DIR)/include
-   LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
-endif
-
-FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(ALL_CFLAGS) $(LIBUNWIND_LDFLAGS) 
$(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
-ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
-   msg := $(warning No libunwind found, disabling post unwind support. 
Please install libunwind-dev[el] >= 0.99);
-   NO_LIBUNWIND := 1
-endif # Libunwind support
-endif # NO_LIBUNWIND
-
 -include arch/$(ARCH)/Makefile
 
 ifneq ($(OUTPUT),)
@@ -523,10 +503,6 @@ endif # NO_DWARF
 endif # NO_LIBELF
 
 ifndef NO_LIBUNWIND
-   BASIC_CFLAGS += -DLIBUNWIND_SUPPORT
-   EXTLIBS += $(LIBUNWIND_LIBS)
-   BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS)
-   BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS)
LIB_OBJS += $(OUTPUT)util/unwind.o
 endif
 
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 3620877..92c395f 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -170,3 +170,30 @@ endif # PERF_HAVE_DWARF_REGS
 endif # NO_DWARF
 
 endif # NO_LIBELF
+
+# There's only x86 (both 32 and 64) support for CFI unwind so far
+ifneq ($(ARCH),x86)
+   NO_LIBUNWIND := 1
+endif
+
+ifndef NO_LIBUNWIND
+# for linking with debug library, run like:
+# make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
+ifdef LIBUNWIND_DIR
+   LIBUNWIND_CFLAGS  := -I$(LIBUNWIND_DIR)/include
+   LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
+endif
+
+FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(ALL_CFLAGS) $(LIBUNWIND_LDFLAGS) 
$(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
+ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
+   msg := $(warning No libunwind found, disabling post unwind support. 
Please install libunwind-dev[el] >= 0.99);
+   NO_LIBUNWIND := 1
+endif # Libunwind support
+endif # NO_LIBUNWIND
+
+ifndef NO_LIBUNWIND
+   BASIC_CFLAGS += -DLIBUNWIND_SUPPORT
+   EXTLIBS += $(LIBUNWIND_LIBS)
+   BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS)
+   BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS)
+endif # NO_LIBUNWIND
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 17/26] perf tools: Move paths config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving paths config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 58 --
 tools/perf/config/Makefile | 52 +
 2 files changed, 52 insertions(+), 58 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 07612be..74e3cf6 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -101,39 +101,6 @@ ifeq ($(config),1)
 include config/Makefile
 endif
 
-# Among the variables below, these:
-#   perfexecdir
-#   template_dir
-#   mandir
-#   infodir
-#   htmldir
-#   ETC_PERFCONFIG (but not sysconfdir)
-# can be specified as a relative path some/where/else;
-# this is interpreted as relative to $(prefix) and "perf" at
-# runtime figures out where they are based on the path to the executable.
-# This can help installing the suite in a relocatable way.
-
-# Make the path relative to DESTDIR, not to prefix
-ifndef DESTDIR
-prefix = $(HOME)
-endif
-bindir_relative = bin
-bindir = $(prefix)/$(bindir_relative)
-mandir = share/man
-infodir = share/info
-perfexecdir = libexec/perf-core
-sharedir = $(prefix)/share
-template_dir = share/perf-core/templates
-htmldir = share/doc/perf-doc
-ifeq ($(prefix),/usr)
-sysconfdir = /etc
-ETC_PERFCONFIG = $(sysconfdir)/perfconfig
-else
-sysconfdir = $(prefix)/etc
-ETC_PERFCONFIG = etc/perfconfig
-endif
-lib = lib
-
 export prefix bindir sharedir sysconfdir
 
 # sparse is architecture-neutral, which means that we need to tell it
@@ -557,23 +524,6 @@ endif
 endif # MAKECMDGOALS != tags
 endif # MAKECMDGOALS != clean
 
-# Shell quote (do not use $(call) to accommodate ancient setups);
-
-ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
-
-DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
-bindir_SQ = $(subst ','\'',$(bindir))
-bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
-mandir_SQ = $(subst ','\'',$(mandir))
-infodir_SQ = $(subst ','\'',$(infodir))
-perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
-template_dir_SQ = $(subst ','\'',$(template_dir))
-htmldir_SQ = $(subst ','\'',$(htmldir))
-prefix_SQ = $(subst ','\'',$(prefix))
-sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
-
-SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
-
 LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive 
-Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
 ALL_CFLAGS += $(BASIC_CFLAGS)
@@ -582,7 +532,6 @@ ALL_LDFLAGS += $(BASIC_LDFLAGS)
 
 export INSTALL SHELL_PATH
 
-
 ### Build rules
 
 SHELL = $(SHELL_PATH)
@@ -824,13 +773,6 @@ check: $(OUTPUT)common-cmds.h
 
 ### Installation rules
 
-ifneq ($(filter /%,$(firstword $(perfexecdir))),)
-perfexec_instdir = $(perfexecdir)
-else
-perfexec_instdir = $(prefix)/$(perfexecdir)
-endif
-perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
-
 install-bin: all
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index b559693..a0dbc24 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -390,3 +390,55 @@ ifndef NO_LIBNUMA
EXTLIBS += -lnuma
endif
 endif
+
+# Among the variables below, these:
+#   perfexecdir
+#   template_dir
+#   mandir
+#   infodir
+#   htmldir
+#   ETC_PERFCONFIG (but not sysconfdir)
+# can be specified as a relative path some/where/else;
+# this is interpreted as relative to $(prefix) and "perf" at
+# runtime figures out where they are based on the path to the executable.
+# This can help installing the suite in a relocatable way.
+
+# Make the path relative to DESTDIR, not to prefix
+ifndef DESTDIR
+prefix = $(HOME)
+endif
+bindir_relative = bin
+bindir = $(prefix)/$(bindir_relative)
+mandir = share/man
+infodir = share/info
+perfexecdir = libexec/perf-core
+sharedir = $(prefix)/share
+template_dir = share/perf-core/templates
+htmldir = share/doc/perf-doc
+ifeq ($(prefix),/usr)
+sysconfdir = /etc
+ETC_PERFCONFIG = $(sysconfdir)/perfconfig
+else
+sysconfdir = $(prefix)/etc
+ETC_PERFCONFIG = etc/perfconfig
+endif
+lib = lib
+
+# Shell quote (do not use $(call) to accommodate ancient setups);
+ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
+DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
+bindir_SQ = $(subst ','\'',$(bindir))
+mandir_SQ = $(subst ','\'',$(mandir))
+infodir_SQ = $(subst ','\'',$(infodir))
+perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
+template_dir_SQ = $(subst ','\'',$(template_dir))
+htmldir_SQ = $(subst ','\'',$(htmldir))
+prefix_SQ = $(subst ','\'',$(prefix))
+sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
+
+ifneq ($(filter /%,$(firstword $(perfexecdir))),)
+perfexec_instdir = $(perfexecdir)
+else
+perfexec_instdir = $(prefix)/$(perfexecdir)
+endif
+perfexec_instdir_SQ = $(subst 

[tip:sched/core] sched: Prevent to re-select dst-cpu in load_balance()

2013-04-24 Thread tip-bot for Joonsoo Kim
Commit-ID:  e02e60c109ca70935bad1131976bdbf5160cf576
Gitweb: http://git.kernel.org/tip/e02e60c109ca70935bad1131976bdbf5160cf576
Author: Joonsoo Kim 
AuthorDate: Tue, 23 Apr 2013 17:27:42 +0900
Committer:  Ingo Molnar 
CommitDate: Wed, 24 Apr 2013 08:52:46 +0200

sched: Prevent to re-select dst-cpu in load_balance()

Commit 88b8dac0 makes load_balance() consider other cpus in its
group. But, in that, there is no code for preventing to
re-select dst-cpu. So, same dst-cpu can be selected over and
over.

This patch add functionality to load_balance() in order to
exclude cpu which is selected once. We prevent to re-select
dst_cpu via env's cpus, so now, env's cpus is a candidate not
only for src_cpus, but also dst_cpus.

With this patch, we can remove lb_iterations and
max_lb_iterations, because we decide whether we can go ahead or
not via env's cpus.

Signed-off-by: Joonsoo Kim 
Acked-by: Peter Zijlstra 
Tested-by: Jason Low 
Cc: Srivatsa Vaddagiri 
Cc: Davidlohr Bueso 
Cc: Peter Zijlstra 
Link: 
http://lkml.kernel.org/r/1366705662-3587-7-git-send-email-iamjoonsoo@lge.com
Signed-off-by: Ingo Molnar 
---
 kernel/sched/fair.c | 33 +++--
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5b1e966..acaf567 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3905,7 +3905,7 @@ int can_migrate_task(struct task_struct *p, struct lb_env 
*env)
return 0;
 
if (!cpumask_test_cpu(env->dst_cpu, tsk_cpus_allowed(p))) {
-   int new_dst_cpu;
+   int cpu;
 
schedstat_inc(p, se.statistics.nr_failed_migrations_affine);
 
@@ -3920,12 +3920,15 @@ int can_migrate_task(struct task_struct *p, struct 
lb_env *env)
if (!env->dst_grpmask || (env->flags & LBF_SOME_PINNED))
return 0;
 
-   new_dst_cpu = cpumask_first_and(env->dst_grpmask,
-   tsk_cpus_allowed(p));
-   if (new_dst_cpu < nr_cpu_ids) {
-   env->flags |= LBF_SOME_PINNED;
-   env->new_dst_cpu = new_dst_cpu;
+   /* Prevent to re-select dst_cpu via env's cpus */
+   for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) {
+   if (cpumask_test_cpu(cpu, tsk_cpus_allowed(p))) {
+   env->flags |= LBF_SOME_PINNED;
+   env->new_dst_cpu = cpu;
+   break;
+   }
}
+
return 0;
}
 
@@ -5008,7 +5011,6 @@ static int load_balance(int this_cpu, struct rq *this_rq,
int *balance)
 {
int ld_moved, cur_ld_moved, active_balance = 0;
-   int lb_iterations, max_lb_iterations;
struct sched_group *group;
struct rq *busiest;
unsigned long flags;
@@ -5028,15 +5030,8 @@ static int load_balance(int this_cpu, struct rq *this_rq,
 * For NEWLY_IDLE load_balancing, we don't need to consider
 * other cpus in our group
 */
-   if (idle == CPU_NEWLY_IDLE) {
+   if (idle == CPU_NEWLY_IDLE)
env.dst_grpmask = NULL;
-   /*
-* we don't care max_lb_iterations in this case,
-* in following patch, this will be removed
-*/
-   max_lb_iterations = 0;
-   } else
-   max_lb_iterations = cpumask_weight(env.dst_grpmask);
 
cpumask_copy(cpus, cpu_active_mask);
 
@@ -5064,7 +5059,6 @@ redo:
schedstat_add(sd, lb_imbalance[idle], env.imbalance);
 
ld_moved = 0;
-   lb_iterations = 1;
if (busiest->nr_running > 1) {
/*
 * Attempt to move tasks. If find_busiest_group has found
@@ -5121,14 +5115,17 @@ more_balance:
 * moreover subsequent load balance cycles should correct the
 * excess load moved.
 */
-   if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0 &&
-   lb_iterations++ < max_lb_iterations) {
+   if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0) {
 
env.dst_rq   = cpu_rq(env.new_dst_cpu);
env.dst_cpu  = env.new_dst_cpu;
env.flags   &= ~LBF_SOME_PINNED;
env.loop = 0;
env.loop_break   = sched_nr_migrate_break;
+
+   /* Prevent to re-select dst_cpu via env's cpus */
+   cpumask_clear_cpu(env.dst_cpu, env.cpus);
+
/*
 * Go back to "more_balance" rather than "redo" since we
 * need to continue with same src_cpu.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to 

[tip:sched/core] sched: Rename load_balance_tmpmask to load_balance_mask

2013-04-24 Thread tip-bot for Joonsoo Kim
Commit-ID:  e6252c3ef4b9cd251b53f7b68035f395d20b044e
Gitweb: http://git.kernel.org/tip/e6252c3ef4b9cd251b53f7b68035f395d20b044e
Author: Joonsoo Kim 
AuthorDate: Tue, 23 Apr 2013 17:27:41 +0900
Committer:  Ingo Molnar 
CommitDate: Wed, 24 Apr 2013 08:52:45 +0200

sched: Rename load_balance_tmpmask to load_balance_mask

This name doesn't represent specific meaning.
So rename it to imply it's purpose.

Signed-off-by: Joonsoo Kim 
Acked-by: Peter Zijlstra 
Tested-by: Jason Low 
Cc: Srivatsa Vaddagiri 
Cc: Davidlohr Bueso 
Cc: Peter Zijlstra 
Link: 
http://lkml.kernel.org/r/1366705662-3587-6-git-send-email-iamjoonsoo@lge.com
Signed-off-by: Ingo Molnar 
---
 kernel/sched/core.c | 4 ++--
 kernel/sched/fair.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ee8c1bd..cb49b2a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6873,7 +6873,7 @@ struct task_group root_task_group;
 LIST_HEAD(task_groups);
 #endif
 
-DECLARE_PER_CPU(cpumask_var_t, load_balance_tmpmask);
+DECLARE_PER_CPU(cpumask_var_t, load_balance_mask);
 
 void __init sched_init(void)
 {
@@ -6910,7 +6910,7 @@ void __init sched_init(void)
 #endif /* CONFIG_RT_GROUP_SCHED */
 #ifdef CONFIG_CPUMASK_OFFSTACK
for_each_possible_cpu(i) {
-   per_cpu(load_balance_tmpmask, i) = (void *)ptr;
+   per_cpu(load_balance_mask, i) = (void *)ptr;
ptr += cpumask_size();
}
 #endif /* CONFIG_CPUMASK_OFFSTACK */
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b8ef321..5b1e966 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4977,7 +4977,7 @@ static struct rq *find_busiest_queue(struct lb_env *env,
 #define MAX_PINNED_INTERVAL512
 
 /* Working cpumask for load_balance and load_balance_newidle. */
-DEFINE_PER_CPU(cpumask_var_t, load_balance_tmpmask);
+DEFINE_PER_CPU(cpumask_var_t, load_balance_mask);
 
 static int need_active_balance(struct lb_env *env)
 {
@@ -5012,7 +5012,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
struct sched_group *group;
struct rq *busiest;
unsigned long flags;
-   struct cpumask *cpus = __get_cpu_var(load_balance_tmpmask);
+   struct cpumask *cpus = __get_cpu_var(load_balance_mask);
 
struct lb_env env = {
.sd = sd,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 15/26] perf tools: Move stdlib check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving stdlib check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 18 --
 tools/perf/config/Makefile | 18 ++
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index c116417..c1fef3d 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -546,24 +546,6 @@ ifeq ($(NO_PERF_REGS),0)
endif
 endif
 
-ifndef NO_STRLCPY
-   ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y)
-   BASIC_CFLAGS += -DHAVE_STRLCPY
-   endif
-endif
-
-ifndef NO_ON_EXIT
-   ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT),y)
-   BASIC_CFLAGS += -DHAVE_ON_EXIT
-   endif
-endif
-
-ifndef NO_BACKTRACE
-   ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT),y)
-   BASIC_CFLAGS += -DBACKTRACE_SUPPORT
-   endif
-endif
-
 ifndef NO_LIBNUMA
FLAGS_LIBNUMA = $(ALL_CFLAGS) $(ALL_LDFLAGS) -lnuma
ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y)
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 68c6a2b..8c832f7 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -361,3 +361,21 @@ else
endif
endif
 endif
+
+ifndef NO_STRLCPY
+   ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y)
+   BASIC_CFLAGS += -DHAVE_STRLCPY
+   endif
+endif
+
+ifndef NO_ON_EXIT
+   ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT),y)
+   BASIC_CFLAGS += -DHAVE_ON_EXIT
+   endif
+endif
+
+ifndef NO_BACKTRACE
+   ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT),y)
+   BASIC_CFLAGS += -DBACKTRACE_SUPPORT
+   endif
+endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv2] arm: Preserve TPIDRURW on context switch

2013-04-24 Thread Will Deacon
Hi Andrew,

On Tue, Apr 23, 2013 at 11:42:22PM +0100, André Hentschel wrote:
> Am 23.04.2013 11:15, schrieb Will Deacon:
> > You could introduce `get' tls functions, which don't do anything for CPUs
> > without the relevant registers.
> 
> Before i have another round of testing and patch formatting/sending,
> what about the untested patch below?

Ok. Comments inline.

> diff --git a/arch/arm/include/asm/thread_info.h 
> b/arch/arm/include/asm/thread_info.h
> index cddda1f..bb5b48d 100644
> --- a/arch/arm/include/asm/thread_info.h
> +++ b/arch/arm/include/asm/thread_info.h
> @@ -58,7 +58,7 @@ struct thread_info {
>   struct cpu_context_save cpu_context;/* cpu context */
>   __u32   syscall;/* syscall number */
>   __u8used_cp[16];/* thread used copro */
> - unsigned long   tp_value;
> + unsigned long   tp_value[2];
>  #ifdef CONFIG_CRUNCH
>   struct crunch_state crunchstate;
>  #endif
> diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h
> index 73409e6..1c10163 100644
> --- a/arch/arm/include/asm/tls.h
> +++ b/arch/arm/include/asm/tls.h
> @@ -2,13 +2,30 @@
>  #define __ASMARM_TLS_H
>  
>  #ifdef __ASSEMBLY__
> + .macro get_tls2_none, tp, tmp1
> + .endm

Cosmetic, but these are really horrible macro names.

> + .macro get_tls2_v6k, tp, tmp1
> + mrc p15, 0, \tmp1, c13, c0, 2   @ get user r/w TLS 
> register
> + str \tmp1, [\tp, #4]
> + .endm
> +
> + .macro get_tls2_v6, tp, tmp1
> + ldr \tmp1, =elf_hwcap
> + ldr \tmp1, [\tmp1, #0]
> + tst \tmp1, #HWCAP_TLS   @ hardware TLS available?
> + mrcne   p15, 0, \tmp1, c13, c0, 2   @ get user r/w TLS 
> register
> + strne   \tmp1, [\tp, #4]

You could factor out some of this hwcap checking now that it's used by both
set and get.

> + .endm
> +
> +
>   .macro set_tls_none, tp, tmp1, tmp2
>   .endm
>  
>   .macro set_tls_v6k, tp, tmp1, tmp2
> - mcr p15, 0, \tp, c13, c0, 3 @ set TLS register
> - mov \tmp1, #0
> - mcr p15, 0, \tmp1, c13, c0, 2   @ clear user r/w TLS register
> + ldrd\tmp1, \tmp2, [\tp]
> + mcr p15, 0, \tmp1, c13, c0, 3   @ set user r/o TLS register
> + mcr p15, 0, \tmp2, c13, c0, 2   @ set user r/w TLS register
>   .endm
>  
>   .macro set_tls_v6, tp, tmp1, tmp2
> @@ -16,33 +33,39 @@
>   ldr \tmp1, [\tmp1, #0]
>   mov \tmp2, #0x0fff
>   tst \tmp1, #HWCAP_TLS   @ hardware TLS available?
> - mcrne   p15, 0, \tp, c13, c0, 3 @ yes, set TLS register
> - movne   \tmp1, #0
> - mcrne   p15, 0, \tmp1, c13, c0, 2   @ clear user r/w TLS register
> - streq   \tp, [\tmp2, #-15]  @ set TLS value at 0x0ff0
> + ldrdne  \tmp1, \tmp2, [\tp]

Does this work for big-endian CPUs?

> + ldreq   \tmp1, [\tp]
> + mcrne   p15, 0, \tmp1, c13, c0, 3   @ yes, set user r/o TLS register
> + mcrne   p15, 0, \tmp2, c13, c0, 2   @ set user r/w TLS register
> + streq   \tmp1, [\tmp2, #-15]@ set TLS value at 0x0ff0
>   .endm
>  
>   .macro set_tls_software, tp, tmp1, tmp2
> - mov \tmp1, #0x0fff
> - str \tp, [\tmp1, #-15]  @ set TLS value at 0x0ff0
> + ldr \tmp1, [\tp]
> + mov \tmp2, #0x0fff
> + str \tmp1, [\tmp2, #-15]@ set TLS value at 0x0ff0
>   .endm
>  #endif
>  
>  #ifdef CONFIG_TLS_REG_EMUL
>  #define tls_emu  1
>  #define has_tls_reg  1
> +#define get_tls2 get_tls2_none
>  #define set_tls  set_tls_none
>  #elif defined(CONFIG_CPU_V6)
>  #define tls_emu  0
>  #define has_tls_reg  (elf_hwcap & HWCAP_TLS)
> +#define get_tls2 get_tls2_v6
>  #define set_tls  set_tls_v6
>  #elif defined(CONFIG_CPU_32v6K)
>  #define tls_emu  0
>  #define has_tls_reg  1
> +#define get_tls2 get_tls2_v6k
>  #define set_tls  set_tls_v6k
>  #else
>  #define tls_emu  0
>  #define has_tls_reg  0
> +#define get_tls2 get_tls2_none
>  #define set_tls  set_tls_software
>  #endif
>  
> diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
> index 0f82098..097686b 100644
> --- a/arch/arm/kernel/entry-armv.S
> +++ b/arch/arm/kernel/entry-armv.S
> @@ -728,7 +728,7 @@ ENTRY(__switch_to)
>   UNWIND(.fnstart )
>   UNWIND(.cantunwind  )
>   add ip, r1, #TI_CPU_SAVE
> - ldr r3, [r2, #TI_TP_VALUE]
> + add r3, r1, #TI_TP_VALUE
>   ARM(stmia   ip!, {r4 - sl, fp, sp, lr} )@ Store most regs on 
> stack
>   THUMB(  stmia   ip!, {r4 - sl, fp} )@ Store most regs on 
> stack
>   THUMB(  str sp, [ip], #4   )
> @@ -736,6 +736,8 @@ ENTRY(__switch_to)
>  

[PATCH 18/26] perf tools: Final touches for CHK config move

2013-04-24 Thread Jiri Olsa
Removing no longer needed ifdefs.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 74e3cf6..cd19007 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -424,14 +424,6 @@ BUILTIN_OBJS += $(OUTPUT)builtin-mem.o
 
 PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
 
-#
-# Platform specific tweaks
-#
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),tags)
-
--include config/feature-tests.mak
-
 # We choose to avoid "if .. else if .. else .. endif endif"
 # because maintaining the nesting to match is a pain.  If
 # we had "elif" things would have been much nicer...
@@ -521,9 +513,6 @@ ifdef ASCIIDOC8
export ASCIIDOC8
 endif
 
-endif # MAKECMDGOALS != tags
-endif # MAKECMDGOALS != clean
-
 LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive 
-Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
 ALL_CFLAGS += $(BASIC_CFLAGS)
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 14/26] perf tools: Move libbfd check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving libbfd check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 37 -
 tools/perf/config/Makefile | 37 +
 2 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 899ef12..c116417 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -540,43 +540,6 @@ ifndef NO_LIBPYTHON
LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
 endif
 
-ifdef NO_DEMANGLE
-   BASIC_CFLAGS += -DNO_DEMANGLE
-else
-   ifdef HAVE_CPLUS_DEMANGLE
-   EXTLIBS += -liberty
-   BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
-   else
-   FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) 
-DPACKAGE='perf' -lbfd
-   has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd)
-   ifeq ($(has_bfd),y)
-   EXTLIBS += -lbfd
-   else
-   FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
-   has_bfd_iberty := $(call 
try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty)
-   ifeq ($(has_bfd_iberty),y)
-   EXTLIBS += -lbfd -liberty
-   else
-   FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz
-   has_bfd_iberty_z := $(call 
try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz)
-   ifeq ($(has_bfd_iberty_z),y)
-   EXTLIBS += -lbfd -liberty -lz
-   else
-   FLAGS_CPLUS_DEMANGLE=$(ALL_CFLAGS) 
$(ALL_LDFLAGS) $(EXTLIBS) -liberty
-   has_cplus_demangle := $(call 
try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle)
-   ifeq ($(has_cplus_demangle),y)
-   EXTLIBS += -liberty
-   BASIC_CFLAGS += 
-DHAVE_CPLUS_DEMANGLE
-   else
-   msg := $(warning No 
bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol 
demangling)
-   BASIC_CFLAGS += -DNO_DEMANGLE
-   endif
-   endif
-   endif
-   endif
-   endif
-endif
-
 ifeq ($(NO_PERF_REGS),0)
ifeq ($(ARCH),x86)
LIB_H += arch/x86/include/perf_regs.h
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index d5e0386..68c6a2b 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -324,3 +324,40 @@ else
 endif
   endif
 endif
+
+ifdef NO_DEMANGLE
+   BASIC_CFLAGS += -DNO_DEMANGLE
+else
+   ifdef HAVE_CPLUS_DEMANGLE
+   EXTLIBS += -liberty
+   BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
+   else
+   FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) 
-DPACKAGE='perf' -lbfd
+   has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd)
+   ifeq ($(has_bfd),y)
+   EXTLIBS += -lbfd
+   else
+   FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
+   has_bfd_iberty := $(call 
try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty)
+   ifeq ($(has_bfd_iberty),y)
+   EXTLIBS += -lbfd -liberty
+   else
+   FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz
+   has_bfd_iberty_z := $(call 
try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz)
+   ifeq ($(has_bfd_iberty_z),y)
+   EXTLIBS += -lbfd -liberty -lz
+   else
+   FLAGS_CPLUS_DEMANGLE=$(ALL_CFLAGS) 
$(ALL_LDFLAGS) $(EXTLIBS) -liberty
+   has_cplus_demangle := $(call 
try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle)
+   ifeq ($(has_cplus_demangle),y)
+   EXTLIBS += -liberty
+   BASIC_CFLAGS += 
-DHAVE_CPLUS_DEMANGLE
+   else
+   msg := $(warning No 
bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol 
demangling)
+   BASIC_CFLAGS += -DNO_DEMANGLE
+   

[PATCH 16/26] perf tools: Move libnuma check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving libnuma check config into config/Makefile

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile|  9 +
 tools/perf/config/Makefile | 11 +++
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index c1fef3d..07612be 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -547,14 +547,7 @@ ifeq ($(NO_PERF_REGS),0)
 endif
 
 ifndef NO_LIBNUMA
-   FLAGS_LIBNUMA = $(ALL_CFLAGS) $(ALL_LDFLAGS) -lnuma
-   ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y)
-   msg := $(warning No numa.h found, disables 'perf bench numa 
mem' benchmark, please install numa-libs-devel or libnuma-dev);
-   else
-   BASIC_CFLAGS += -DLIBNUMA_SUPPORT
-   BUILTIN_OBJS += $(OUTPUT)bench/numa.o
-   EXTLIBS += -lnuma
-   endif
+   BUILTIN_OBJS += $(OUTPUT)bench/numa.o
 endif
 
 ifdef ASCIIDOC8
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 8c832f7..b559693 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -379,3 +379,14 @@ ifndef NO_BACKTRACE
BASIC_CFLAGS += -DBACKTRACE_SUPPORT
endif
 endif
+
+ifndef NO_LIBNUMA
+   FLAGS_LIBNUMA = $(ALL_CFLAGS) $(ALL_LDFLAGS) -lnuma
+   ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y)
+   msg := $(warning No numa.h found, disables 'perf bench numa 
mem' benchmark, please install numa-libs-devel or libnuma-dev);
+   NO_LIBNUMA := 1
+   else
+   BASIC_CFLAGS += -DLIBNUMA_SUPPORT
+   EXTLIBS += -lnuma
+   endif
+endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 11/26] perf tools: Move gtk2 check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving gtk2 check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 25 +++--
 tools/perf/config/Makefile | 15 +++
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 2187a2c..7bf5c10 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -523,24 +523,13 @@ ifndef NO_SLANG
 endif
 
 ifndef NO_GTK2
-   FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config 
--libs --cflags gtk+-2.0 2>/dev/null)
-   ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y)
-   msg := $(warning GTK2 not found, disables GTK2 support. Please 
install gtk2-devel or libgtk2.0-dev);
-   else
-   ifeq ($(call 
try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y)
-   BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR
-   endif
-   BASIC_CFLAGS += -DGTK2_SUPPORT
-   BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 
2>/dev/null)
-   EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
-   LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/util.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
-   endif
+   LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
+   LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
+   LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
+   LIB_OBJS += $(OUTPUT)ui/gtk/util.o
+   LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
+   LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
+   LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
 endif
 
 ifdef NO_LIBPERL
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 008b212..6fc2089 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -225,3 +225,18 @@ ifndef NO_SLANG
EXTLIBS += -lslang
endif
 endif
+
+ifndef NO_GTK2
+   FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config 
--libs --cflags gtk+-2.0 2>/dev/null)
+   ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y)
+   msg := $(warning GTK2 not found, disables GTK2 support. Please 
install gtk2-devel or libgtk2.0-dev);
+   NO_GTK2 := 1
+   else
+   ifeq ($(call 
try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y)
+   BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR
+   endif
+   BASIC_CFLAGS += -DGTK2_SUPPORT
+   BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 
2>/dev/null)
+   EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
+   endif
+endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] VSOCK: Drop bogus __init annotation from vsock_init_tables()

2013-04-24 Thread Geert Uytterhoeven
If gcc (e.g. 4.1.2) decides not to inline vsock_init_tables(), this will
cause a section mismatch:

WARNING: net/vmw_vsock/vsock.o(.text+0x1bc): Section mismatch in reference from 
the function __vsock_core_init() to the function .init.text:vsock_init_tables()
The function __vsock_core_init() references
the function __init vsock_init_tables().
This is often because __vsock_core_init lacks a __init
annotation or the annotation of vsock_init_tables is wrong.

This may cause crashes if VSOCKETS=y and VMWARE_VMCI_VSOCKETS=m.

Signed-off-by: Geert Uytterhoeven 
---
 net/vmw_vsock/af_vsock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 7f93e2a..2e330e8 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -165,7 +165,7 @@ static struct list_head vsock_bind_table[VSOCK_HASH_SIZE + 
1];
 static struct list_head vsock_connected_table[VSOCK_HASH_SIZE];
 static DEFINE_SPINLOCK(vsock_table_lock);
 
-static __init void vsock_init_tables(void)
+static void vsock_init_tables(void)
 {
int i;
 
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 25/26] perf tools: Remove '?=' Makefile STRIP assignment

2013-04-24 Thread Jiri Olsa
No need to use '?=' assignment for STRP variable, the standard
'=' does the same job without creating confusion.

Suggested-by: Namhyung Kim 
Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 6ee3868..763da02 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -82,7 +82,7 @@ FIND= find
 INSTALL = install
 FLEX= flex
 BISON   = bison
-STRIP  ?= strip
+STRIP   = strip
 
 LK_DIR  = $(srctree)/tools/lib/lk/
 TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 26/26] perf tools: Add missing liblk.a dependency for python/perf.so

2013-04-24 Thread Jiri Olsa
Adding missing liblk.a dependency for python/perf.so.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 763da02..649e466 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -151,7 +151,7 @@ export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
 python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
 
 PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
-PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT)
+PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) 
$(LIBLK)
 
 $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
$(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 21/26] perf tools: Switch to full patch C include directories

2013-04-24 Thread Jiri Olsa
Switching to full patch C include directories, to make
the includes clear. Plus little include cleanup.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile|  4 ++--
 tools/perf/config/Makefile | 49 ++
 2 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 4aad9e5..a1fcafe 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -80,8 +80,8 @@ FLEX= flex
 BISON   = bison
 STRIP  ?= strip
 
-LK_DIR = ../lib/lk/
-TRACE_EVENT_DIR = ../lib/traceevent/
+LK_DIR  = $(srctree)/tools/lib/lk/
+TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
 
 # include config/Makefile by default and rule out
 # non-config cases
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index c6e4902..8762209 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -34,7 +34,23 @@ ifeq ($(NO_PERF_REGS),0)
 CFLAGS += -DHAVE_PERF_REGS
 endif
 
--include config/feature-tests.mak
+ifeq ($(src-perf),)
+src-perf := $(srctree)/tools/perf
+endif
+
+ifeq ($(obj-perf),)
+obj-perf := $(objtree)
+endif
+
+ifneq ($(obj-perf),)
+obj-perf := $(abspath $(obj-perf))/
+endif
+
+# include ARCH specific config
+-include $(src-perf)/arch/$(ARCH)/Makefile
+
+include $(src-perf)/config/feature-tests.mak
+include $(src-perf)/config/utilities.mak
 
 ifeq ($(call get-executable,$(FLEX)),)
dummy := $(error Error: $(FLEX) is missing on this system, please 
install it)
@@ -91,19 +107,28 @@ ifndef PERF_DEBUG
 endif
 
 CFLAGS += \
-   -Iutil/include \
-   -Iarch/$(ARCH)/include \
-   $(if $(objtree),-I$(objtree)/arch/$(ARCH)/include/generated/uapi) \
+   -I$(src-perf)/util/include \
+   -I$(src-perf)/arch/$(ARCH)/include \
-I$(srctree)/arch/$(ARCH)/include/uapi \
-I$(srctree)/arch/$(ARCH)/include \
-   $(if $(objtree),-I$(objtree)/include/generated/uapi) \
-I$(srctree)/include/uapi \
-   -I$(srctree)/include \
-   -I$(OUTPUT)util \
-   -Iutil \
-   -I. \
+   -I$(srctree)/include
+
+# $(obj-perf)  for generated common-cmds.h
+# $(obj-perf)/util for generated bison/flex headers
+ifneq ($(OUTPUT),)
+CFLAGS += \
+   -I$(obj-perf)/util \
+   -I$(obj-perf)
+endif
+
+CFLAGS += \
+   -I$(src-perf)/util \
+   -I$(src-perf) \
-I$(TRACE_EVENT_DIR) \
-   -I../lib/ \
+   -I$(srctree)/tools/lib/
+
+CFLAGS += \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 
 ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
@@ -159,7 +184,7 @@ ifeq ($(call 
try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
 endif
 
 # include ARCH specific config
--include arch/$(ARCH)/Makefile
+-include $(src-perf)/arch/$(ARCH)/Makefile
 
 ifndef NO_DWARF
 ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
@@ -329,7 +354,7 @@ else
 else
   LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
   EXTLIBS += $(PYTHON_EMBED_LIBADD)
-  LANG_BINDINGS += $(OUTPUT)python/perf.so
+  LANG_BINDINGS += $(obj-perf)python/perf.so
 endif
   endif
 endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] spi: s3c64xx: Added provision for dedicated cs pin

2013-04-24 Thread Girish KS
On Tue, Apr 23, 2013 at 8:12 PM, Mark Brown  wrote:
> On Mon, Apr 22, 2013 at 12:39:24PM +0530, Girish K S wrote:
>> From: Girish K S 
>>
>> The existing driver supports gpio based /cs signal.
>> For controller's that have one device per controller,
>> the slave device's /cs signal might be internally controlled
>> by the chip select bit of slave select register. They are not
>> externally asserted/deasserted using gpio pin.
>
> This doesn't build:
>
> drivers/spi/spi-s3c64xx.c: In function 's3c64xx_get_slave_ctrldata':
> drivers/spi/spi-s3c64xx.c:1023: error: 'sdd' undeclared (first use in this 
> function)
> drivers/spi/spi-s3c64xx.c:1023: error: (Each undeclared identifier is 
> reported only once
> drivers/spi/spi-s3c64xx.c:1023: error: for each function it appears in.)

Ohh. Sorry. forgot to commit the changes before patch generation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 24/26] perf tools: Replace multiple line assignment with multiple statements

2013-04-24 Thread Jiri Olsa
Replacing multiple line assignment with multiple statements.

Suggested-by: Sam Ravnborg 
Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/config/Makefile | 43 +++
 1 file changed, 19 insertions(+), 24 deletions(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 9765993..f139dcd 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -78,13 +78,12 @@ ifdef PARSER_DEBUG
   CFLAGS += -DPARSER_DEBUG
 endif
 
-CFLAGS += \
-  -fno-omit-frame-pointer \
-  -ggdb3 \
-  -funwind-tables \
-  -Wall \
-  -Wextra \
-  -std=gnu99
+CFLAGS += -fno-omit-frame-pointer
+CFLAGS += -ggdb3
+CFLAGS += -funwind-tables
+CFLAGS += -Wall
+CFLAGS += -Wextra
+CFLAGS += -std=gnu99
 
 EXTLIBS = -lpthread -lrt -lelf -lm
 
@@ -106,30 +105,26 @@ ifndef PERF_DEBUG
   endif
 endif
 
-CFLAGS += \
-  -I$(src-perf)/util/include \
-  -I$(src-perf)/arch/$(ARCH)/include \
-  -I$(srctree)/arch/$(ARCH)/include/uapi \
-  -I$(srctree)/arch/$(ARCH)/include \
-  -I$(srctree)/include/uapi \
-  -I$(srctree)/include
+CFLAGS += -I$(src-perf)/util/include
+CFLAGS += -I$(src-perf)/arch/$(ARCH)/include
+CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
+CFLAGS += -I$(srctree)/arch/$(ARCH)/include
+CFLAGS += -I$(srctree)/include/uapi
+CFLAGS += -I$(srctree)/include
 
 # $(obj-perf)  for generated common-cmds.h
 # $(obj-perf)/util for generated bison/flex headers
 ifneq ($(OUTPUT),)
-CFLAGS += \
-  -I$(obj-perf)/util \
-  -I$(obj-perf)
+CFLAGS += -I$(obj-perf)/util
+CFLAGS += -I$(obj-perf)
 endif
 
-CFLAGS += \
-  -I$(src-perf)/util \
-  -I$(src-perf) \
-  -I$(TRACE_EVENT_DIR) \
-  -I$(srctree)/tools/lib/
+CFLAGS += -I$(src-perf)/util
+CFLAGS += -I$(src-perf)
+CFLAGS += -I$(TRACE_EVENT_DIR)
+CFLAGS += -I$(srctree)/tools/lib/
 
-CFLAGS += \
-  -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 
 ifndef NO_BIONIC
 ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 22/26] perf tools: Add NO_BIONIC variable to confiure bionic setup

2013-04-24 Thread Jiri Olsa
Adding NO_BIONIC variable to confiure bionic setup

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 4 
 tools/perf/config/Makefile | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index a1fcafe..3dd25d9 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -51,6 +51,10 @@ include config/utilities.mak
 # Define NO_BACKTRACE if you do not want stack backtrace debug feature
 #
 # Define NO_LIBNUMA if you do not want numa perf benchmark
+#
+# Define NO_LIBAUDIT if you do not want libaudit support
+#
+# Define NO_LIBBIONIC if you do not want bionic support
 
 ifeq ($(srctree),)
 srctree := $(patsubst %/,%,$(dir $(shell pwd)))
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 8762209..cc464f1 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -131,11 +131,13 @@ CFLAGS += \
 CFLAGS += \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 
+ifndef NO_BIONIC
 ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
BIONIC := 1
EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
 endif
+endif # NO_BIONIC
 
 ifdef NO_LIBELF
NO_DWARF := 1
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 23/26] perf tools: Replace tabs with spaces for all non-commands statements

2013-04-24 Thread Jiri Olsa
Replacing tabs with spaces for all non-commands statements
in 'Makefile' and 'config/Makefile' files.

Suggested-by: Sam Ravnborg 
Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile|  80 -
 tools/perf/config/Makefile | 396 ++---
 2 files changed, 238 insertions(+), 238 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 3dd25d9..6ee3868 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -126,14 +126,14 @@ strip-libs = $(filter-out -l%,$(1))
 LK_PATH=$(LK_DIR)
 
 ifneq ($(OUTPUT),)
-   TE_PATH=$(OUTPUT)
+  TE_PATH=$(OUTPUT)
 ifneq ($(subdir),)
-   LK_PATH=$(OUTPUT)$(LK_DIR)
+  LK_PATH=$(OUTPUT)$(LK_DIR)
 else
-   LK_PATH=$(OUTPUT)
+  LK_PATH=$(OUTPUT)
 endif
 else
-   TE_PATH=$(TRACE_EVENT_DIR)
+  TE_PATH=$(TRACE_EVENT_DIR)
 endif
 
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -177,10 +177,10 @@ OTHER_PROGRAMS = $(OUTPUT)perf
 
 # Set paths to tools early so that they can be used for version tests.
 ifndef SHELL_PATH
-   SHELL_PATH = /bin/sh
+  SHELL_PATH = /bin/sh
 endif
 ifndef PERL_PATH
-   PERL_PATH = /usr/bin/perl
+  PERL_PATH = /usr/bin/perl
 endif
 
 export PERL_PATH
@@ -435,7 +435,7 @@ PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
 -include arch/$(ARCH)/Makefile
 
 ifneq ($(OUTPUT),)
-   BASIC_CFLAGS += -I$(OUTPUT)
+  BASIC_CFLAGS += -I$(OUTPUT)
 endif
 
 ifdef NO_LIBELF
@@ -454,67 +454,67 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
 
 else # NO_LIBELF
 ifndef NO_DWARF
-   LIB_OBJS += $(OUTPUT)util/probe-finder.o
-   LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
+  LIB_OBJS += $(OUTPUT)util/probe-finder.o
+  LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
 endif # NO_DWARF
 endif # NO_LIBELF
 
 ifndef NO_LIBUNWIND
-   LIB_OBJS += $(OUTPUT)util/unwind.o
+  LIB_OBJS += $(OUTPUT)util/unwind.o
 endif
 
 ifndef NO_LIBAUDIT
-   BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
+  BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
 endif
 
 ifndef NO_SLANG
-   LIB_OBJS += $(OUTPUT)ui/browser.o
-   LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
-   LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
-   LIB_OBJS += $(OUTPUT)ui/browsers/map.o
-   LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
-   LIB_OBJS += $(OUTPUT)ui/tui/setup.o
-   LIB_OBJS += $(OUTPUT)ui/tui/util.o
-   LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
-   LIB_OBJS += $(OUTPUT)ui/tui/progress.o
-   LIB_H += ui/browser.h
-   LIB_H += ui/browsers/map.h
-   LIB_H += ui/keysyms.h
-   LIB_H += ui/libslang.h
+  LIB_OBJS += $(OUTPUT)ui/browser.o
+  LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
+  LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
+  LIB_OBJS += $(OUTPUT)ui/browsers/map.o
+  LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
+  LIB_OBJS += $(OUTPUT)ui/tui/setup.o
+  LIB_OBJS += $(OUTPUT)ui/tui/util.o
+  LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
+  LIB_OBJS += $(OUTPUT)ui/tui/progress.o
+  LIB_H += ui/browser.h
+  LIB_H += ui/browsers/map.h
+  LIB_H += ui/keysyms.h
+  LIB_H += ui/libslang.h
 endif
 
 ifndef NO_GTK2
-   LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/util.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
-   LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
+  LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
+  LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
+  LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
+  LIB_OBJS += $(OUTPUT)ui/gtk/util.o
+  LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
+  LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
+  LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
 endif
 
 ifndef NO_LIBPERL
-   LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
-   LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
+  LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
+  LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
 endif
 
 ifndef NO_LIBPYTHON
-   LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
-   LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
+  LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
+  LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
 endif
 
 ifeq ($(NO_PERF_REGS),0)
-   ifeq ($(ARCH),x86)
-   LIB_H += arch/x86/include/perf_regs.h
-   endif
+  ifeq ($(ARCH),x86)
+LIB_H += arch/x86/include/perf_regs.h
+  endif
 endif
 
 ifndef NO_LIBNUMA
-   BUILTIN_OBJS += $(OUTPUT)bench/numa.o
+  BUILTIN_OBJS += $(OUTPUT)bench/numa.o
 endif
 
 ifdef ASCIIDOC8
-   export ASCIIDOC8
+  export ASCIIDOC8
 endif
 
 LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive 
-Wl,--start-group $(EXTLIBS) -Wl,--end-group
diff --git 

[PATCH 19/26] perf tools: Merge all *CFLAGS* make variable into CFLAGS

2013-04-24 Thread Jiri Olsa
Merging all *CFLAGS* make variable into CFLAGS to eliminate
all special *_CFLAGS_* variables and make the setup clear.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile|  62 +--
 tools/perf/config/Makefile | 104 -
 tools/perf/util/setup.py   |   5 ++-
 3 files changed, 88 insertions(+), 83 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index cd19007..dea030d 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -150,7 +150,7 @@ PYTHON_EXT_SRCS := $(shell grep -v ^\# 
util/python-ext-sources)
 PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT)
 
 $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
-   $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
+   $(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
  --quiet build_ext; \
mkdir -p $(OUTPUT)python && \
cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
@@ -515,8 +515,6 @@ endif
 
 LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive 
-Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
-ALL_CFLAGS += $(BASIC_CFLAGS)
-ALL_CFLAGS += $(ARCH_CFLAGS)
 ALL_LDFLAGS += $(BASIC_LDFLAGS)
 
 export INSTALL SHELL_PATH
@@ -538,20 +536,20 @@ strip: $(PROGRAMS) $(OUTPUT)perf
 $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \
'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-   $(ALL_CFLAGS) -c $(filter %.c,$^) -o $@
+   $(CFLAGS) -c $(filter %.c,$^) -o $@
 
 $(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
-   $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \
+   $(QUIET_LINK)$(CC) $(CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \
$(BUILTIN_OBJS) $(LIBS) -o $@
 
 $(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h 
$(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
+   $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
'-DPERF_MAN_PATH="$(mandir_SQ)"' \
'-DPERF_INFO_PATH="$(infodir_SQ)"' $<
 
 $(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h 
$(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
+   $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
'-DPERF_MAN_PATH="$(mandir_SQ)"' \
'-DPERF_INFO_PATH="$(infodir_SQ)"' $<
@@ -576,77 +574,77 @@ $(OUTPUT)perf.o perf.spec \
 # over the general rule for .o
 
 $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -w $<
+   $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -w $<
 
 $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -DYYENABLE_NLS=0 
-DYYLTYPE_IS_TRIVIAL=0 -w $<
+   $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -DYYENABLE_NLS=0 
-DYYLTYPE_IS_TRIVIAL=0 -w $<
 
 $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
+   $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
 $(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -E $(ALL_CFLAGS) $<
+   $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
 $(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $<
+   $(QUIET_CC)$(CC) -o $@ -S $(CFLAGS) $<
 $(OUTPUT)%.o: %.S
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
+   $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
 $(OUTPUT)%.s: %.S
-   $(QUIET_CC)$(CC) -o $@ -E $(ALL_CFLAGS) $<
+   $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
 
 $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
+   $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
'-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
'-DPREFIX="$(prefix_SQ)"' \
$<
 
 $(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
+   $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
'-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
$<
 
 $(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
+   $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-DPYTHONPATH='"$(OUTPUT)python"' \
-DPYTHON='"$(PYTHON_WORD)"' \
$<
 
 $(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
+   $(QUIET_CC)$(CC) -o 

[PATCH 12/26] perf tools: Move libperl check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving libperl check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 20 +++-
 tools/perf/config/Makefile | 21 +
 2 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7bf5c10..d0ab4d4 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -532,23 +532,9 @@ ifndef NO_GTK2
LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
 endif
 
-ifdef NO_LIBPERL
-   BASIC_CFLAGS += -DNO_LIBPERL
-else
-   PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 
2>/dev/null)
-   PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
-   PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
-   PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
-   FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
-
-   ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y)
-   BASIC_CFLAGS += -DNO_LIBPERL
-   else
-   ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
-   EXTLIBS += $(PERL_EMBED_LIBADD)
-   LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
-   LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
-   endif
+ifndef NO_LIBPERL
+   LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
+   LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
 endif
 
 disable-python = $(eval $(disable-python_code))
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 6fc2089..2c9e0a5 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -240,3 +240,24 @@ ifndef NO_GTK2
EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
endif
 endif
+
+grep-libs  = $(filter -l%,$(1))
+strip-libs = $(filter-out -l%,$(1))
+
+ifdef NO_LIBPERL
+   BASIC_CFLAGS += -DNO_LIBPERL
+else
+   PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 
2>/dev/null)
+   PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
+   PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
+   PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
+   FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
+
+   ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y)
+   BASIC_CFLAGS += -DNO_LIBPERL
+   NO_LIBPERL := 1
+   else
+   ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
+   EXTLIBS += $(PERL_EMBED_LIBADD)
+   endif
+endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 20/26] perf tools: Merge all *LDFLAGS* make variable into LDFLAGS

2013-04-24 Thread Jiri Olsa
Merging all *LDFLAGS* make variable into LDFLAGS to eliminate
all special *LDFLAGS* variables and make the setup clear.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile|  6 ++
 tools/perf/config/Makefile | 41 +++--
 2 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index dea030d..4aad9e5 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -515,8 +515,6 @@ endif
 
 LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive 
-Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
-ALL_LDFLAGS += $(BASIC_LDFLAGS)
-
 export INSTALL SHELL_PATH
 
 ### Build rules
@@ -539,7 +537,7 @@ $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h 
$(OUTPUT)PERF-CFLAGS
$(CFLAGS) -c $(filter %.c,$^) -o $@
 
 $(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
-   $(QUIET_LINK)$(CC) $(CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \
+   $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \
$(BUILTIN_OBJS) $(LIBS) -o $@
 
 $(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h 
$(OUTPUT)PERF-CFLAGS
@@ -644,7 +642,7 @@ $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: 
scripts/python/Perf-Trace-Uti
$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) 
-Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter 
-Wno-nested-externs $<
 
 $(OUTPUT)perf-%: %.o $(PERFLIBS)
-   $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) 
$(LIBS)
+   $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
 
 $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index a53d2b3..c6e4902 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -71,7 +71,6 @@ CFLAGS += \
-std=gnu99
 
 EXTLIBS = -lpthread -lrt -lelf -lm
-ALL_LDFLAGS = $(LDFLAGS)
 
 ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror 
-fstack-protector-all,-fstack-protector-all),y)
CFLAGS += -fstack-protector-all
@@ -107,8 +106,6 @@ CFLAGS += \
-I../lib/ \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 
-BASIC_LDFLAGS =
-
 ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
BIONIC := 1
EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
@@ -120,9 +117,9 @@ ifdef NO_LIBELF
NO_DEMANGLE := 1
NO_LIBUNWIND := 1
 else
-FLAGS_LIBELF=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
+FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
 ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
-   FLAGS_GLIBC=$(CFLAGS) $(ALL_LDFLAGS)
+   FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS)
ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
LIBC_SUPPORT := 1
endif
@@ -146,7 +143,7 @@ else
LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
endif
 
-   FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) 
$(ALL_LDFLAGS) $(EXTLIBS)
+   FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) 
$(LDFLAGS) $(EXTLIBS)
ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
msg := $(warning No libdw.h found or old libdw.h found or 
elfutils is older than 0.138, disables dwarf support. Please install new 
elfutils-devel/libdw-dev);
NO_DWARF := 1
@@ -156,7 +153,7 @@ endif # NO_LIBELF
 
 ifndef NO_LIBELF
 CFLAGS += -DLIBELF_SUPPORT
-FLAGS_LIBELF=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
+FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
 ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
CFLAGS += -DLIBELF_MMAP
 endif
@@ -170,13 +167,21 @@ ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
NO_DWARF := 1
 else
CFLAGS += -DDWARF_SUPPORT $(LIBDW_CFLAGS)
-   BASIC_LDFLAGS := $(LIBDW_LDFLAGS) $(BASIC_LDFLAGS)
+   LDFLAGS += $(LIBDW_LDFLAGS)
EXTLIBS += -lelf -ldw
 endif # PERF_HAVE_DWARF_REGS
 endif # NO_DWARF
 
 endif # NO_LIBELF
 
+ifndef NO_LIBELF
+CFLAGS += -DLIBELF_SUPPORT
+FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
+ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
+   CFLAGS += -DLIBELF_MMAP
+endif # try-cc
+endif # NO_LIBELF
+
 # There's only x86 (both 32 and 64) support for CFI unwind so far
 ifneq ($(ARCH),x86)
NO_LIBUNWIND := 1
@@ -190,7 +195,7 @@ ifdef LIBUNWIND_DIR
LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
 endif
 
-FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) 
$(EXTLIBS) $(LIBUNWIND_LIBS)
+FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) 
$(EXTLIBS) $(LIBUNWIND_LIBS)
 ifneq ($(call 

Re: [RFC PATCH 1/2] regulator: core: Add regulator_set_voltage_min()

2013-04-24 Thread Mark Brown
On Tue, Apr 23, 2013 at 09:45:09PM +0300, Taras Kondratiuk wrote:

To repeat, you should leave blank lines between paragraphs and delete
irrelevant context to improve the legibility of your mails and help
people find whatever content you're adding.

> On 04/23/2013 04:45 PM, Mark Brown wrote:

> >>They don't know anything about chip limits.

> >Clearly at least the lower bound is known to the drivers...

> Do you mean a voltage of the lowest operation point?

Yes.

> I think I'm missing something.
> How can I pass chip limits to a driver in some generic way?

That doesn't seem like a hard problem - just add a new property or two
if there's no facility there.


signature.asc
Description: Digital signature


[PATCH 10/26] perf tools: Move slang check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving slang check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 39 +--
 tools/perf/config/Makefile | 17 +
 2 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index b738e01..2187a2c 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -101,10 +101,6 @@ ifeq ($(config),1)
 include config/Makefile
 endif
 
-ifdef NO_NEWT
-   NO_SLANG=1
-endif
-
 # Among the variables below, these:
 #   perfexecdir
 #   template_dir
@@ -511,28 +507,19 @@ ifndef NO_LIBAUDIT
 endif
 
 ifndef NO_SLANG
-   FLAGS_SLANG=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) 
-I/usr/include/slang -lslang
-   ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y)
-   msg := $(warning slang not found, disables TUI support. Please 
install slang-devel or libslang-dev);
-   else
-   # Fedora has /usr/include/slang/slang.h, but ubuntu 
/usr/include/slang.h
-   BASIC_CFLAGS += -I/usr/include/slang
-   BASIC_CFLAGS += -DSLANG_SUPPORT
-   EXTLIBS += -lslang
-   LIB_OBJS += $(OUTPUT)ui/browser.o
-   LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
-   LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
-   LIB_OBJS += $(OUTPUT)ui/browsers/map.o
-   LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
-   LIB_OBJS += $(OUTPUT)ui/tui/setup.o
-   LIB_OBJS += $(OUTPUT)ui/tui/util.o
-   LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
-   LIB_OBJS += $(OUTPUT)ui/tui/progress.o
-   LIB_H += ui/browser.h
-   LIB_H += ui/browsers/map.h
-   LIB_H += ui/keysyms.h
-   LIB_H += ui/libslang.h
-   endif
+   LIB_OBJS += $(OUTPUT)ui/browser.o
+   LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
+   LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
+   LIB_OBJS += $(OUTPUT)ui/browsers/map.o
+   LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
+   LIB_OBJS += $(OUTPUT)ui/tui/setup.o
+   LIB_OBJS += $(OUTPUT)ui/tui/util.o
+   LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
+   LIB_OBJS += $(OUTPUT)ui/tui/progress.o
+   LIB_H += ui/browser.h
+   LIB_H += ui/browsers/map.h
+   LIB_H += ui/keysyms.h
+   LIB_H += ui/libslang.h
 endif
 
 ifndef NO_GTK2
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 52d6fe9..008b212 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -208,3 +208,20 @@ ifndef NO_LIBAUDIT
EXTLIBS += -laudit
endif
 endif
+
+ifdef NO_NEWT
+   NO_SLANG=1
+endif
+
+ifndef NO_SLANG
+   FLAGS_SLANG=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) 
-I/usr/include/slang -lslang
+   ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y)
+   msg := $(warning slang not found, disables TUI support. Please 
install slang-devel or libslang-dev);
+   NO_SLANG := 1
+   else
+   # Fedora has /usr/include/slang/slang.h, but ubuntu 
/usr/include/slang.h
+   BASIC_CFLAGS += -I/usr/include/slang
+   BASIC_CFLAGS += -DSLANG_SUPPORT
+   EXTLIBS += -lslang
+   endif
+endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/26] perf tools: Move libdw check config into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving libdw check config into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile|  7 ---
 tools/perf/config/Makefile | 15 +++
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index c309a5b..fd45172 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -517,15 +517,8 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
 
 else # NO_LIBELF
 ifndef NO_DWARF
-ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
-   msg := $(warning DWARF register mappings have not been defined for 
architecture $(ARCH), DWARF support disabled);
-else
-   BASIC_CFLAGS := -DDWARF_SUPPORT $(LIBDW_CFLAGS) $(BASIC_CFLAGS)
-   BASIC_LDFLAGS := $(LIBDW_LDFLAGS) $(BASIC_LDFLAGS)
-   EXTLIBS += -lelf -ldw
LIB_OBJS += $(OUTPUT)util/probe-finder.o
LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
-endif # PERF_HAVE_DWARF_REGS
 endif # NO_DWARF
 endif # NO_LIBELF
 
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index ef09d6c..3620877 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -154,4 +154,19 @@ FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
 ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
BASIC_CFLAGS += -DLIBELF_MMAP
 endif
+
+# include ARCH specific config
+-include arch/$(ARCH)/Makefile
+
+ifndef NO_DWARF
+ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
+   msg := $(warning DWARF register mappings have not been defined for 
architecture $(ARCH), DWARF support disabled);
+   NO_DWARF := 1
+else
+   BASIC_CFLAGS := -DDWARF_SUPPORT $(LIBDW_CFLAGS) $(BASIC_CFLAGS)
+   BASIC_LDFLAGS := $(LIBDW_LDFLAGS) $(BASIC_LDFLAGS)
+   EXTLIBS += -lelf -ldw
+endif # PERF_HAVE_DWARF_REGS
+endif # NO_DWARF
+
 endif # NO_LIBELF
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 00/26] perf tools: Makefile changes

2013-04-24 Thread Jiri Olsa
hi,
this patchset mostly consists of moving the config 'CHK'
stuff into config/Makefile which will be also used for
kbuild afterwards.

I'm sending now just the Makefile changes separated from
the kbuild stuff, which will come later.

The original RFC is here:
http://marc.info/?l=linux-kernel=136484403415600=2

The patchset is tested via automated make test by running:
  $ make -f tests/make 

v2 changes:
  - adding make clean all support (and test)
  - de-CAPSizing the test/make test
  - several line breaking changes, ommiting usage of '\'
  - '?=' operator removal for STRIP
  - tabs to spaces conversion for Makefile non-commands lines

Changes could be reached in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/core_make

thanks for comments,
jirka

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
Jiri Olsa (26):
  perf tools: Add automated make test suite
  perf tools: Fix tab vs spaces issue in Makefile ifdef/endif
  perf tools: Move arch check into config/Makefile
  perf tools: Move programs check into config/Makefile
  perf tools: Move compiler and linker flags check into config/Makefile
  perf tools: Move libelf check config into config/Makefile
  perf tools: Move libdw check config into config/Makefile
  perf tools: Move libunwind check config into config/Makefile
  perf tools: Move libaudit check config into config/Makefile
  perf tools: Move slang check config into config/Makefile
  perf tools: Move gtk2 check config into config/Makefile
  perf tools: Move libperl check config into config/Makefile
  perf tools: Move libpython check config into config/Makefile
  perf tools: Move libbfd check config into config/Makefile
  perf tools: Move stdlib check config into config/Makefile
  perf tools: Move libnuma check config into config/Makefile
  perf tools: Move paths config into config/Makefile
  perf tools: Final touches for CHK config move
  perf tools: Merge all *CFLAGS* make variable into CFLAGS
  perf tools: Merge all *LDFLAGS* make variable into LDFLAGS
  perf tools: Switch to full patch C include directories
  perf tools: Add NO_BIONIC variable to confiure bionic setup
  perf tools: Replace tabs with spaces for all non-commands statements
  perf tools: Replace multiple line assignment with multiple statements
  perf tools: Remove '?=' Makefile STRIP assignment
  perf tools: Add missing liblk.a dependency for python/perf.so

 tools/perf/Makefile| 630 
++---
 tools/perf/config/Makefile | 477 
++
 tools/perf/tests/make  | 141 ++
 tools/perf/util/setup.py   |   5 +-
 4 files changed, 732 insertions(+), 521 deletions(-)
 create mode 100644 tools/perf/config/Makefile
 create mode 100644 tools/perf/tests/make
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 03/26] perf tools: Move arch check into config/Makefile

2013-04-24 Thread Jiri Olsa
Moving arch check into config/Makefile.

Signed-off-by: Jiri Olsa 
Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Paul Mackerras 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Borislav Petkov 
Cc: Stephane Eranian 
Cc: Sam Ravnborg 
Cc: David Ahern 
---
 tools/perf/Makefile| 43 +++
 tools/perf/config/Makefile | 34 ++
 2 files changed, 49 insertions(+), 28 deletions(-)
 create mode 100644 tools/perf/config/Makefile

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index c8fb0fd..518d540 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -55,37 +55,25 @@ include config/utilities.mak
 $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
 
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
- -e s/arm.*/arm/ -e s/sa110/arm/ \
- -e s/s390x/s390/ -e s/parisc64/parisc/ \
- -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
- -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
-NO_PERF_REGS := 1
-
 CC = $(CROSS_COMPILE)gcc
 AR = $(CROSS_COMPILE)ar
 
-# Additional ARCH settings for x86
-ifeq ($(ARCH),i386)
-   override ARCH := x86
-   NO_PERF_REGS := 0
-   LIBUNWIND_LIBS = -lunwind -lunwind-x86
+# include config/Makefile by default and rule out
+# non-config cases
+config := 1
+
+# standalone clean
+ifeq ($(MAKECMDGOALS),clean)
+  config := 0
 endif
-ifeq ($(ARCH),x86_64)
-   override ARCH := x86
-   IS_X86_64 := 0
-   ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
-   IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail 
-n 1)
-   endif
-   ifeq (${IS_X86_64}, 1)
-   RAW_ARCH := x86_64
-   ARCH_CFLAGS := -DARCH_X86_64
-   ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S 
../../arch/x86/lib/memset_64.S
-   endif
-   NO_PERF_REGS := 0
-   LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
+
+# tags cscope
+ifneq ($(filter tags cscope,$(MAKECMDGOALS)),)
+  config := 0
+endif
+
+ifeq ($(config),1)
+include config/Makefile
 endif
 
 # Treat warnings as errors unless directed not to
@@ -857,7 +845,6 @@ ifeq ($(NO_PERF_REGS),0)
ifeq ($(ARCH),x86)
LIB_H += arch/x86/include/perf_regs.h
endif
-   BASIC_CFLAGS += -DHAVE_PERF_REGS
 endif
 
 ifndef NO_STRLCPY
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
new file mode 100644
index 000..fe317c2
--- /dev/null
+++ b/tools/perf/config/Makefile
@@ -0,0 +1,34 @@
+uname_M := $(shell uname -m 2>/dev/null || echo not)
+
+ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+ -e s/arm.*/arm/ -e s/sa110/arm/ \
+ -e s/s390x/s390/ -e s/parisc64/parisc/ \
+ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
+ -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
+NO_PERF_REGS := 1
+
+# Additional ARCH settings for x86
+ifeq ($(ARCH),i386)
+   override ARCH := x86
+   NO_PERF_REGS := 0
+   LIBUNWIND_LIBS = -lunwind -lunwind-x86
+endif
+
+ifeq ($(ARCH),x86_64)
+   override ARCH := x86
+   IS_X86_64 := 0
+   ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
+   IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail 
-n 1)
+   endif
+   ifeq (${IS_X86_64}, 1)
+   RAW_ARCH := x86_64
+   ARCH_CFLAGS := -DARCH_X86_64
+   ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S 
../../arch/x86/lib/memset_64.S
+   endif
+   NO_PERF_REGS := 0
+   LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
+endif
+
+ifeq ($(NO_PERF_REGS),0)
+BASIC_CFLAGS += -DHAVE_PERF_REGS
+endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] spi: s3c64xx: added support for polling mode

2013-04-24 Thread Girish KS
On Tue, Apr 23, 2013 at 8:45 PM, Mark Brown  wrote:
> On Mon, Apr 22, 2013 at 12:39:23PM +0530, Girish K S wrote:
>> From: Girish K S 
>>
>> The 64xx spi driver supports partial polling mode.
>> Only the last chunk of the transfer length is transferred
>> or recieved in polling mode.
>
> This appears to have a very noticable negative impact on SPI performance
> on my S3C6410 based system.  Not delved into it to test why but are you
> sure it's not mistakenly selecting polling?

If forced to polling you should see this message "Unable to get SPI rx
dma resource. Switching to poll mode". same if Tx dma resource is not
available from platform data.
Anyways let me cross check again on my tested systems.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] f2fs: add REQ_META about metadata requests for submit bio

2013-04-24 Thread Jaegeuk Kim
2013-04-24 (수), 15:08 +0900, Namjae Jeon:
> >>>
> >>> + if (type == META)
> >>
> >> Should be if (btype == META).
> >> Thanks,
> > Yes, Right :)
> > Thanks for fixing.
> Hi. Jaegeuk.
> Should I resend the fixed patch as above your comment ?

I can handle it. :)
Thanks,

> 
> Thanks.
> >>
> >>> + rw |= REQ_META;
> >>> +
> >>>   if (sbi->bio[btype]) {
> >>>   struct bio_private *p = sbi->bio[btype]->bi_private;
> >>>   trace_f2fs_do_submit_bio(sbi->sb, btype, sync,
> >>
> >> --
> >> Jaegeuk Kim
> >> Samsung
> >>
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Jaegeuk Kim
Samsung


signature.asc
Description: This is a digitally signed message part


[tip:sched/core] sched: Move up affinity check to mitigate useless redoing overhead

2013-04-24 Thread tip-bot for Joonsoo Kim
Commit-ID:  d31980846f9688db3ee3e5863525c6ff8ace4c7c
Gitweb: http://git.kernel.org/tip/d31980846f9688db3ee3e5863525c6ff8ace4c7c
Author: Joonsoo Kim 
AuthorDate: Tue, 23 Apr 2013 17:27:40 +0900
Committer:  Ingo Molnar 
CommitDate: Wed, 24 Apr 2013 08:52:44 +0200

sched: Move up affinity check to mitigate useless redoing overhead

Currently, LBF_ALL_PINNED is cleared after affinity check is
passed. So, if task migration is skipped by small load value or
small imbalance value in move_tasks(), we don't clear
LBF_ALL_PINNED. At last, we trigger 'redo' in load_balance().

Imbalance value is often so small that any tasks cannot be moved
to other cpus and, of course, this situation may be continued
after we change the target cpu. So this patch move up affinity
check code and clear LBF_ALL_PINNED before evaluating load value
in order to mitigate useless redoing overhead.

In addition, re-order some comments correctly.

Signed-off-by: Joonsoo Kim 
Acked-by: Peter Zijlstra 
Tested-by: Jason Low 
Cc: Srivatsa Vaddagiri 
Cc: Davidlohr Bueso 
Cc: Peter Zijlstra 
Link: 
http://lkml.kernel.org/r/1366705662-3587-5-git-send-email-iamjoonsoo@lge.com
Signed-off-by: Ingo Molnar 
---
 kernel/sched/fair.c | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index dfa92b7..b8ef321 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3896,10 +3896,14 @@ int can_migrate_task(struct task_struct *p, struct 
lb_env *env)
int tsk_cache_hot = 0;
/*
 * We do not migrate tasks that are:
-* 1) running (obviously), or
+* 1) throttled_lb_pair, or
 * 2) cannot be migrated to this CPU due to cpus_allowed, or
-* 3) are cache-hot on their current CPU.
+* 3) running (obviously), or
+* 4) are cache-hot on their current CPU.
 */
+   if (throttled_lb_pair(task_group(p), env->src_cpu, env->dst_cpu))
+   return 0;
+
if (!cpumask_test_cpu(env->dst_cpu, tsk_cpus_allowed(p))) {
int new_dst_cpu;
 
@@ -3967,9 +3971,6 @@ static int move_one_task(struct lb_env *env)
struct task_struct *p, *n;
 
list_for_each_entry_safe(p, n, >src_rq->cfs_tasks, se.group_node) {
-   if (throttled_lb_pair(task_group(p), env->src_rq->cpu, 
env->dst_cpu))
-   continue;
-
if (!can_migrate_task(p, env))
continue;
 
@@ -4021,7 +4022,7 @@ static int move_tasks(struct lb_env *env)
break;
}
 
-   if (throttled_lb_pair(task_group(p), env->src_cpu, 
env->dst_cpu))
+   if (!can_migrate_task(p, env))
goto next;
 
load = task_h_load(p);
@@ -4032,9 +4033,6 @@ static int move_tasks(struct lb_env *env)
if ((load / 2) > env->imbalance)
goto next;
 
-   if (!can_migrate_task(p, env))
-   goto next;
-
move_task(p, env);
pulled++;
env->imbalance -= load;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:sched/core] sched: Don' t consider other cpus in our group in case of NEWLY_IDLE

2013-04-24 Thread tip-bot for Joonsoo Kim
Commit-ID:  cfc03118047172f5bdc58d63c607d16d33ce5305
Gitweb: http://git.kernel.org/tip/cfc03118047172f5bdc58d63c607d16d33ce5305
Author: Joonsoo Kim 
AuthorDate: Tue, 23 Apr 2013 17:27:39 +0900
Committer:  Ingo Molnar 
CommitDate: Wed, 24 Apr 2013 08:52:44 +0200

sched: Don't consider other cpus in our group in case of NEWLY_IDLE

Commit 88b8dac0 makes load_balance() consider other cpus in its
group, regardless of idle type. When we do NEWLY_IDLE balancing,
we should not consider it, because a motivation of NEWLY_IDLE
balancing is to turn this cpu to non idle state if needed. This
is not the case of other cpus. So, change code not to consider
other cpus for NEWLY_IDLE balancing.

With this patch, assign 'if (pulled_task) this_rq->idle_stamp =
0' in idle_balance() is corrected, because NEWLY_IDLE balancing
doesn't consider other cpus. Assigning to 'this_rq->idle_stamp'
is now valid.

Signed-off-by: Joonsoo Kim 
Tested-by: Jason Low 
Acked-by: Peter Zijlstra 
Cc: Srivatsa Vaddagiri 
Cc: Davidlohr Bueso 
Cc: Peter Zijlstra 
Link: 
http://lkml.kernel.org/r/1366705662-3587-4-git-send-email-iamjoonsoo@lge.com
Signed-off-by: Ingo Molnar 
---
 kernel/sched/fair.c | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 726e129..dfa92b7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5026,8 +5026,21 @@ static int load_balance(int this_cpu, struct rq *this_rq,
.cpus   = cpus,
};
 
+   /*
+* For NEWLY_IDLE load_balancing, we don't need to consider
+* other cpus in our group
+*/
+   if (idle == CPU_NEWLY_IDLE) {
+   env.dst_grpmask = NULL;
+   /*
+* we don't care max_lb_iterations in this case,
+* in following patch, this will be removed
+*/
+   max_lb_iterations = 0;
+   } else
+   max_lb_iterations = cpumask_weight(env.dst_grpmask);
+
cpumask_copy(cpus, cpu_active_mask);
-   max_lb_iterations = cpumask_weight(env.dst_grpmask);
 
schedstat_inc(sd, lb_count[idle]);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:sched/core] sched: Explicitly cpu_idle_type checking in rebalance_domains()

2013-04-24 Thread tip-bot for Joonsoo Kim
Commit-ID:  de5eb2dd7f171ee8a45d23cd41aa2efe9ab922b3
Gitweb: http://git.kernel.org/tip/de5eb2dd7f171ee8a45d23cd41aa2efe9ab922b3
Author: Joonsoo Kim 
AuthorDate: Tue, 23 Apr 2013 17:27:38 +0900
Committer:  Ingo Molnar 
CommitDate: Wed, 24 Apr 2013 08:52:43 +0200

sched: Explicitly cpu_idle_type checking in rebalance_domains()

After commit 88b8dac0, dst-cpu can be changed in load_balance(),
then we can't know cpu_idle_type of dst-cpu when load_balance()
return positive. So, add explicit cpu_idle_type checking.

Signed-off-by: Joonsoo Kim 
Tested-by: Jason Low 
Acked-by: Peter Zijlstra 
Cc: Srivatsa Vaddagiri 
Cc: Davidlohr Bueso 
Cc: Peter Zijlstra 
Link: 
http://lkml.kernel.org/r/1366705662-3587-3-git-send-email-iamjoonsoo@lge.com
Signed-off-by: Ingo Molnar 
---
 kernel/sched/fair.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 25aaf93..726e129 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5523,10 +5523,11 @@ static void rebalance_domains(int cpu, enum 
cpu_idle_type idle)
if (time_after_eq(jiffies, sd->last_balance + interval)) {
if (load_balance(cpu, rq, sd, idle, )) {
/*
-* We've pulled tasks over so either we're no
-* longer idle.
+* The LBF_SOME_PINNED logic could have changed
+* env->dst_cpu, so we can't know our idle
+* state even if we migrated tasks. Update it.
 */
-   idle = CPU_NOT_IDLE;
+   idle = idle_cpu(cpu) ? CPU_IDLE : CPU_NOT_IDLE;
}
sd->last_balance = jiffies;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:sched/core] sched: Change position of resched_cpu() in load_balance()

2013-04-24 Thread tip-bot for Joonsoo Kim
Commit-ID:  f1cd0858100c67273f2c74344e0c464344c4a982
Gitweb: http://git.kernel.org/tip/f1cd0858100c67273f2c74344e0c464344c4a982
Author: Joonsoo Kim 
AuthorDate: Tue, 23 Apr 2013 17:27:37 +0900
Committer:  Ingo Molnar 
CommitDate: Wed, 24 Apr 2013 08:52:43 +0200

sched: Change position of resched_cpu() in load_balance()

cur_ld_moved is reset if env.flags hit LBF_NEED_BREAK.
So, there is possibility that we miss doing resched_cpu().
Correct it as changing position of resched_cpu()
before checking LBF_NEED_BREAK.

Signed-off-by: Joonsoo Kim 
Tested-by: Jason Low 
Acked-by: Peter Zijlstra 
Cc: Srivatsa Vaddagiri 
Cc: Davidlohr Bueso 
Cc: Peter Zijlstra 
Link: 
http://lkml.kernel.org/r/1366705662-3587-2-git-send-email-iamjoonsoo@lge.com
Signed-off-by: Ingo Molnar 
---
 kernel/sched/fair.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 1c97735..25aaf93 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5080,17 +5080,17 @@ more_balance:
double_rq_unlock(env.dst_rq, busiest);
local_irq_restore(flags);
 
-   if (env.flags & LBF_NEED_BREAK) {
-   env.flags &= ~LBF_NEED_BREAK;
-   goto more_balance;
-   }
-
/*
 * some other cpu did the load balance for us.
 */
if (cur_ld_moved && env.dst_cpu != smp_processor_id())
resched_cpu(env.dst_cpu);
 
+   if (env.flags & LBF_NEED_BREAK) {
+   env.flags &= ~LBF_NEED_BREAK;
+   goto more_balance;
+   }
+
/*
 * Revisit (affine) tasks on src_cpu that couldn't be moved to
 * us and move them to an alternate dst_cpu in our sched_group
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net] tuntap: correct the return value in tun_set_iff()

2013-04-24 Thread Michael S. Tsirkin
On Tue, Apr 23, 2013 at 02:40:39PM +0800, Jason Wang wrote:
> commit (3be8fbab tuntap: fix error return code in tun_set_iff()) breaks the
> creation of multiqueue tuntap since it forbids to create more than one queues
> for a multiqueue tuntap device. We need return 0 instead -EBUSY here since we
> don't want to re-initialize the device when one or more queues has been 
> already
> attached. Add a comment and correct the return value to zero.
> 
> Reported-by: Jerry Chu 
> Cc: Jerry Chu 
> Cc: Wei Yongjun 
> Cc: Eric Dumazet 
> Signed-off-by: Jason Wang 

Acked-by: Michael S. Tsirkin 

> ---
>  drivers/net/tun.c |5 -
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 729ed53..3a8977e 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -1594,7 +1594,10 @@ static int tun_set_iff(struct net *net, struct file 
> *file, struct ifreq *ifr)
>  
>   if (tun->flags & TUN_TAP_MQ &&
>   (tun->numqueues + tun->numdisabled > 1))
> - return -EBUSY;
> + /* One or more queue has already been attached, no need
> +  * to initialize the device again.
> +  */
> + return 0;
>   }
>   else {
>   char *name;
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/8] irq-imgpdc: add ImgTec PDC irqchip driver

2013-04-24 Thread Thomas Gleixner
On Wed, 24 Apr 2013, James Hogan wrote:
> Thanks for the review Thomas!
> 
> On 23/04/13 16:09, Thomas Gleixner wrote:
> > On Tue, 23 Apr 2013, James Hogan wrote:
 >> +   spinlock_t  lock;
> > 
> >   raw_spinlock_t please
> 
> Okay.
> 
> If I understand right, this would be because on RT, spinlock_t becomes a
> mutex and won't work correctly with irqs actually disabled for the irq
> callbacks below, is that right?

Yep.
 
> I'll look into this. kernel/irq/generic-chip.c was added after this
> driver was written.

Fair enough.
 
> >> +static void pdc_intc_perip_isr(unsigned int irq, struct irq_desc *desc)
> >> +{
> >> +  struct pdc_intc_priv *priv;
> >> +  unsigned int i, irq_no;
> >> +
> >> +  priv = (struct pdc_intc_priv *)irq_desc_get_handler_data(desc);
> >> +
> >> +  /* find the peripheral number */
> >> +  for (i = 0; i < priv->nr_perips; ++i)
> >> +  if (irq == priv->perip_irqs[i])
> >> +  goto found;
> > 
> > Whee. Aren't these numbers linear ?
> 
> Not necessarily as they're virtual irq numbers obtained via
> platform_get_irq(), which come individually from device tree. Even their
> hardware irq numbers aren't linear as they're not wired to their irqchip
> in the same order:
> > pdc: pdc@0x02006000 {
> > interrupt-controller;
> > #interrupt-cells = <3>;
> > 
> > reg = <0x02006000 0x1000>;
> > compatible = "img,pdc-intc";
> > 
> > num-perips = <3>;
> > num-syswakes = <3>;
> > 
> > interrupts = <18 4 /* level */>, /* Syswakes */
> >  <30 4 /* level */>, /* Perip 0 (RTC) */
> >  <29 4 /* level */>, /* Perip 1 (IR) */
> >  <31 4 /* level */>; /* Perip 2 (WDT) */
> > };

Interesting. 

> >> +static int pdc_intc_remove(struct platform_device *pdev)
> >> +{
> >> +  struct pdc_intc_priv *priv = platform_get_drvdata(pdev);
> >> +
> >> +  irq_domain_remove(priv->domain);
> > 
> > And the rest of the resources is still there?
> 
> I was under the impression devm_kzalloc and devm_ioremap took care of
> that in both the probe error case and the remove case:
 
> >  * devm_kzalloc - Resource-managed kzalloc
> >  * Managed kzalloc.  Memory allocated with this function is
> >  * automatically freed on driver detach. 
> > 
> >  * devm_ioremap - Managed ioremap()
> >  * Managed ioremap().  Map is automatically unmapped on driver detach.
> 
> I may have misunderstood the whole point of their existence though?

No, that was just me missing the devm_ in front of
kzalloc/ioremap. So you're good.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/mm] x86/iommu/dmar: Remove warning for HPET scope type

2013-04-24 Thread tip-bot for Linn Crosetto
Commit-ID:  13f72756da86f155898e2c2022f7b3a106c3742e
Gitweb: http://git.kernel.org/tip/13f72756da86f155898e2c2022f7b3a106c3742e
Author: Linn Crosetto 
AuthorDate: Tue, 23 Apr 2013 12:26:45 -0600
Committer:  Ingo Molnar 
CommitDate: Wed, 24 Apr 2013 08:45:47 +0200

x86/iommu/dmar: Remove warning for HPET scope type

ACPI_DMAR_SCOPE_TYPE_HPET is parsed by
ir_parse_ioapic_hpet_scope() and should not be flagged as an
unsupported type.

Signed-off-by: Linn Crosetto 
Cc: j...@8bytes.org
Cc: ddut...@redhat.com
Cc: suresh.b.sid...@intel.com
Link: http://lkml.kernel.org/r/1366741605-71293-1-git-send-email-l...@hp.com
Signed-off-by: Ingo Molnar 
---
 drivers/iommu/dmar.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index e5cdaf8..b8008f6 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -129,7 +129,8 @@ int __init dmar_parse_dev_scope(void *start, void *end, int 
*cnt,
if (scope->entry_type == ACPI_DMAR_SCOPE_TYPE_ENDPOINT ||
scope->entry_type == ACPI_DMAR_SCOPE_TYPE_BRIDGE)
(*cnt)++;
-   else if (scope->entry_type != ACPI_DMAR_SCOPE_TYPE_IOAPIC) {
+   else if (scope->entry_type != ACPI_DMAR_SCOPE_TYPE_IOAPIC &&
+   scope->entry_type != ACPI_DMAR_SCOPE_TYPE_HPET) {
pr_warn("Unsupported device scope\n");
}
start += scope->length;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/platform] x86/olpc/xo1/sci: Don't call input_free_device () after input_unregister_device()

2013-04-24 Thread tip-bot for Wei Yongjun
Commit-ID:  3482e664dc7f44e0ffb1fcf1de7af74977748f31
Gitweb: http://git.kernel.org/tip/3482e664dc7f44e0ffb1fcf1de7af74977748f31
Author: Wei Yongjun 
AuthorDate: Wed, 24 Apr 2013 10:46:24 +0800
Committer:  Ingo Molnar 
CommitDate: Wed, 24 Apr 2013 08:44:47 +0200

x86/olpc/xo1/sci: Don't call input_free_device() after input_unregister_device()

input_free_device() should only be used if
input_register_device() was not called yet or if it failed. Once
device was unregistered use input_unregister_device() and memory
will be freed once last reference to the device is dropped.

Signed-off-by: Wei Yongjun 
Cc: d...@laptop.org
Cc: p...@laptop.org
Cc: gre...@linuxfoundation.org
Link: 
http://lkml.kernel.org/r/capglhd84cboeucog%2byndhvgqtftroujdkzgskh3o0b-q93e...@mail.gmail.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/platform/olpc/olpc-xo1-sci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/platform/olpc/olpc-xo1-sci.c 
b/arch/x86/platform/olpc/olpc-xo1-sci.c
index 74704be..9a2e590 100644
--- a/arch/x86/platform/olpc/olpc-xo1-sci.c
+++ b/arch/x86/platform/olpc/olpc-xo1-sci.c
@@ -460,7 +460,6 @@ static int setup_power_button(struct platform_device *pdev)
 static void free_power_button(void)
 {
input_unregister_device(power_button_idev);
-   input_free_device(power_button_idev);
 }
 
 static int setup_ebook_switch(struct platform_device *pdev)
@@ -491,7 +490,6 @@ static int setup_ebook_switch(struct platform_device *pdev)
 static void free_ebook_switch(void)
 {
input_unregister_device(ebook_switch_idev);
-   input_free_device(ebook_switch_idev);
 }
 
 static int setup_lid_switch(struct platform_device *pdev)
@@ -526,6 +524,7 @@ static int setup_lid_switch(struct platform_device *pdev)
 
 err_create_attr:
input_unregister_device(lid_switch_idev);
+   lid_switch_idev = NULL;
 err_register:
input_free_device(lid_switch_idev);
return r;
@@ -535,7 +534,6 @@ static void free_lid_switch(void)
 {
device_remove_file(_switch_idev->dev, _attr_lid_wake_mode);
input_unregister_device(lid_switch_idev);
-   input_free_device(lid_switch_idev);
 }
 
 static int xo1_sci_probe(struct platform_device *pdev)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC 00/14] perf tools: Introduce new 'ftrace' command

2013-04-24 Thread Namhyung Kim
Hi Pekka,

On Tue, 23 Apr 2013 20:19:37 +0300, Pekka Enberg wrote:
> Hello,
>
> On Tue, 2013-04-23 at 17:30 +0900, Namhyung Kim wrote:
>>> This patchset implements a front-end tool for kernel's ftrace.  It
>>> uses function_graph tracer by default and normal function tracer is
>>> also supported.  (Of course you need to enable those tracers in your
>>> kernel first.)
>
> On Tue, Apr 23, 2013 at 6:58 PM, Steven Rostedt  wrote:
>> Very nice Namhyung, thanks for doing this. I did a quick run through of
>> the patches and I have no complaints about them. I'm not sure how the
>> others will feel about it.
>
> I also skimmed through the patches and they look like a reasonable
> starting point. So FWIW,
>
> Acked-by: Pekka Enberg 

Thank you!


> Are there any plans in trying to consolidate 'perf trace' and this? As
> a user I don't really care what the underlying mechanism and would
> like things to just work out of the box.

No plans currently.  I'll try to think about it more..

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v8 3/8] spi/spi-atmel: add dmaengine support

2013-04-24 Thread Richard Genoud
2013/4/23 Mark Brown :
> On Wed, Apr 03, 2013 at 12:23:35PM +0200, Richard GENOUD wrote:
>
> Richard, delete irrelevant context from your mails - it makes it much
> easier to find the content you added.
>
>> On [mer., 03.04.2013 13:59:19], Wenyou Yang wrote:
>
>> As I did some work on that one:
>> Signed-off-by: Richard Genoud 
>>
>> BUT, there's one thing not working (at least for me !):
>> With DMA enabled, using spidev.
>> if we use the ioctl SPI_IOC_MESSAGE(x) (tested with x=3):
>
> I'd been expecting an updated series with this rolled in?

I did some more test with spidev and a MISO-MOSI loop as Wenyou suggested.

It's ok for me, on kernel 3.9-rc8 sam9g35, I didn't see any error.

Signed-off-by: Richard Genoud 
Tested-by: Richard Genoud 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC 00/14] perf tools: Introduce new 'ftrace' command

2013-04-24 Thread Namhyung Kim
Hi Steve,

On Tue, 23 Apr 2013 11:58:01 -0400, Steven Rostedt wrote:
> On Tue, 2013-04-23 at 17:30 +0900, Namhyung Kim wrote:
>> Hello,
>> 
>> This patchset implements a front-end tool for kernel's ftrace.  It
>> uses function_graph tracer by default and normal function tracer is
>> also supported.  (Of course you need to enable those tracers in your
>> kernel first.)
>> 
>> NOTE: It's in very early stage, so may contain many rough edges.
>> 
>
> Very nice Namhyung, thanks for doing this. I did a quick run through of
> the patches and I have no complaints about them. I'm not sure how the
> others will feel about it.

Thanks!

>
> Also, have you given thought on how to execute both ftrace and the pmu
> counters? That is, to get a way to interleave the data?

I didn't think about it yet.  I just thought enabling event tracing in
ftrace and get the data along with the function tracing.  I'm not sure
how they interfere each other when enabled at the same time.

If that's not a valid concern, I think it's doable.


> I added a 'perf' clock to ftrace. I didn't see that being checked,
> although I didn't look too hard. If possible, you can use that, as well
> as the multi-buffers that are coming in 3.10.

Will look at it later.

>
> I would also like to add a system call to allow you to get to the ftrace
> data without the need for debugfs. I'm not sure if we should piggy back
> on the perf system call, or add a new one. I'm thinking we should add a
> new one so that it doesn't get too confusing.

Could you elaborate on it more?  I cannot see how it'll look like..

>
> Hope others have comments,

Thanks for your kind review.
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Revert "V4L/DVB: uvc: Enable USB autosuspend by default on uvcvideo"

2013-04-24 Thread Laurent Pinchart
Hi Adam,

Thanks for the patch.

On Wednesday 24 April 2013 15:57:19 adam@canonical.com wrote:
> From: Adam Lee 
> 
> This reverts commit 3dae8b41dc5651f8eb22cf310e8b116480ba25b7.
> 
> 1, I do have a Chicony webcam, implements autosuspend in a broken way,
> make `poweroff` performs rebooting when its autosuspend enabled.
> 
> 2, There are other webcams which don't support autosuspend too, like
> https://patchwork.kernel.org/patch/2356141/
> 
> 3, kernel removed USB_QUIRK_NO_AUTOSUSPEND in
> a691efa9888e71232dfb4088fb8a8304ffc7b0f9, because autosuspend is
> disabled by default.
> 
> So, we need to disable autosuspend in uvcvideo, maintaining a quirk list
> only for uvcvideo is not a good idea.
> 
> Signed-off-by: Adam Lee 

I've received very few bug reports about broken auto-suspend support in UVC 
devices. Most of them could be solved by setting the RESET_RESUME quirk in USB 
core, only the Creative Live! Cam Optia AF required a quirk in the uvcvideo 
driver. I would thus rather use the available quirks (USB_QUIRK_RESET_RESUME 
if possible, UVC_QUIRK_DISABLE_AUTOSUSPEND otherwise) than killing power 
management for the vast majority of webcams that behave correctly.

> ---
>  drivers/media/usb/uvc/uvc_driver.c |1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c
> b/drivers/media/usb/uvc/uvc_driver.c index 5dbefa6..8556f7c 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -1914,7 +1914,6 @@ static int uvc_probe(struct usb_interface *intf,
>   }
> 
>   uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n");
> - usb_enable_autosuspend(udev);
>   return 0;
> 
>  error:

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/8] irq-imgpdc: add ImgTec PDC irqchip driver

2013-04-24 Thread James Hogan
Thanks for the review Thomas!

On 23/04/13 16:09, Thomas Gleixner wrote:
> On Tue, 23 Apr 2013, James Hogan wrote:
>> +/**
>> + * struct pdc_intc_priv - private pdc interrupt data.
>> + * @nr_perips:  Number of peripheral interrupt signals.
>> + * @nr_syswakes:Number of syswake signals.
>> + * @perip_irqs: List of peripheral IRQ numbers handled.
>> + * @syswake_irq:Shared PDC syswake IRQ number.
>> + * @domain: IRQ domain for PDC peripheral and syswake IRQs.
>> + * @pdc_base:   Base of PDC registers.
>> + * @lock:   Lock to protect the PDC syswake registers.
>> + */
>> +struct pdc_intc_priv {
>> +unsigned intnr_perips;
>> +unsigned intnr_syswakes;
>> +unsigned int*perip_irqs;
>> +unsigned intsyswake_irq;
>> +struct irq_domain   *domain;
>> +void __iomem*pdc_base;
>> +
>> +spinlock_t  lock;
> 
>   raw_spinlock_t please

Okay.

If I understand right, this would be because on RT, spinlock_t becomes a
mutex and won't work correctly with irqs actually disabled for the irq
callbacks below, is that right?

>> +static void perip_irq_mask(struct irq_data *data)
>> +{
>> +struct pdc_intc_priv *priv = irqd_to_priv(data);
>> +unsigned int irq_route;
>> +unsigned long flags;
>> +
>> +spin_lock_irqsave(>lock, flags);
> 
> This is always called with interrupts disabled.

Okay, I'll switch to raw_spin_lock

>> +irq_route = pdc_read(priv, PDC_IRQ_ROUTE);
>> +irq_route &= ~(1 << data->hwirq);
> 
> Why not cache the mask value ?

Yes, caching PDC_IRQ_ROUTE should be possible since it should only be
used by this driver (hence the driver local spinlock).

> 
>> +pdc_write(priv, PDC_IRQ_ROUTE, irq_route);
> 
>> +spin_unlock_irqrestore(>lock, flags);
>> +}
>> +
>> +static void perip_irq_unmask(struct irq_data *data)
>> +{
>> +struct pdc_intc_priv *priv = irqd_to_priv(data);
>> +unsigned int irq_route;
>> +unsigned long flags;
>> +
>> +spin_lock_irqsave(>lock, flags);
>> +irq_route = pdc_read(priv, PDC_IRQ_ROUTE);
>> +irq_route |= 1 << data->hwirq;
>> +pdc_write(priv, PDC_IRQ_ROUTE, irq_route);
> 
> This code is another slightly different copy of stuff which is
> available in kernel/irq/generic-chip.c
> 
> Can we please stop the code duplication and reuse existing
> infrastructure? Don't tell me it does not work for you.  I sent out a
> patch yesterday which makes the code suitable for irq domains.

I'll look into this. kernel/irq/generic-chip.c was added after this
driver was written.

>> +static void pdc_intc_perip_isr(unsigned int irq, struct irq_desc *desc)
>> +{
>> +struct pdc_intc_priv *priv;
>> +unsigned int i, irq_no;
>> +
>> +priv = (struct pdc_intc_priv *)irq_desc_get_handler_data(desc);
>> +
>> +/* find the peripheral number */
>> +for (i = 0; i < priv->nr_perips; ++i)
>> +if (irq == priv->perip_irqs[i])
>> +goto found;
> 
> Whee. Aren't these numbers linear ?

Not necessarily as they're virtual irq numbers obtained via
platform_get_irq(), which come individually from device tree. Even their
hardware irq numbers aren't linear as they're not wired to their irqchip
in the same order:
> pdc: pdc@0x02006000 {
>   interrupt-controller;
>   #interrupt-cells = <3>;
> 
>   reg = <0x02006000 0x1000>;
>   compatible = "img,pdc-intc";
> 
>   num-perips = <3>;
>   num-syswakes = <3>;
> 
>   interrupts = <18 4 /* level */>, /* Syswakes */
><30 4 /* level */>, /* Perip 0 (RTC) */
><29 4 /* level */>, /* Perip 1 (IR) */
><31 4 /* level */>; /* Perip 2 (WDT) */
> };

>> +static int pdc_intc_probe(struct platform_device *pdev)
>> +{
>> +struct pdc_intc_priv *priv;
>> +struct device_node *node = pdev->dev.of_node;
>> +struct resource *res_regs;
>> +unsigned int i;
>> +int irq, ret;
>> +u32 val;
>> +
>> +if (!node)
>> +return -ENOENT;
>> +
>> +/* Get registers */
>> +res_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +if (res_regs == NULL) {
>> +dev_err(>dev, "cannot find registers resource\n");
>> +return -ENOENT;
>> +}
>> +
>> +/* Allocate driver data */
>> +priv = devm_kzalloc(>dev, sizeof(*priv), GFP_KERNEL);
>> +if (!priv) {
>> +dev_err(>dev, "cannot allocate device data\n");
>> +return -ENOMEM;
>> +}
>> +spin_lock_init(>lock);
>> +platform_set_drvdata(pdev, priv);
>> +
>> +/* Ioremap the registers */
>> +priv->pdc_base = devm_ioremap(>dev, res_regs->start,
>> +  res_regs->end - res_regs->start);
>> +if (!priv->pdc_base)
>> +return -EIO;
> 
> Leaks priv.
> 
>> +/* Get number of peripherals */
>> +ret = of_property_read_u32(node, "num-perips", );
>> +if (ret) {
>> +

[PATCH v2] pinctrl: move subsystem mutex to pinctrl_dev struct

2013-04-24 Thread Linus Walleij
From: Patrice Chotard 

This mutex avoids deadlock in case of use of multiple pin
controllers. Before this modification, by using a global
mutex, deadlock appeared when, for example, a call to
pinctrl_pins_show() locked the pinctrl_mutex, called the
ops->pin_dbg_show of a particular pin controller. If this
pin controller needs I2C access to retrieve configuration
information and I2C driver is using pinctrl to drive its
pins, a call to pinctrl_select_state() try to lock again
pinctrl_mutex which leads to a deadlock.

Notice that the mutex grab from the two direction functions
was moved into pinctrl_gpio_direction().

For several cases, we can't replace pinctrl_mutex by
pctldev->mutex, because at this stage, pctldev is
not accessible :
- pinctrl_get()/pinctrl_put()
- pinctrl_register_maps()

So add respectively pinctrl_list_mutex and
pinctrl_maps_mutex in order to protect
pinctrl_list and pinctrl_maps list instead.

Reintroduce pinctrldev_list_mutex in
find_pinctrl_by_of_node(),
pinctrl_find_and_add_gpio_range()
pinctrl_request_gpio(), pinctrl_free_gpio(),
pinctrl_gpio_direction(), pinctrl_devices_show(),
pinctrl_register() and pinctrl_unregister() to
protect pinctrldev_list.

Changes v1->v2
- pinctrl_select_state_locked() is removed, all lock mechanism
  is located inside pinctrl_select_state(). When parsing
  the state->setting list, take the per-pin-controller driver
  lock. (Patrice).
- Introduce pinctrldev_list_mutex to protect pinctrldev_list
  in all functions which parse or modify pictrldev_list.
  (Patrice).
- move find_pinctrl_by_of_node() from pinctrl/devicetree.c to
  pinctrl/core.c in order to protect pinctrldev_list.
  (Patrice).
- Sink mutex:es into some functions and remove some _locked
  variants down to where the lists are actually accessed to
  make things simpler. (Linus)
- Drop *all* mutexes completely from pinctrl_lookup_state()
  and pinctrl_select_state() - no relevant mutex was taken
  and it was unclear what this was protecting against. (Linus)

Reported by : Seraphin Bonnaffe 
Signed-off-by: Patrice Chotard 
Signed-off-by: Linus Walleij 
---
 drivers/pinctrl/core.c   | 266 +++
 drivers/pinctrl/core.h   |   6 +-
 drivers/pinctrl/devicetree.c |  15 +--
 drivers/pinctrl/pinconf.c|  46 
 drivers/pinctrl/pinmux.c |   8 +-
 5 files changed, 176 insertions(+), 165 deletions(-)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 8b832ce..37cd774 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -40,11 +40,17 @@
 
 static bool pinctrl_dummy_state;
 
-/* Mutex taken by all entry points */
-DEFINE_MUTEX(pinctrl_mutex);
+/* Mutex taken to protect pinctrl_list */
+DEFINE_MUTEX(pinctrl_list_mutex);
+
+/* Mutex taken to protect pinctrl_maps */
+DEFINE_MUTEX(pinctrl_maps_mutex);
+
+/* Mutex taken to protect pinctrldev_list */
+DEFINE_MUTEX(pinctrldev_list_mutex);
 
 /* Global list of pin control devices (struct pinctrl_dev) */
-LIST_HEAD(pinctrldev_list);
+static LIST_HEAD(pinctrldev_list);
 
 /* List of pin controller handles (struct pinctrl) */
 static LIST_HEAD(pinctrl_list);
@@ -111,6 +117,23 @@ struct pinctrl_dev *get_pinctrl_dev_from_devname(const 
char *devname)
return found ? pctldev : NULL;
 }
 
+struct pinctrl_dev *get_pinctrl_dev_from_of_node(struct device_node *np)
+{
+   struct pinctrl_dev *pctldev;
+
+   mutex_lock(_list_mutex);
+
+   list_for_each_entry(pctldev, _list, node)
+   if (pctldev->dev->of_node == np) {
+   mutex_unlock(_list_mutex);
+   return pctldev;
+   }
+
+   mutex_lock(_list_mutex);
+
+   return NULL;
+}
+
 /**
  * pin_get_from_name() - look up a pin number from a name
  * @pctldev: the pin control device to lookup the pin on
@@ -170,9 +193,9 @@ bool pin_is_valid(struct pinctrl_dev *pctldev, int pin)
if (pin < 0)
return false;
 
-   mutex_lock(_mutex);
+   mutex_lock(>mutex);
pindesc = pin_desc_get(pctldev, pin);
-   mutex_unlock(_mutex);
+   mutex_unlock(>mutex);
 
return pindesc != NULL;
 }
@@ -269,15 +292,17 @@ pinctrl_match_gpio_range(struct pinctrl_dev *pctldev, 
unsigned gpio)
 {
struct pinctrl_gpio_range *range = NULL;
 
+   mutex_lock(>mutex);
/* Loop over the ranges */
list_for_each_entry(range, >gpio_ranges, node) {
/* Check if we're in the valid range */
if (gpio >= range->base &&
gpio < range->base + range->npins) {
+   mutex_unlock(>mutex);
return range;
}
}
-
+   mutex_unlock(>mutex);
return NULL;
 }
 
@@ -361,9 +386,9 @@ static int pinctrl_get_device_gpio_range(unsigned gpio,
 void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range)
 {
-   mutex_lock(_mutex);
+   

Re: eGalax touchscreen regression

2013-04-24 Thread Artem Bityutskiy
On Tue, 2013-04-23 at 08:40 -0700, Dmitry Torokhov wrote:
> > the eGalax driver now requires OF. For us this is a regression because
> > we do not have OF: https://bugs.tizen.org/jira/browse/TIVI-740
> 
> I see. In this case we need to come up with a platform data to pass
> wakeup gpio in case platform does not support OF. irq_to_gpio() is not
> supported on many platforms, causing compilation errors.
> 
> Is the platform that you are trying to use the touchscreen upstream?

OK, so this is about just a monitor with a touchscreen (Giantec high-res
capacitive 11.6” LCD monitor). The touchscreen is connected to a
commodity hardware via USB.

So yes, the platform _is_ upstream :-) Namely, we use just a SandyBridge
PC.

-- 
Best Regards,
Artem Bityutskiy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NumaTOP 1.0 launched

2013-04-24 Thread zhou jencce
2013/4/24 Jin, Yao :
> Hi Zhou,
>
>
>
> I just worry a little bit if you can apply the raw patch on the tip or other
> version of kernel code. You know, the perf code is changed frequently.
>
>
>
> Thanks
>
> Jin Yao
>
>
>

That's OK,  I'd like to try.


Thanks
XIong


> From: zhou jencce [mailto:jencce.ker...@gmail.com]
> Sent: Wednesday, April 24, 2013 4:26 PM
> To: Jin, Yao
> Cc: l...@lwn.net; linux-kernel@vger.kernel.org;
> linux-perf-us...@vger.kernel.org
>
>
> Subject: Re: NumaTOP 1.0 launched
>
>
>
>
>
>
>
> 2013/4/18 Jin, Yao 
>
> Hi,
>
> https://01.org/numatop/ is slightly faster to access.
> Or please access https://github.com/01org/numatop to get the source
> directly.
>
> Thanks
> Jin Yao
>
>
> -Original Message-
> From: Jin, Yao
> Sent: Wednesday, April 17, 2013 10:30 AM
> To: 'l...@lwn.net'; 'linux-kernel@vger.kernel.org';
> 'linux-perf-us...@vger.kernel.org'
> Subject: NumaTOP 1.0 launched
>
> We are pleased to announce today that the NumaTOP project has been added to
> 01.org.
>
> Performance analysis engineers know that NUMA can seriously impact
> performance and that NUMA performance analysis can be challenging. We've
> realized that currently there isn't an easy-to-use tool that lets us easily
> observe whether NUMA-related issues exist and, if so, where the NUMA
> bottleneck(s) reside. It can be quite challenging, especially in complex
> server environments.
>
> We decided to create a tool that automatically performs the typical steps in
> NUMA analysis and provides a good starting point to dive in and fix
> NUMA-related bottlenecks. That's NumaTOP!
>
> NumaTOP is an observation tool for runtime memory locality characterization
> and analysis of processes and threads running on a NUMA system. It helps the
> user characterize the NUMA behavior of processes and threads and identify
> where the NUMA-related performance bottlenecks reside. It uses Intel
> performance counter sampling technologies and associates the performance
> data with system runtime information to provide real-time analysis for
> production systems.
>
> NumaTOP is a GUI tool. It can run on Linux kernel 3.8 with a perf load
> latency patch today. That patch is planned to be integrated into kernel 3.9
> or a later release.
>
> To learn more about NumaTOP, visit:
> http://01.org/numatop/
>
> Best Regards
> Jin Yao
>
>
>
> Hi,  I am wondering whether  the separated kernel patch is available. It
> would be very helpful to my pool networking and my strong curiosity to try
> NumaTop.:)
>
> Thanks.
>
>
>
>
>
> Xiong
>
>
>
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] pinctrl: move subsystem mutex to pinctrl_dev struct

2013-04-24 Thread Linus Walleij
On Wed, Apr 10, 2013 at 3:04 PM, Patrice CHOTARD  wrote:
> On 03/28/2013 12:33 AM, Stephen Warren wrote:

 I don't understand the link between maps and pinctrl_select(),
 pinctrl_select_state_locked() doesn't touch the map.
>>
>> Yes, pinctrl_select() shouldn't touch the map since it's already been
>> parsed.
>>
>> But if there's a per-pinctrl-driver lock, then pinctrl_select() needs to
>> lock all those locks for each driver referenced by a struct
>> pinctrl_state entry.
>>
>> Perhaps it doesn't need to hold more than one of those at a time though;
>> that might help remove any possibility of deadlock.
>
> Ok, regarding pinctrl_select(), i will propose a new patch version which
> hold the per-pincontrol-driver lock referenced by each struct
> pinctrl_state entry.

I've tested this (with a newer patch from Patrice) and it regresses
on the U300 platform.

pinctrl_select_state() calls pinconf_apply_setting, which
calls ops->pin_config_set(), which needs to figure out the
GPIO range for this pin and calls back into core function
pinctrl_find_gpio_range_from_pin(), which again takes
the pctldev mutex -> deadlock.

What I do not understand is this: both pinctrl_lookup_state()
and pinctrl_select_state() are taking (today) the global
pinctrl mutex. Patrice's patch moves this to take the dev list
mutex.

Taking the dev list mutex is not correct since we're only
dealing with the isolated struct pinctrl * at this point.
I think. Unless the idea is to protect agains the device
being removed underneath.

I don't see the point in taking either mutex actually and
what it's protecting against. If it's just protecting against the
pinctrl device being removed during state selection, doing
that will cause *way* bigger problems anyway (think of all
the devices that have struct pinctrl * around!) so it's not
the way forward anyway. The struct pinctrl * was designed
to be floating around independently of the devices since
forever.

pinctrl_unregister() calls pinctrl_put_locked() on all pinctrl
handles, at which point it should scream if any of these are
in use and that is the big problem with removing the pinctrl
devices - the system as a whole just need to make sure
there are no users left, it cannot be guaranteed with
mutexes.

I just removed those two mutexes (in pinctrl_lookup_state
and pinctrl_select_state), will send the modified
version of Patrice's patch soon-ish.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 00/14] drivers: mailbox: framework creation

2013-04-24 Thread Jassi Brar
Hi -

On 24 April 2013 13:38, Loic PALLARDY  wrote:
> Hi Jassi,
>
> On 04/24/2013 06:39 AM, Jassi Brar wrote:

>>   The non-atomic API falls flat should just a single client comes with
>> very low latency requirements.
>
> In fact there are different situations for the non/atomic requirements
> (at least from ST POV)
> - one mailbox could be non-atomic only (blocking if we reuse notifier
> wording)
> - one mailbox could be atomic only
> - one mailbox could be both depending on the context and usage (example:
> in the case of ST, one mailbox is used to access the analogue baseband,
> there is no particular atomic requirement for that except during
> register dump called form panic context)
>
> For the 3rd point I agree with you, it should be considered as atomic
> and up to driver to schedule a sleepable task...
>
> I have an internal implementation in which each mailbox is declared
> either atomic or blocking.
> Depending on this parameter, the behavior of the mbox_send_mbox is
> changed...
>
I am only talking about the nature of the API, which I think should as
fast as possible by providing atomic functions (except
mailbox_get/put).
If a controller needs to do sleep-prone tasks, let it schedule those
from API's atomic callbacks.
If a client needs to blink leds after receiving/sending a message, let
it schedule a work for that from API's atomic callback.
Majority of scenarios will simply be a client populating a structure
and pass it onto the controller driver which only need to program a
few registers to put the message on the h/w link.


>>   Consider this example for better understanding, I must send a
>> particular packet to the remote before I could, say, shutdown
>> properly. The client calls mailbox_msg_send which queues the packet
>> because the h/w was busy. Since the api does not inform the client
>> about packet transmission, the client does not know when to shutdown
>> (the packet may have been sent instantly or it may lie on the queue
>> for a long time).
>>   How do you fix this without tx_done callback method?
>>
> This mechanism was preserved to be compatibility with TI DSP bridge. But
> my initial proposal was to remove it, simply because today all mailbox
> customers consider that message is sent or not after calling
> mbox_send_message function.
>
Yeah, I too sense a lot of badness is inherited.

>>>
>>> The size parameter would still be needed. Depending on the h/w, it can be 
>>> just an u32 or a series of bytes, and even in the latter case, it is not 
>>> guaranteed that all messages transmitted will occupy the entire h/w shared 
>>> memory data packet. I can see the current header field getting absorbed 
>>> into the opaque void * structure for the ST mailbox driver. The size and 
>>> ptr together provide a very generic message format.
>>>
>> I am not sure about it. The API has no purpose for the .size (it's
>> between the controller and the client driver).
>> Controllers that could send variable length packets could define the
>> packets format for clients as
>>   struct foo_packet {
>>   int size;
>>   ...
>>   }
>> and exchange as typecasted to void* via the API. And this is just one
>> way of doing it.
>> The point being, the API should only pass pointer to packet info
>> between controller and client drivers.
> No today the size is used to store the message in the fifo and that's
> done by the framework.
> If you decide to remove the fifo mechanism inherit for TI legacy, in
> that case yes the mailbox framework doesn't matter about message format
> and size.
>
Of course I desperately want to get rid of the TI legacy stuff in the
common api, that will simply not work on many platforms. My 'shutdown'
example above may be real for some platform.

>>
> I'm really happy to see some new mailbox framework clients coming with
> new requirements to improve the solution.
> Just for the story, mailbox framework topic was addressed during Linaro
> Copenhagen Connect and at the time being it was decided to reuse TI
> solution in a first time and then to improve it...
>
At the time my idea of mailbox was simply a tin box with a lock and a slit.
On a serious note, someone very important pointed out that things
discussed during events like Linaro shouldn't be taken as the
consensus of the community. "We" should have put it up for discussion
on the mailing lists.

>> Maybe it will help if I know what you guys mean by "shared mem" or an
>> "hw fifo" mailbox?
>>
> Hw fifo means that you what a HW IP which contains x bytes fifo.
> When you write one byte in the fifo, an interrupt is automatically
> raised and caught by coprocessor which should read fifo on its side to
> empty it. In that case, Tx RTR is mandatory.
> Shared mem, means that mailbox is made up of a cross interrupt + a
> status register (may be optional) + a shared memory in which messages
> are exchanged.
> After writing message in shared mem, CPU has to raise the cross
> interrupt itself. In case flow control is 

Re: [PATCH 17/32] dmaengine: ste_dma40: Remove redundant argument from d40_phy_cfg()

2013-04-24 Thread Lee Jones
> > +   if ((cfg->dir ==  STEDMA40_PERIPH_TO_MEM) ||
> > +   (cfg->dir == STEDMA40_PERIPH_TO_PERIPH)) {
> Why would you need your own direction defines, I see that there is not much
> diff between these and what dmaengine defines, so perhpas you could use
> those?

Same with these ones, subsequent patch?

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[HELP] cpuidle in SYSFS: /sys/devices/system/cpu/cpu0/cpuidle/state0/desc

2013-04-24 Thread Ren Zhen
Hi all:
In /Documentation/cpuidle/sysfs.txt, It says:
"desc : Small description about the idle state(string)".

when I read desc:

mysystem:/sys/devices/system/cpu/cpu0/cpuidle/state0/# cat desc
CPUIDLE CORE POLL IDLE


Here is my question:What the meaning of  ‘CPUIDLE CORE POLL IDLE'?

Any help will be appreciated!
--
Sincerely,
Ren Zhen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 05/32] dmaengine: ste_dma40: Supply macros to resolve 'src' and 'dst' directions

2013-04-24 Thread Lee Jones
On Mon, 22 Apr 2013, Lee Jones wrote:

> On Mon, 22 Apr 2013, Vinod Koul wrote:
> 
> > On Thu, Apr 18, 2013 at 11:11:47AM +0100, Lee Jones wrote:
> > > There are lots of lengthy if() statements located sporadically up and
> > > down the driver. This simple macro should make many of them a little
> > > simpler to decipher. The remainder have to stay in place, as they
> > > detail slightly more specific settings.
> > I would like these to be DMAENGINE_IS_SRC...
> 
> I don't understand, as they're DMA40 specific?
> 
> > and this patch use the defines provided in dmaengine
> 
> I think a subsequent patch doing he following would be more suitable:
> 
> s/STEDMA40_MEM_TO_MEM/DMA_MEM_TO_MEM/
> s/STEDMA40_MEM_TO_PERIPH/DMA_MEM_TO_DEV/
> s/STEDMA40_PERIPH_TO_MEM/DMA_DEV_TO_MEM/
> s/STEDMA40_PERIPH_TO_PERIPH/DMA_DEV_TO_DEV/
> 
> If you don't mind?

Are you happy to Ack this one too if I follow up with a subsequent
patch converting all STEDMA direction defines over to the generic DMA
ones? There are also quite a lot in platform data that I'd like to
convert too.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 15/32] dmaengine: ste_dma40: Separate Logical Global Interrupt Mask (GIM) unmasking

2013-04-24 Thread Lee Jones
On Mon, 22 Apr 2013, Lee Jones wrote:

> > >  void d40_phy_cfg(struct stedma40_chan_cfg *cfg,
> > >u32 *src_cfg, u32 *dst_cfg, bool is_log)
> > > @@ -107,11 +113,6 @@ void d40_phy_cfg(struct stedma40_chan_cfg *cfg,
> > >   src |= 1 << D40_SREG_CFG_PRI_POS;
> > >   dst |= 1 << D40_SREG_CFG_PRI_POS;
> > shouldnt these be converted to BIT() macro and in gim_unmask above?
> > Driver needs to be consistent in doing things
> 
> Absolutely they do. I haven't converted ste_dma40_ll.c to BIT yet
> though. I have this on my TODO and it will happen in the next
> patch-set.

Vinod, are you happy to Ack this on the proviso that I follow it up
with a subsequent patch converting the ste_dma40_ll driver to BIT()?

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 08/32 v2] dmaengine: ste_dma40: Remove home-brew MAX() macro

2013-04-24 Thread Lee Jones
The current implementation of the DMA40's local MAX() macro evaluates
its arguments more times than is necessary and it not type checked.
This patch strips replaces it with a new, more efficient constant.

Cc: Vinod Koul 
Cc: Dan Williams 
Cc: Per Forlin 
Cc: Rabin Vincent 
Reported-by: Harvey Harrison 
Signed-off-by: Lee Jones 

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index cc93416..a1984d2 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -53,8 +53,6 @@
 #define D40_ALLOC_PHY  BIT(30)
 #define D40_ALLOC_LOG_FREE 0
 
-#define MAX(a, b) (((a) < (b)) ? (b) : (a))
-
 #define D40_IS_SRC(dir)  (dir == STEDMA40_PERIPH_TO_MEM)
 #define D40_IS_DST(dir) ((dir == STEDMA40_MEM_TO_PERIPH) || \
 (dir == STEDMA40_MEM_TO_MEM))
@@ -206,6 +204,9 @@ static u32 d40_backup_regs_chan[] = {
D40_CHAN_REG_SDLNK,
 };
 
+#define BACKUP_REGS_SZ_MAX ((BACKUP_REGS_SZ_V4A > BACKUP_REGS_SZ_V4B) ? \
+BACKUP_REGS_SZ_V4A : BACKUP_REGS_SZ_V4B)
+
 /**
  * struct d40_interrupt_lookup - lookup table for interrupt handler
  *
@@ -569,7 +570,7 @@ struct d40_base {
resource_size_t   lcpa_size;
struct kmem_cache*desc_slab;
u32   reg_val_backup[BACKUP_REGS_SZ];
-   u32   
reg_val_backup_v4[MAX(BACKUP_REGS_SZ_V4A, BACKUP_REGS_SZ_V4B)];
+   u32   reg_val_backup_v4[BACKUP_REGS_SZ_MAX];
u32  *reg_val_backup_chan;
u16   gcc_pwr_off_mask;
bool  initialized;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] arm64: compiling issue, need add include/asm/vga.h file

2013-04-24 Thread Chen Gang
On 2013年04月24日 16:22, Catalin Marinas wrote:
> On Wed, Apr 24, 2013 at 04:44:29AM +0100, Chen Gang wrote:
>> For compiling with allmodconfig, need vga.h file, so copy it from arm32.
> 
> I would rather use the generic vga.h. We don't even have a vga_base
> defined.
> 

OK, thanks. I need send patch v2.

-- 
Chen Gang

Asianux Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 2/3] resource: Add release_mem_region_adjustable()

2013-04-24 Thread Ram Pai
On Thu, Apr 11, 2013 at 10:30:02AM -0600, Toshi Kani wrote:
> On Wed, 2013-04-10 at 15:24 -0700, Andrew Morton wrote:
> > On Wed, 10 Apr 2013 15:08:29 -0700 (PDT) David Rientjes 
> >  wrote:
> > 
> > > On Wed, 10 Apr 2013, Toshi Kani wrote:
> > > 
> > > > > I'll switch it to GFP_ATOMIC.  Which is horridly lame but the
> > > > > allocation is small and alternatives are unobvious.
> > > > 
> > > > Great!  Again, thanks for the update!
> > > 
> > > release_mem_region_adjustable() allocates at most one struct resource, so 
> > > why not do kmalloc(sizeof(struct resource), GFP_KERNEL) before taking 
> > > resource_lock and then testing whether it's NULL or not when splitting?  
> > > It unnecessarily allocates memory when there's no split, but 
> > > __remove_pages() shouldn't be a hotpath.
> > 
> > yup.
> > 
> > --- a/kernel/resource.c~resource-add-release_mem_region_adjustable-fix-fix
> > +++ a/kernel/resource.c
> > @@ -1046,7 +1046,8 @@ int release_mem_region_adjustable(struct
> > resource_size_t start, resource_size_t size)
> >  {
> > struct resource **p;
> > -   struct resource *res, *new;
> > +   struct resource *res;
> > +   struct resource *new_res;
> > resource_size_t end;
> > int ret = -EINVAL;
> >  
> > @@ -1054,6 +1055,9 @@ int release_mem_region_adjustable(struct
> > if ((start < parent->start) || (end > parent->end))
> > return ret;
> >  
> > +   /* The kzalloc() result gets checked later */
> > +   new_res = kzalloc(sizeof(struct resource), GFP_KERNEL);
> > +
> > p = >child;
> > write_lock(_lock);
> >  
> > @@ -1091,32 +1095,33 @@ int release_mem_region_adjustable(struct
> > start - res->start);
> > } else {
> > /* split into two entries */
> > -   new = kzalloc(sizeof(struct resource), GFP_ATOMIC);
> > -   if (!new) {
> > +   if (!new_res) {
> > ret = -ENOMEM;
> > break;
> > }
> > -   new->name = res->name;
> > -   new->start = end + 1;
> > -   new->end = res->end;
> > -   new->flags = res->flags;
> > -   new->parent = res->parent;
> > -   new->sibling = res->sibling;
> > -   new->child = NULL;
> > +   new_res->name = res->name;
> > +   new_res->start = end + 1;
> > +   new_res->end = res->end;
> > +   new_res->flags = res->flags;
> > +   new_res->parent = res->parent;
> > +   new_res->sibling = res->sibling;
> > +   new_res->child = NULL;
> >  
> > ret = __adjust_resource(res, res->start,
> > start - res->start);
> > if (ret) {
> > -   kfree(new);
> > +   kfree(new_res);
> > break;
> > }
> 
> The kfree() in the if-statement above is not necessary since kfree() is
> called before the return at the end.  That is, the if-statement needs to
> be:
>   if (ret)
>   break;
> 
> With this change, I confirmed that all my test cases passed (with all
> the config debug options this time :).  With the change:
> 
> Reviewed-by: Toshi Kani 

I am not confortable witht the assumption, that when a split takes
place, the children are assumed to be in the lower entry. Probably a
warning to that effect,  would help quickly
nail down the problem, if such a case does encounter ?

Otherwise this looks fine. Sorry for the delayed reply. Was out.

Reviewed-by: Ram Pai 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 21/32 v2] dmaengine: ste_dma40: Also report the number of logical channels

2013-04-24 Thread Lee Jones
dmaengine: ste_dma40: Also report the number of logical channels

Now we know the total of physical and logical channels, we may as
well report them within the information log.

Before:
dma40 dma40.0: hardware revision: 3 @ 0x801c with 8 physical channels

After:
 and 256 logical channels

Cc: Vinod Koul 
Cc: Dan Williams 
Cc: Per Forlin 
Cc: Rabin Vincent 
Signed-off-by: Lee Jones 

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 4c6df0e..d5a15ec 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3200,8 +3200,9 @@ static struct d40_base * __init d40_hw_detect_init(struct 
platform_device *pdev)
 
num_log_chans = num_phy_chans * D40_MAX_LOG_CHAN_PER_PHY;
 
-   dev_info(>dev, "hardware revision: %d @ 0x%x with %d physical 
channels\n",
-rev, res->start, num_phy_chans);
+   dev_info(>dev,
+"hardware rev: %d @ 0x%x with %d physical chans and %d logical 
chans\n",
+rev, res->start, num_phy_chans, num_log_chans);
 
base = kzalloc(ALIGN(sizeof(struct d40_base), 4) +
   (num_phy_chans + num_log_chans + 
ARRAY_SIZE(dma40_memcpy_channels)) *
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 00/14] drivers: mailbox: framework creation

2013-04-24 Thread Loic PALLARDY
Hi Jassi,

On 04/24/2013 09:59 AM, Jassi Brar wrote:
> Hi Loic,
>
> On 24 April 2013 13:09, Loic PALLARDY  wrote:
>> Hi Jassi, Suman,
>>
>> Yes, the xxx_no_irq API has been introduced to answer some STE
>> requirements. It must be possible to send some message under atomic
>> context for different reasons (latency, during idle/suspend procedures...).
>> This is not the best way to do, but the goal was to preserve TI legacy
>> in a first step. As explained by Suman, this patch series is coming from
>> the original TI mailbox framework and is modified step by step to fit
>> with all platforms.
>>
> IMHO a better way is to introduce a clean generically designed API and
> convert the existing drivers one at time. Let the TI drivers work as
> such for a while until someone converts them to the common API.
> Cloning and then complete organ transplantation seems a very
> inefficient way to have something new ;)
>
As explained in previous mail, it was not the decision taken during 
Linaro Copenhagen Connect to restart from scratch, mainly because only 
ST and TI were interested by such framework at the time being.


 (d) The 'struct mailbox_msg' should be just an opaque void* - the 
 client/protocol
 driver typecasts to void* the IPC controller specific message structure. 
 API
 shouldn't aim the impossible of providing a generic message format.
>>>
>>> The size parameter would still be needed. Depending on the h/w, it can be 
>>> just an u32 or a series of bytes, and even in the latter case, it is not 
>>> guaranteed that all messages transmitted will occupy the entire h/w shared 
>>> memory data packet. I can see the current header field getting absorbed 
>>> into the opaque void * structure for the ST mailbox driver. The size and 
>>> ptr together provide a very generic message format.
>> That's something we discussed with Suman. The mailbox framework should
>> be independent from message format. Since mailbox could be base don a
>> shared mem or an hw fifo, message size is mandatory to transmit the
>> right number of data.
>>
> I too believe the "mailbox framework should be independent from
> message format" but _also_ that .size doesn't have to be a part of the
> standard format.
> Maybe it will help if I know what you guys mean by "shared mem" or an
> "hw fifo" mailbox?
>
Hw fifo means that you what a HW IP which contains x bytes fifo.
When you write one byte in the fifo, an interrupt is automatically 
raised and caught by coprocessor which should read fifo on its side to 
empty it. In that case, Tx RTR is mandatory.
Shared mem, means that mailbox is made up of a cross interrupt + a 
status register (may be optional) + a shared memory in which messages 
are exchanged.
After writing message in shared mem, CPU has to raise the cross 
interrupt itself. In case flow control is less important...

/Loic
> Thanks
> -Jassi--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: "attempt to move .org backwards" still show up

2013-04-24 Thread Mike Qiu

于 2013/4/24 16:31, Michael Ellerman 写道:

On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:

Hi all

I get an error message when I compile the source code in Power7 platform
use the newest upstream kernel.

Hi Mike,

It depends on what your .config is. What defconfig are you building?

cheers


And I do know how to build the source code in this machine . . .

Thanks

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: "attempt to move .org backwards" still show up

2013-04-24 Thread Mike Qiu

于 2013/4/24 16:31, Michael Ellerman 写道:

On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:

Hi all

I get an error message when I compile the source code in Power7 platform
use the newest upstream kernel.

Hi Mike,

It depends on what your .config is. What defconfig are you building?
I just copy the config file from /boot/config.* to .config and use make 
menuconfig

change nothing by manually, then save.

cheers



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 21/32] dmaengine: ste_dma40: Also report the number of logical channels

2013-04-24 Thread Lee Jones
On Mon, 22 Apr 2013, Russell King - ARM Linux wrote:

> On Mon, Apr 22, 2013 at 11:37:15AM +0100, Lee Jones wrote:
> > On Mon, 22 Apr 2013, Vinod Koul wrote:
> > 
> > > On Mon, Apr 22, 2013 at 11:14:55AM +0100, Lee Jones wrote:
> > > > On Mon, 22 Apr 2013, Vinod Koul wrote:
> > > > 
> > > > > On Thu, Apr 18, 2013 at 11:12:03AM +0100, Lee Jones wrote:
> > > > > > +   dev_info(>dev, "hardware revision: %d @ 0x%x with "
> > > > > > +   "%d physical channels and %d logical channels\n",
> > > > > > +   rev, res->start, num_phy_chans, num_log_chans);
> > > > > Splitting log messages across lines is bad idea and sacrifces 
> > > > > readablity... also
> > > > > wasnt splitting logging to multiple lines emit checkpatch warn
> 
> Yes, but for a different reason...
> 
> > > > You also get a check-patch error if your lines are over 80 chars.
> > > No, you get a warn
> > 
> > You only get a warning for this too:
> > 
> >  WARNING: quoted string split across lines
> > #33: FILE: drivers/dma/ste_dma40.c:3204:
> > +   dev_info(>dev, "hardware revision: %d @ 0x%x with "
> > +   "%d physical channels and %d logical channels\n",
> 
> From coding style: "However, never break user-visible strings such as
> printk messages, because that breaks the ability to grep for them."
> 
> You can argue that you wouldn't grep for the above string - but consider
> if you grepped for "hardware revision.*channels" to try and find the
> above message, which would be a reasonable thing to try if you got lots
> of hits on just "hardware revision".

Okay, this I understand. I'll fixup.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] lowmemorykiller: prevent multiple instances of low memory killer

2013-04-24 Thread Dolkow, Snild
> No, it's not.  This is controlled higher in shrink_slab() by this:
>
>   max_pass = do_shrinker_shrink(shrinker, shrink, 0);
>   if (max_pass <= 0)
>   continue;
>

Yes, but the later calls will still not handle other negative values as 
failures, and there is a chance that more than one thread will get past that 
first check. 

286 nr_before = do_shrinker_shrink(shrinker, shrink, 0);
287 shrink_ret = do_shrinker_shrink(shrinker, shrink,
288 batch_size);
289 if (shrink_ret == -1)
290 break;
291 if (shrink_ret < nr_before)
292 ret += nr_before - shrink_ret;

If, for example, nr_before happens to be -2 and shrink_ret happens to be -1000 
here, we're going to erroneously increase ret by 998.

> and your patch is implemented incorrectly, i.e. it does not return 
> LMK_BUSY if the spinlock is contended which needlessly recalls the 
> shrinker later.

It's worth noting that the LMK has a fastpath for the nr_to_scan=0 case, like 
the shrinker.h comment recommends. And nr_to_scan=0 is used to query the cache 
size, so it seems like a good idea to return successfully whenever we can.

> You have a couple of options:
>
>  - return -1 when the spinlock is contended immediately when
>!sc->nr_to_scan (although it should really be a cmpxchg since a
>spinlock isn't needed), or

This comes with the risk of nr_before being -1, and shrink_ret being positive. 
In that case, we will have sent a kill signal, but we're not increasing ret. 
Not a catastrophe, AFAICT, but not fantastic either.

>  - protect the for_each_process() loop in lowmem_shrink() with an
>actual spinlock that will detect any previously killed process
>since it will have the TIF_MEMDIE bit set.

We expect that killing one process will be enough, so spinning seems like a 
waste of time. If one process wasn't enough, the LMK will trigger again soon.

//Snild
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] arch/powerpc/kernel: using %12.12s instead of %12s for avoiding memory overflow.

2013-04-24 Thread Chen Gang
On 2013年04月24日 16:19, Vasant Hegde wrote:
>> for tmp_part->header.name:
>> >   it is "Terminating null required only for names<   12 chars".
>> >   so need to limit the %.12s for it in printk
>> >
>> > additional info:
>> >
>> >   %12s  limit the width, not for the original string output 
>> > length
>> > if name length is more than 12, it still can be fully 
>> > displayed.
>> > if name length is less than 12, the ' ' will be filled 
>> > before name.
>> >
>> >   %.12s truly limit the original string output length 
>> > (precision)
>> >
>> >
>> > Signed-off-by: Chen Gang
>> > ---
>> >arch/powerpc/kernel/nvram_64.c |2 +-
>> >1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/arch/powerpc/kernel/nvram_64.c 
>> > b/arch/powerpc/kernel/nvram_64.c
>> > index bec1e93..57bf6d2 100644
>> > --- a/arch/powerpc/kernel/nvram_64.c
>> > +++ b/arch/powerpc/kernel/nvram_64.c
>> > @@ -202,7 +202,7 @@ static void __init nvram_print_partitions(char 
>> > * label)
>> >printk(KERN_WARNING "%s-\n", label);
>> >printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n");
>> >list_for_each_entry(tmp_part,_partitions, 
>> > partition) {
>> > -  printk(KERN_WARNING "%4d\t%02x\t%02x\t%d\t%12s\n",
>> > +  printk(KERN_WARNING "%4d
>> > \t%02x\t%02x\t%d\t%12.12s\n",
>> > 
>> > First, this code in inside NVRAM_DEBUG which is used only for debug 
>> > purpose and
>> > AFAIK, all partition names are less than 20 character. So I don't think we 
>> > need
> Sorry.. I meant 12 character.

Please see line 283:
  "strncpy(part->header.name, "", 12);"
  (it is not a NUL terminated string, and the length is 12)

And also, can we be sure that all partition names should be less than 12
characters ?

All together, I think we still need %12.12s to protect the memory.

Thanks.

-- 
Chen Gang

Asianux Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: "attempt to move .org backwards" still show up

2013-04-24 Thread Michael Ellerman
On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:
> Hi all
> 
> I get an error message when I compile the source code in Power7 platform
> use the newest upstream kernel.

Hi Mike,

It depends on what your .config is. What defconfig are you building?

cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


<    1   2   3   4   5   6   7   8   9   10   >