[3.8-rc3 -> 3.8-rc4 regression] Re: [PATCH] module, async: async_synchronize_full() on module init iff async is used

2013-08-12 Thread Jonathan Nieder
Hi,

Tejun Heo wrote:

> This avoids the described deadlock because iosched module doesn't use
> async and thus wouldn't invoke async_synchronize_full().  This is
> hacky and incomplete.  It will deadlock if async module loading nests;
> however, this works around the known problem case and seems to be the
> best of bad options.
>
> For more details, please refer to the following thread.
>
>   http://thread.gmane.org/gmane.linux.kernel/1420814

My laptop fails to boot[1] with the message 'Volume group "data" not
found'.  Bisects to v3.8-rc4~17 (the above commit).  Reverting that
commit on top of current "master" (d92581fcad18, 2013-08-10) produces
a working kernel.  dmesg output from that working kernel attached.
More details, including .config, at [2].

Any ideas for tracking this down?

Thanks,
Jonathan

[1] Screenshot: 
http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=bad_3.10.3-1.jpg;att=1;bug=719464
Screenshot in recovery mode: 
http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=bad_3.10.3-1_recovery.jpg;att=2;bug=719464
[2] http://bugs.debian.org/719464
[0.00] Initializing cgroup subsys cpuset
[0.00] Initializing cgroup subsys cpu
[0.00] Initializing cgroup subsys cpuacct
[0.00] Linux version 3.11.0-rc4+ (jrn@elie) (gcc version 4.7.3 (Debian 
4.7.3-6) ) #2 SMP Sun Aug 11 23:20:20 PDT 2013
[0.00] Command line: BOOT_IMAGE=/vmlinuz-3.11.0-rc4+ 
root=/dev/mapper/data-root ro quiet
[0.00] e820: BIOS-provided physical RAM map:
[0.00] BIOS-e820: [mem 0x-0x0009fbff] usable
[0.00] BIOS-e820: [mem 0x0009fc00-0x0009] reserved
[0.00] BIOS-e820: [mem 0x000e-0x000f] reserved
[0.00] BIOS-e820: [mem 0x0010-0x6e545fff] usable
[0.00] BIOS-e820: [mem 0x6e546000-0x6e745fff] ACPI NVS
[0.00] BIOS-e820: [mem 0x6e746000-0x6fd3efff] usable
[0.00] BIOS-e820: [mem 0x6fd3f000-0x6fdbefff] reserved
[0.00] BIOS-e820: [mem 0x6fdbf000-0x6febefff] ACPI NVS
[0.00] BIOS-e820: [mem 0x6febf000-0x6fef6fff] ACPI data
[0.00] BIOS-e820: [mem 0x6fef7000-0x6fef] usable
[0.00] BIOS-e820: [mem 0xf800-0xf8ff] reserved
[0.00] BIOS-e820: [mem 0xfec0-0xfec00fff] reserved
[0.00] BIOS-e820: [mem 0xfec1-0xfec10fff] reserved
[0.00] BIOS-e820: [mem 0xfee0-0xfee00fff] reserved
[0.00] BIOS-e820: [mem 0xffe0-0x] reserved
[0.00] NX (Execute Disable) protection: active
[0.00] SMBIOS 2.6 present.
[0.00] DMI: TOSHIBA Satellite C650D/Portable PC, BIOS 1.60 09/02/2010
[0.00] e820: update [mem 0x-0x0fff] usable ==> reserved
[0.00] e820: remove [mem 0x000a-0x000f] usable
[0.00] No AGP bridge found
[0.00] e820: last_pfn = 0x6ff00 max_arch_pfn = 0x4
[0.00] MTRR default type: uncachable
[0.00] MTRR fixed ranges enabled:
[0.00]   0-9 write-back
[0.00]   A-B uncachable
[0.00]   C-F write-through
[0.00] MTRR variable ranges enabled:
[0.00]   0 base  mask C000 write-back
[0.00]   1 base 4000 mask E000 write-back
[0.00]   2 base 6000 mask F000 write-back
[0.00]   3 base 6FEBE000 mask F000 uncachable
[0.00]   4 base FFE0 mask FFE0 write-protect
[0.00]   5 disabled
[0.00]   6 disabled
[0.00]   7 disabled
[0.00] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
[0.00] Base memory trampoline at [88099000] 99000 size 24576
[0.00] Using GB pages for direct mapping
[0.00] init_memory_mapping: [mem 0x-0x000f]
[0.00]  [mem 0x-0x000f] page 4k
[0.00] BRK [0x0184c000, 0x0184cfff] PGTABLE
[0.00] BRK [0x0184d000, 0x0184dfff] PGTABLE
[0.00] BRK [0x0184e000, 0x0184efff] PGTABLE
[0.00] init_memory_mapping: [mem 0x6fa0-0x6fbf]
[0.00]  [mem 0x6fa0-0x6fbf] page 2M
[0.00] BRK [0x0184f000, 0x0184] PGTABLE
[0.00] init_memory_mapping: [mem 0x6c00-0x6e545fff]
[0.00]  [mem 0x6c00-0x6e3f] page 2M
[0.00]  [mem 0x6e40-0x6e545fff] page 4k
[0.00] BRK [0x0185, 0x01850fff] PGTABLE
[0.00] init_memory_mapping: [mem 0x6e746000-0x6f9f]
[0.00]  [mem 0x6e746000-0x6e7f] page 4k
[0.00]  [mem 0x6e80-0x6f9f] page 2M
[0.00] init_memory_mapping: [mem 0x0010-0x6bff]
[0.00]  [mem 0x0010-0x001f] page 4k
[0.00]  [mem 0x0020-0x6bff] page 2M
[0.00] init

linux-next: Tree for Aug 12

2013-08-12 Thread Stephen Rothwell
Hi all,

Changes since 20130809:

The wireless-next tree gained a conflict against the wireless tree.

The cgroup tree gained a conflict against the net-next tree.

The akpm-current tree gained a conflict against the cgroup tree.



I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/next/ ).  If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one.  You should use "git fetch" as mentioned in the FAQ on the wiki
(see below).

You can see which trees have been included by looking in the Next/Trees
file in the source.  There are also quilt-import.log and merge.log files
in the Next directory.  Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
final fixups (if any), it is also built with powerpc allnoconfig (32 and
64 bit), ppc44x_defconfig and allyesconfig (minus
CONFIG_PROFILE_ALL_BRANCHES - this fails its final link) and i386, sparc,
sparc64 and arm defconfig. These builds also have
CONFIG_ENABLE_WARN_DEPRECATED, CONFIG_ENABLE_MUST_CHECK and
CONFIG_DEBUG_INFO disabled when necessary.

Below is a summary of the state of the merge.

We are up to 222 trees (counting Linus' and 30 trees of patches pending
for Linus' tree), more are welcome (even if they are currently empty).
Thanks to those who have contributed, and to those who haven't, please do.

Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next .  If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.

Thanks to Randy Dunlap for doing many randconfig builds.  And to Paul
Gortmaker for triage and bug fixes.

There is a wiki covering stuff to do with linux-next at
http://linux.f-seidel.de/linux-next/pmwiki/ .  Thanks to Frank Seidel.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

$ git checkout master
$ git reset --hard stable
Merging origin/master (77f63b4 Merge branch 'merge' of 
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc)
Merging fixes/master (b3a3a9c Merge tag 'trace-3.11-rc2' of 
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace)
Merging kbuild-current/rc-fixes (ad81f05 Linux 3.11-rc1)
Merging arc-current/for-curr (c095ba7 Linux 3.11-rc4)
Merging arm-current/fixes (e35ac62 Merge branch 'security-fixes' into fixes)
Merging m68k-current/for-linus (ad81f05 Linux 3.11-rc1)
Merging metag-fixes/fixes (dfe248b MAINTAINERS: add linux-metag mailing list)
Merging powerpc-merge/merge (28e61cc powerpc/tm: Fix context switching TAR, PPR 
and DSCR SPRs)
Merging sparc/master (1c2696c sparc64: Fix ITLB handler of null page)
Merging net/master (e5ac5da Merge tag 'batman-adv-fix-for-davem' of 
git://git.open-mesh.org/linux-merge)
Merging ipsec/master (01cb71d net_sched: restore "overhead xxx" handling)
Merging sound-current/for-linus (57e6dae ALSA: usb-audio: do not trust too-big 
wMaxPacketSize values)
Merging pci-current/for-linus (36dd1f3 PCI: mvebu: Disable prefetchable memory 
support in PCI-to-PCI bridge)
Merging wireless/master (909bd59 Hostap: copying wrong data 
prism2_ioctl_giwaplist())
Merging driver-core.current/driver-core-linus (5ae90d8 Linux 3.11-rc3)
Merging tty.current/tty-linus (c095ba7 Linux 3.11-rc4)
Merging usb.current/usb-linus (444ce9d MAINTAINERS: Add separate section for 
USB NETWORKING DRIVERS)
Merging staging.current/staging-linus (cefe8a3 Merge tag 'iio-fixes-for-3.11b' 
of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus)
Merging char-misc.current/char-misc-linus (5ae90d8 Linux 3.11-rc3)
Merging input-current/for-linus (88ce3c3 Merge branch 'next' into for-linus)
Merging md-current/for-linus (f94c0b6 md/raid5: fix interaction of 'replace' 
and 'recovery'.)
Merging audit-current/for-linus (c158a35 audit: no leading space in 
audit_log_d_path prefix)
Merging crypto-current/master (e70308e Revert "crypto: crct10dif - Wrap 
crc_t10dif function all to use crypto transform framework")
Merging ide/master (6d128e1 Revert "Makefile: Fix install error with make -j 
option")
Merging dwmw2/master (5950f08 pcmcia: remove RPX board stuff)
Merging sh-current/sh-fixes-for-linus (4403310 SH: Convert out[bwl] macros to 
inline functions)
Merging devicetree-current/devicetree/merge (cf9e236 of/irq: init struct 
resource to 0 in of_irq_to_resource())
Merging rr-fixes/fixes (6c2580c Merge branch 'for-linus' of 
git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32)
Merging mfd-fixes/master (5649d8f mfd: ab8500-sysctrl: Let sysctrl driver work 
without pdata)
Merging vfio-fixes/for-linus (d24cdbf vfio-pci: Avoid deadlock on remove)
Merging drm-intel-fixes/drm-intel-fixes (3d51af0 drm/i915: Don't deref 
pipe->cpu_transcoder in the hang

Re: [PATCH 11/44] cpufreq: at32ap: Use generic cpufreq routines

2013-08-12 Thread Hans-Christian Egtvedt
Around Mon 12 Aug 2013 11:37:45 +0530 or thereabout, Viresh Kumar wrote:
> On 10 August 2013 13:53, Hans-Christian Egtvedt  wrote:
>> Around Sat 10 Aug 2013 12:14:07 +0530 or thereabout, Viresh Kumar wrote:
>>> Most of the CPUFreq drivers do similar things in .exit() and .verify() 
>>> routines
>>> and .attr. So its better if we have generic routines for them which can be 
>>> used
>>> by cpufreq drivers then.
>>>
>>> This patch uses these generic routines for this driver.
>>
>> Nice, thanks for cleaning up (-:
>>
>>> Cc: Hans-Christian Egtvedt 
>>> Signed-off-by: Viresh Kumar 
>>
>> Acked-by: Hans-Christian Egtvedt 
> 
> Thanks for your Ack but I have to NACK it :)
> 
> My patch was wrong.. It was based on the assumption that everybody who
> had implemented a .target() also implements a frequency table and exposes
> it.. And the generic routines I have exposed depend on that frequency table.
> And this cpufreq driver doesn't expose that freq table...

Right, my bad, I just looked at the code flow and saw that the generic path
did pretty much the same as the AVR32 implementation. Didn't consider the
table part as missing.

> And so this patch is dropped :(
> 

Ok, AVR32 driver should expose a frequency table then, which is quite simple.

-- 
mvh
Hans-Christian Egtvedt
--
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 11/44] cpufreq: at32ap: Use generic cpufreq routines

2013-08-12 Thread Viresh Kumar
On 12 August 2013 12:40, Hans-Christian Egtvedt  wrote:
> Ok, AVR32 driver should expose a frequency table then, which is quite simple.

It would be really nice if you can provide that patch, that will make
my life simple :)

I thought I can get a table for it but wasn't able to find out
necessary information
for that.
--
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 0/4][Resend] Radio device framework

2013-08-12 Thread akhil.goyal
From: Akhil Goyal 

RF signal path is integral part of any system that transmits/receives RF
(radio frequency) signals. In these systems Data is processed/converted
to IQ samples (digital representation a RF signal) and passed to a RFIC
(RF PHY) which converts the digital RF signal (IQ samples) to analog and
transmits over antenna.

Typically The signal path consists of multiple components: 

Antenna controller <-> vector signal processors <-> RFIC <-> Antenna

Each of these components have specific functionalities: 

1. Antenna controller: Framing of digital IQ data into protocol specific frames.
2. vector signal processors: For conditioning of signal.
3. RFIC : converts digital IQ data to analog signal which is 
transmitted/received on/from Air.

Also it is desirable to control the complete signal path, for example:
bringing the complete signal path up/down etc. 

The radio device framework introduces a way to accommodate the RF signal
paths.  One signal path is represented as a RF device (rf0, rf1 etc), and
it can contain multiple components which have their individual vendor
specific drivers. The framework provides mechanism by which individual
components can register with RF framework, and the framework will handle the 
binding
of individual component devices to a RF device. RF device exports the control
interfaces to user space, and this user space interface is independent of
component (vendor specific) drivers.

This patch set include
1. RF Interface: Independent of phy or antenna controller.
2. AIC driver: Antenna interface Controller(AIC) of Hetrogenous SOC's
like BSC9131, BSC9132
4. Device tree bindings for AIC.
5. Device tree changes for BSC9131-AIC

changes in v2:
1. incorporated comments for handling pointers in user space API structures.
2. Removed patches for AD9361 phy driver. It shall be sent once a proper
driver is in place for AD9361 chip
3. Removed Device tree nodes/bindings for AD9361
4. Incorporated comments for proper handling of wait_events
5. Added Documentation for IOCTL APIs and the structures used.
6. Inserted paddings in user space structures.
7. Reorganized code for rfdev.c to remove forward declaration and broke the
rf_ioctl() function to handle local structures correctly.
8. Corrected the error handling for mutex used.

Akhil Goyal (4):
  drivers/misc: Support for RF interface device framework
  drivers/misc/rf: AIC: Freescale Antenna Interface controller driver
  binding: Add device tree bindings for freescale AIC
  BSC9131rdb/dts: Add nodes for supporting AIC

 Documentation/devicetree/bindings/rf/fsl-aic.txt |   47 +
 Documentation/misc-devices/rf_framework  |  422 ++
 arch/powerpc/boot/dts/bsc9131rdb.dts |4 +
 arch/powerpc/boot/dts/fsl/bsc9131si-post.dtsi|   38 +
 drivers/misc/Kconfig |1 +
 drivers/misc/Makefile|1 +
 drivers/misc/rf/Kconfig  |   30 +
 drivers/misc/rf/Makefile |6 +
 drivers/misc/rf/controllers/Makefile |1 +
 drivers/misc/rf/controllers/fsl_aic.c| 1560 ++
 drivers/misc/rf/controllers/fsl_aic.h|  450 +++
 drivers/misc/rf/core/Makefile|2 +
 drivers/misc/rf/core/rf_channel.c|  211 +++
 drivers/misc/rf/core/rfdev.c | 1384 +++
 include/linux/rf_channel.h   |   25 +
 include/linux/rfdev.h|  251 
 include/uapi/linux/rfdev.h   |  367 +
 17 files changed, 4800 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rf/fsl-aic.txt
 create mode 100644 Documentation/misc-devices/rf_framework
 create mode 100644 drivers/misc/rf/Kconfig
 create mode 100644 drivers/misc/rf/Makefile
 create mode 100644 drivers/misc/rf/controllers/Makefile
 create mode 100644 drivers/misc/rf/controllers/fsl_aic.c
 create mode 100644 drivers/misc/rf/controllers/fsl_aic.h
 create mode 100644 drivers/misc/rf/core/Makefile
 create mode 100644 drivers/misc/rf/core/rf_channel.c
 create mode 100644 drivers/misc/rf/core/rfdev.c
 create mode 100644 include/linux/rf_channel.h
 create mode 100644 include/linux/rfdev.h
 create mode 100644 include/uapi/linux/rfdev.h



--
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 v4 1/4] mmc: dw_mmc: Invalidate cache of current_speed after suspend/resume

2013-08-12 Thread Seungwon Jeon
On Sat, August 10, 2013, Doug Anderson wrote:
> Seungwon and Jaehoon,
> 
> On Fri, Aug 9, 2013 at 6:32 AM, Seungwon Jeon  wrote:
> > On Wed, August 07, 2013, Doug Anderson wrote:
> >> The dw_mmc driver keeps a cache of the current slot->clock in order to
> >> avoid doing a whole lot of work every time set_ios() is called.
> >> However, after suspend/resume the register values are bogus so we need
> >> to ensure that the cached value is invalidated.
> > This mismatch comes only in case MMC_PM_KEEP_POWER, right?
> 
> Actually, no.  I saw problems with the SD Card slot, which doesn't
> have MMC_KEEP_POWER.  Problems showed up when no card was inserted
> across suspend/resume.  In other words:
> 
> 1. At boot time, slot is all setup and configured to 400kHz.
> 
> 2. Suspend
> 
> 3. Resume; clock registers are reset (by suspend/resume) and not
> restored since dw_mmc still thinks slot is configured for 400kHz due
> to host->current_speed cache.
> 
> 4. Insert card.
> 
> 5. No code sees any need to change the clock for detecting the card,
> since everyone thinks it's at 400kHz.  ...but it's not.

Doug, your analysis is right.
But, let me suggest another approach.
After step #1, core layer actually call mmc_power_off because slot is 
empthy(get_cd() is '0').
Then, set_ios is requested with 'ios->clock'.
However, because current implementation doesn't update current_speed in case 
ios->clock is '0'.
It causes current_speed has invalid clock rate in resume of dw-mmc.

So, if we can update slot->clock properly, it will be fixed.

-static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit)
+static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 {
struct dw_mci *host = slot->host;
u32 div;
u32 clk_en_a;

-   if (slot->clock != host->current_speed || force_clkinit) {
+   if (slot->clock && (slot->clock != host->current_speed)) {


@@ -807,13 +807,11 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct 
mmc_ios *ios)

mci_writel(slot->host, UHS_REG, regs);

-   if (ios->clock) {
-   /*
-* Use mirror of ios->clock to prevent race with mmc
-* core ios update when finding the minimum.
-*/
-   slot->clock = ios->clock;
-   }
+   /*
+* Use mirror of ios->clock to prevent race with mmc
+* core ios update when finding the minimum.
+*/
+   slot->clock = ios->clock;

Thanks,
Seungwon Jeon

> 
> 
> >> In many cases we got by without this since the core mmc code fiddles
> >> with the clock a lot.  If we've got a card present we're probably
> >> running it at something like 50MHz and the core will temporarily
> >> switch us to 400kHz after resume.  One case that didn't work (for me)
> >> is the case of having no card in the slot.  The slot is initted to
> >> 400kHz at boot time.  After suspend/resume the slot thinks it's still
> >> at 400kHz (due to the cache) so doesn't adjust timing.  When it tries
> >> to send the command at probe time it just times out and gets left in a
> >> bad state.
> > I understand this change although some part of commit message (boot time, 
> > probe time...) make me
> confused.
> 
> Sorry to be confusing.  I was trying to explain why the old code works
> fine in many cases.  It's because the core MMC code tends to adjust
> the clock a lot around suspend/resume.  When it does that, it works
> around this problem.  ...but I found one case where suspend/resume
> would happen and the MMC core didn't adjust the clock.
> 
> 
> > I guess this change intends to update clock programming forcedly.
> > It looks like another version of 'dw_mci_setup_bus(slot, true)'.
> > Eventually, this change does same?
> 
> Effectively, yes.  As Jaehoon points out, that means we can actually
> eliminate the "force" parameter to dw_mci_setup_bus().
> 
> 
> I will send a new version out that eliminates the "force" parameter
> and updates the commit message to (hopefully) be clearer.
> 
> -Doug
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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/


[PATCH v2 3/4] binding: Add device tree bindings for freescale AIC

2013-08-12 Thread akhil.goyal
From: Akhil Goyal 

For platforms like BSC9131 and BSC9132, a Radio framework for supporting
various network modes comprise of an Antenna interface controller driver
and a phy driver.
A combination of AIC lane and phy is called a rf device which can be used
to operate on a particular network mode.

This patch explain various device tree properties required for AIC driver

Signed-off-by: Akhil Goyal 
---
 Documentation/devicetree/bindings/rf/fsl-aic.txt |   47 ++
 1 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rf/fsl-aic.txt

diff --git a/Documentation/devicetree/bindings/rf/fsl-aic.txt 
b/Documentation/devicetree/bindings/rf/fsl-aic.txt
new file mode 100644
index 000..4f54a92
--- /dev/null
+++ b/Documentation/devicetree/bindings/rf/fsl-aic.txt
@@ -0,0 +1,47 @@
+Freescale Antenna Interface Controller
+
+AIC is the antenna interface controller found in bsc913x
+family of SOCs. It supports NCDMA, WCDMA-FDD, LTE-FDD, LTE-TDD
+and GSM-SNIFF network modes. AIC has multiple lanes on which RFICs
+can be connected. And AIC supports 4 RFICs working simultaneously.
+
+Required Properties:
+- #address-cells : should be 1
+- #size-cells : should be 1
+- compatible : should be fsl,bsc9131-aic or fsl,bsc9132-aic or both
+- reg : offset and length of common register set of AIC
+- interrupts : For AIC, first is capture complete interrupt
+   second is dsp general interrupt
+aic node can have multiple sub nodes of aiclanes for each lane.
+- aiclane : Required Properties
+   - reg : offset and length of common register set of AIC lane
+   - lane_id : it can be 0, 1, 2, 3, 4, 5
+   - interrupts : lane specific TTI interrupt line
+
+For Example:
+
+aic@5 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "fsl,bsc9131-aic", "fsl,bsc9132-aic";
+   reg = <0x5 0x200>;
+   interrupts = <49 2 0 0 53 2 0 0>;
+   lane0: aiclane@200 {
+   reg = <0x200 0x200>;
+   lane_id = <0>;
+   interrupts = <45 2 0 0>;
+   };
+
+   lane1: aiclane@400 {
+   reg = <0x400 0x200>;
+   lane_id = <1>;
+   interrupts = <46 2 0 0>;
+   };
+
+   lane2: aiclane@600 {
+   reg = <0x600 0x200>;
+   lane_id = <2>;
+   interrupts = <47 2 0 0>;
+   };
+};
+
-- 
1.6.3.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/


[PATCH v2 2/4] drivers/misc/rf: AIC: Freescale Antenna Interface controller driver

2013-08-12 Thread akhil.goyal
From: Akhil Goyal 

AIC is the antenna interface controller found in heterogenous SOCs-
BSC9131 and BSC9132. It supports NCDMA, WCDMA-FDD, LTE-FDD, LTE-TDD
and SNIFF network modes.
AIC has 6 data lanes in BSC9131 and 4 in BSC9132 on which RFICs
can be connected. AIC supports at max 4 RFICs working simultaneously.

The address mapping of AIC is a part of DSP side of SOC. But according
to the architecture of the system, configuration of this driver shall
be done from PA side.

This patch support LTE-FDD, LTE-TDD and WCDMA configurations for AIC.
The data from RFIC through AIC goes directly to a hardware accelerator
from where it is taken out by DSP core in bsc913x.

This patch also support sniffing of LTE-FDD networks and it can also
handle the data path of the sniffing data.

Signed-off-by: Pankaj Chauhan 
Signed-off-by: Shilan Deng 
Signed-off-by: Bhaskar Upadhaya 
Signed-off-by: Akhil Goyal 
---
 drivers/misc/rf/Kconfig   |   11 +
 drivers/misc/rf/Makefile  |1 +
 drivers/misc/rf/controllers/Makefile  |1 +
 drivers/misc/rf/controllers/fsl_aic.c | 1558 +
 drivers/misc/rf/controllers/fsl_aic.h |  450 ++
 5 files changed, 2021 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/rf/controllers/Makefile
 create mode 100644 drivers/misc/rf/controllers/fsl_aic.c
 create mode 100644 drivers/misc/rf/controllers/fsl_aic.h

diff --git a/drivers/misc/rf/Kconfig b/drivers/misc/rf/Kconfig
index 478cfd2..c14c200 100644
--- a/drivers/misc/rf/Kconfig
+++ b/drivers/misc/rf/Kconfig
@@ -17,3 +17,14 @@ menuconfig RFDEVICES
 
radio interface controller driver (Antenna controller) and RF PHY driver
connected to system must also be chosen.
+
+if RFDEVICES
+
+config FSL_AIC
+   default y
+   bool "Freescale Antenna Interface Controller (AIC)"
+   ---help---
+   Freescale AIC controller (Antenna Interface Controller) is found
+   in bsc913x family of SOCs. AIC has six RF lanes and maximum four
+   RF PHYs can be connected and operated simultaneously.
+endif
diff --git a/drivers/misc/rf/Makefile b/drivers/misc/rf/Makefile
index 566585e..37dc442 100644
--- a/drivers/misc/rf/Makefile
+++ b/drivers/misc/rf/Makefile
@@ -3,3 +3,4 @@
 #
 
 obj-$(CONFIG_RFDEVICES)+= core/
+obj-$(CONFIG_RFDEVICES)+= controllers/
diff --git a/drivers/misc/rf/controllers/Makefile 
b/drivers/misc/rf/controllers/Makefile
new file mode 100644
index 000..6578c3c
--- /dev/null
+++ b/drivers/misc/rf/controllers/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_FSL_AIC)  += fsl_aic.o
diff --git a/drivers/misc/rf/controllers/fsl_aic.c 
b/drivers/misc/rf/controllers/fsl_aic.c
new file mode 100644
index 000..cca6a7a
--- /dev/null
+++ b/drivers/misc/rf/controllers/fsl_aic.c
@@ -0,0 +1,1558 @@
+/*
+ * drivers/rf/controllers/fsl_aic.c
+ * Freescale AIC (Antenna Controller Interface) driver
+ *
+ * AIC is the antenna interface controller found in bsc913x
+ * family of SOCs. It supports NCDMA, WCDMA-FDD, LTE-FDD, LTE-TDD
+ * and GSM-SNIFF network modes. AIC has 6 lanes on which RFICs
+ * can be connected. And AIC supports 4 RFICs working simultaneously.
+ * This driver provides only configuration path for all other modes
+ * except SNIFF because data from RFIC through AIC goes directly
+ * to a hardware accelerator from where it is taken out by DSP core
+ * in bsc913x.
+ *
+ * Author: pankaj chauhan 
+ *
+ * Copyright 2011-2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "fsl_aic.h"
+
+static int aic_init(struct rf_ctrl_dev *rf_dev, struct rf_init_params *params);
+static int aic_timing_source(struct rf_ctrl_dev *rf_dev, unsigned int src);
+static int aic_read(struct rf_ctrl_dev *rf_dev, u32 addr, u32 count, u32 
*buff);
+static int aic_write(struct rf_ctrl_dev *rf_dev, u32 offset, u32 data);
+static int aic_phy_detached(struct rf_ctrl_dev *rf_dev);
+static int aic_start(struct rf_ctrl_dev *rf_dev);
+static int aic_stop(struct rf_ctrl_dev *rf_dev);
+static int aic_config_sniff(struct rf_ctrl_dev *rf_dev,
+   struct rf_sniff_params *sniff_params);
+
+static int aic_start_sniffer(struct aic_sniffer *sniffer);
+static void aic_free_sniffer(struct aic_sniffer *sniffer);
+static irqreturn_t aic_isr(int irq, void *arg);
+static int aic_channel_open(struct rf_ctrl_dev *rf_dev,
+   struct rf_channel *chan);
+static int aic_channel_close(struct rf_ctrl_dev *rf_dev,
+   struct rf_channel *chan);
+
+static struct rf_ctrl_ops aic_rfops = {
+   .init = aic_init,
+   .set_timing_source = aic_timing_source,
+   .r

[PATCH v2 4/4] BSC9131rdb/dts: Add nodes for supporting AIC

2013-08-12 Thread akhil.goyal
From: Akhil Goyal 

BSC9131 is a hetrogenous system where Antenna interface controller
(AIC) is a part of DSP subsystem. But its configuration is done from
PA side. So a DSP node is added with appropriate CCSR address visible
to PA and hence the address space for AIC will be visible to PA.

BSC9131 support 3 AIC lanes for ADI interface and 3 for MAXIM type of
interface. This patch support only ADI lanes.

Signed-off-by: Pankaj Chauhan 
Signed-off-by: Shaveta Leekha 
Signed-off-by: Bhaskar Upadhaya 
Signed-off-by: Akhil Goyal 
---
 arch/powerpc/boot/dts/bsc9131rdb.dts  |4 ++
 arch/powerpc/boot/dts/fsl/bsc9131si-post.dtsi |   38 +
 2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/bsc9131rdb.dts 
b/arch/powerpc/boot/dts/bsc9131rdb.dts
index e13d2d4..c134de7 100644
--- a/arch/powerpc/boot/dts/bsc9131rdb.dts
+++ b/arch/powerpc/boot/dts/bsc9131rdb.dts
@@ -28,6 +28,10 @@
board_soc: soc: soc@ff70 {
ranges = <0x0 0x0 0xff70 0x10>;
};
+
+   dsp_soc: sc3850@ff60 {
+   ranges = <0x0 0x0 0xff60 0x10>;
+   };
 };
 
 /include/ "bsc9131rdb.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/bsc9131si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/bsc9131si-post.dtsi
index 5180d9d..487e949 100644
--- a/arch/powerpc/boot/dts/fsl/bsc9131si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/bsc9131si-post.dtsi
@@ -191,3 +191,41 @@ global-utilities@e {
fsl,has-rstcr;
};
 };
+
+&dsp_soc {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "simple-bus";
+   gcr@18000 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "fsl,bsc9131-gcr", "fsl,bsc9132-gcr";
+   reg = <0x18000 0x200>;
+   };
+   aic@5 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "fsl,bsc9131-aic", "fsl,bsc9132-aic";
+   reg = <0x5 0x200>;
+   interrupts = <49 2 0 0 53 2 0 0>;
+   lane0: aiclane@200 {
+   reg = <0x200 0x200>;
+   lane_id = <0>;
+   interrupts = <45 2 0 0>;
+   };
+
+   lane1: aiclane@400 {
+   reg = <0x400 0x200>;
+   lane_id = <1>;
+   interrupts = <46 2 0 0>;
+   };
+
+   lane2: aiclane@600 {
+   reg = <0x600 0x200>;
+   lane_id = <2>;
+   interrupts = <47 2 0 0>;
+   };
+   };
+};
+
+
-- 
1.6.3.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 v3 01/12] dma: edma: Setup parameters to DMA MAX_NR_SG at a time

2013-08-12 Thread Sekhar Nori
On Monday 05 August 2013 09:44 PM, Joel Fernandes wrote:
> Changes are made here for configuring existing parameters to support
> DMA'ing them out in batches as needed.
> 
> Also allocate as many as slots as needed by the SG list, but not more
> than MAX_NR_SG. Then these slots will be reused accordingly.
> For ex, if MAX_NR_SG=10, and number of SG entries is 40, still only
> 10 slots will be allocated to DMA the entire SG list of size 40.
> 
> Signed-off-by: Joel Fernandes 
> ---
>  drivers/dma/edma.c |   14 +++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 5f3e532..7b0853c 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -222,9 +222,9 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
>   enum dma_slave_buswidth dev_width;
>   u32 burst;
>   struct scatterlist *sg;
> - int i;
>   int acnt, bcnt, ccnt, src, dst, cidx;
>   int src_bidx, dst_bidx, src_cidx, dst_cidx;
> + int i, num_slots_needed;

'nslots' is more to my liking. Better keep variable names short.

>  
>   if (unlikely(!echan || !sgl || !sg_len))
>   return NULL;
> @@ -262,8 +262,11 @@ static struct dma_async_tx_descriptor 
> *edma_prep_slave_sg(
>  
>   edesc->pset_nr = sg_len;
>  
> - for_each_sg(sgl, sg, sg_len, i) {
> - /* Allocate a PaRAM slot, if needed */
> + /* Allocate a PaRAM slot, if needed */
> +
> + num_slots_needed = sg_len > MAX_NR_SG ? MAX_NR_SG : sg_len;

nslots = min(MAX_NR_SG, sg_len);

> +
> + for (i = 0; i < num_slots_needed; i++) {
>   if (echan->slot[i] < 0) {
>   echan->slot[i] =
>   edma_alloc_slot(EDMA_CTLR(echan->ch_num),
> @@ -273,6 +276,10 @@ static struct dma_async_tx_descriptor 
> *edma_prep_slave_sg(
>   return NULL;
>   }
>   }
> + }
> +
> + /* Configure PaRAM sets for each SG */
> + for_each_sg(sgl, sg, sg_len, i) {
>  
>   acnt = dev_width;
>  
> @@ -330,6 +337,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
>   /* Configure A or AB synchronized transfers */
>   if (edesc->absync)
>   edesc->pset[i].opt |= SYNCDIM;
> +

Random extra newline.

The patch as such is fine, but I dont think it makes lot of sense
standalone. This needs to be merged into the patch where you actually
handle the entire SG list in batches.

Thanks,
Sekhar

--
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 03/12] dma: edma: remove limits on number of slots

2013-08-12 Thread Sekhar Nori
On Monday 05 August 2013 09:44 PM, Joel Fernandes wrote:
> With this series, this check is no longer required and
> we shouldn't need to reject drivers DMA'ing more than the
> MAX number of slots.
> 
> Signed-off-by: Joel Fernandes 
> ---
>  drivers/dma/edma.c |6 --
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 7b0853c..b6d609c 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -247,12 +247,6 @@ static struct dma_async_tx_descriptor 
> *edma_prep_slave_sg(
>   return NULL;
>   }
>  
> - if (sg_len > MAX_NR_SG) {
> - dev_err(dev, "Exceeded max SG segments %d > %d\n",
> - sg_len, MAX_NR_SG);
> - return NULL;
> - }

This patch comes too early. Should be moved to the end of the series
when the support you rely on is actually present.

Thanks,
Sekhar

--
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 v4 3/4] mmc: dw_mmc: Always setup the bus after suspend/resume

2013-08-12 Thread Seungwon Jeon
On Sat, August 10, 2013,Doug Anderson wrote:
> Seungwon,
> 
> On Fri, Aug 9, 2013 at 6:35 AM, Seungwon Jeon  wrote:
> > On Wed, August 07, 2013, Doug Anderson wrote:
> >> After suspend/resume all of the dw_mmc registers are reset to
> >> defaults.  We restore most of them, but specifically don't setup the
> >> clock registers after resume unless we've got a powered card.  Things
> >> still work because the core will eventually call set_ios() and we'll
> >> set things up.
> >
> > Hmm, I didn't get the need of this call during resume.
> > I think set_ios is only valid where core layer calls.
> > Besides, important things is ios's parameters.
> > If suspend has finished successfully, last call of set_ios() is from 
> > mmc_power_off().
> > On seeing fields of 'mmc->ios' stored last, these values aren't proper in 
> > resume phase.
> > Please check mmc_power_off() function.
> > In case MMC_PM_KEEP_POWER it could be kept.
> 
> Most of my reasoning has to do with the fact that the state of the
> system after suspend/resume should not be significantly different than
> the state of the system before suspend/resume.  If the state of the
> system is different in the two cases it points out potential problems
> or inefficiencies.
> 
> To make this more concrete:
> 
> 1. Boot up a system with no card in the SD Card slot.
> 2. Note down the value of registers like CLKDIV, CLKENA, etc.
> 3. Suspend / resume (S2R)
> 4. Check the values of CLKDIV, CLKENA, etc.
> 
> You will notice that they are different.  This is a bad sign and can
> be a source of bugs (though I don't know of any).  ...or it could mean
> that power draw is different (could be better, could be worse) after a
> suspend/resume cycle.
> 
> 
> Said another way, if the value of CLKDIV, CLKENA, etc is not important
> when a card is not inserted, why do they get initialized at boot time?
> 
> 
> In general, I think that the mmc core code makes the assumption that
> it's up to the driver to make sure that its state is preserved across
> S2R.  For dw_mmc the driver doesn't do the "brute force" that some
> drivers do of just saving and restoring all registers using a copy
> loop.  Instead, the dw_mmc driver runs code that tries to set the
> state back to something reasonable.  Without my patch the dw_mmc
> driver doesn't run any code that restores these registers.
> dw_mci_set_ios() will do so.

This seems pretty associated with [1/4 patch]. (Anyway continued, ...)
Basically, both CLKDIV and CLKENA will be set with the reset value of zero. 
This means clock is disabled.
While resume of dw_mmc is completed, initial configuration registers will be 
set except for runtime registers.
I think registers related to clock are close to runtime.
Core layer knows the correct clock rate for current device mode and will 
actually request it by set_ios.
If core layer requests set_ios no more after dw_mmc resume is completed, dw_mmc 
will keep the clock to be disabled.
Then, dw_mmc doesn't need self call of dw_mci_set_ios.

Thanks,
Seungwon Jeon
> 
> Another option would be to forcibly save/restore registers in suspend/resume.
> 
> -Doug

--
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 v5 2/4] mmc: dw_mmc: Add exynos resume_noirq callback to clear WAKEUP_INT

2013-08-12 Thread Seungwon Jeon
Doug,
Looks good to me except for minor comment.

On Sat, August 10, 2013, Doug Anderson wrote:
> If the WAKEUP_INT is asserted at wakeup and not cleared, we'll end up
> looping around forever.  This has been seen to happen on exynos5420
> silicon despite the fact that we haven't enabled any wakeup events due
> to a silicon errata.  It is safe to do on all exynos variants.
> 
> Signed-off-by: Doug Anderson 
> ---
> Changes in v5:
> - Cleaned up dw_mci_exynos_resume_noirq() comment as per Seungwon.
> - Don't memcpy dev_pm_ops structure, define a new one.
> 
> Changes in v4:
> - Take Seungwon's suggestion and don't add any dw_mmc-pltfm code.
> 
> Changes in v3:
> - Add freeze/thaw and poweroff/restore noirq entries.
> 
> Changes in v2:
> - Use suspend_noirq as per James Hogan.
> 
>  drivers/mmc/host/dw_mmc-exynos.c | 56 
> +++-
>  1 file changed, 55 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc-exynos.c 
> b/drivers/mmc/host/dw_mmc-exynos.c
> index 866edef..7d88583 100644
> --- a/drivers/mmc/host/dw_mmc-exynos.c
> +++ b/drivers/mmc/host/dw_mmc-exynos.c
> @@ -30,6 +30,7 @@
>  #define SDMMC_CLKSEL_TIMING(x, y, z) (SDMMC_CLKSEL_CCLK_SAMPLE(x) |  \
>   SDMMC_CLKSEL_CCLK_DRIVE(y) |\
>   SDMMC_CLKSEL_CCLK_DIVIDER(z))
> +#define SDMMC_CLKSEL_WAKEUP_INT  BIT(11)
> 
>  #define EXYNOS4210_FIXED_CIU_CLK_DIV 2
>  #define EXYNOS4412_FIXED_CIU_CLK_DIV 4
> @@ -100,6 +101,52 @@ static int dw_mci_exynos_setup_clock(struct dw_mci *host)
>   return 0;
>  }
> 
> +#ifdef CONFIG_PM_SLEEP
> +/*
> + * TODO: we should probably disable the clock to the card in the suspend 
> path.
In suspend, clock is gated, isn't it?
Rather, no comment looks better, if intention is not clear.

Thanks,
Seungwon Jeon

> + */
> +static int dw_mci_exynos_suspend(struct device *dev)
> +{
> + struct dw_mci *host = dev_get_drvdata(dev);
> +
> + return dw_mci_suspend(host);
> +}
> +
> +static int dw_mci_exynos_resume(struct device *dev)
> +{
> + struct dw_mci *host = dev_get_drvdata(dev);
> +
> + return dw_mci_resume(host);
> +}
> +
> +/**
> + * dw_mci_exynos_resume_noirq - Exynos-specific resume code
> + *
> + * On exynos5420 there is a silicon errata that will sometimes leave the
> + * WAKEUP_INT bit in the CLKSEL register asserted.  This bit is 1 to indicate
> + * that it fired and we can clear it by writing a 1 back.  Clear it to 
> prevent
> + * interrupts from going off constantly.
> + *
> + * We run this code on all exynos variants because it doesn't hurt.
> + */
> +
> +static int dw_mci_exynos_resume_noirq(struct device *dev)
> +{
> + struct dw_mci *host = dev_get_drvdata(dev);
> + u32 clksel;
> +
> + clksel = mci_readl(host, CLKSEL);
> + if (clksel & SDMMC_CLKSEL_WAKEUP_INT)
> + mci_writel(host, CLKSEL, clksel);
> +
> + return 0;
> +}
> +#else
> +#define dw_mci_exynos_suspendNULL
> +#define dw_mci_exynos_resume NULL
> +#define dw_mci_exynos_resume_noirq   NULL
> +#endif /* CONFIG_PM_SLEEP */
> +
>  static void dw_mci_exynos_prepare_command(struct dw_mci *host, u32 *cmdr)
>  {
>   /*
> @@ -187,13 +234,20 @@ static int dw_mci_exynos_probe(struct platform_device 
> *pdev)
>   return dw_mci_pltfm_register(pdev, drv_data);
>  }
> 
> +const struct dev_pm_ops dw_mci_exynos_pmops = {
> + SET_SYSTEM_SLEEP_PM_OPS(dw_mci_exynos_suspend, dw_mci_exynos_resume)
> + .resume_noirq = dw_mci_exynos_resume_noirq,
> + .thaw_noirq = dw_mci_exynos_resume_noirq,
> + .restore_noirq = dw_mci_exynos_resume_noirq,
> +};
> +
>  static struct platform_driver dw_mci_exynos_pltfm_driver = {
>   .probe  = dw_mci_exynos_probe,
>   .remove = __exit_p(dw_mci_pltfm_remove),
>   .driver = {
>   .name   = "dwmmc_exynos",
>   .of_match_table = dw_mci_exynos_match,
> - .pm = &dw_mci_pltfm_pmops,
> + .pm = &dw_mci_exynos_pmops,
>   },
>  };
> 
> --
> 1.8.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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: linux-next: build failure after merge of the akpm-current tree

2013-08-12 Thread Michal Hocko
On Mon 12-08-13 16:09:11, Stephen Rothwell wrote:
> [Just adding some missed ccs]
> 
> On Mon, 12 Aug 2013 16:07:33 +1000 Stephen Rothwell  
> wrote:
> >
> > Hi Andrew,
> > 
> > After merging the akpm-current tree, today's linux-next build
> > (x86_64 allmodconfig) failed like this:
> > 
> > mm/memcontrol.c: In function '__mem_cgroup_iter_next':
> > mm/memcontrol.c:982:4: error: 'prev_cgroup' undeclared (first use in this 
> > function)
> > prev_cgroup = next_cgroup;
> > ^
> > mm/memcontrol.c:982:18: error: 'next_cgroup' undeclared (first use in this 
> > function)
> > prev_cgroup = next_cgroup;
> >   ^
> > 
> > I applied this patch:

Yes it looks good. Sorry, I have missed it when sending merge
resolution.

Thanks for the fixup.

> > From: Stephen Rothwell 
> > Date: Mon, 12 Aug 2013 16:04:36 +1000
> > Subject: [PATCH] memcontrol: further merge fix patch
> > 
> > Signed-off-by: Stephen Rothwell 
> > ---
> >  mm/memcontrol.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 624d69e..a367145 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -979,7 +979,7 @@ skip_node:
> >  
> > switch (mem_cgroup_filter(mem, root, cond)) {
> > case SKIP:
> > -   prev_cgroup = next_cgroup;
> > +   prev_css = next_css;
> > goto skip_node;
> > case SKIP_TREE:
> > if (mem == root)
> > @@ -998,7 +998,7 @@ skip_node:
> > if (css_tryget(&mem->css))
> > return mem;
> > else {
> > -   prev_cgroup = next_cgroup;
> > +   prev_css = next_css;
> > goto skip_node;
> > }
> > break;
> > -- 
> > 1.8.4.rc0
> 
> -- 
> Cheers,
> Stephen Rothwells...@canb.auug.org.au



-- 
Michal Hocko
SUSE Labs
--
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 11/44] cpufreq: at32ap: Use generic cpufreq routines

2013-08-12 Thread Hans-Christian Egtvedt
Around Mon 12 Aug 2013 12:43:37 +0530 or thereabout, Viresh Kumar wrote:
> On 12 August 2013 12:40, Hans-Christian Egtvedt  wrote:
>> Ok, AVR32 driver should expose a frequency table then, which is quite simple.
> 
> It would be really nice if you can provide that patch, that will make
> my life simple :)
> 
> I thought I can get a table for it but wasn't able to find out
> necessary information
> for that.

I'll add it on my todo-list and have a look at it in the evening (-:

How hard can it be™

-- 
mvh
Hans-Christian Egtvedt
--
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 08/35] cpufreq: cpufreq-cpu0: use cpufreq_table_validate_and_show()

2013-08-12 Thread Shawn Guo
On Thu, Aug 08, 2013 at 07:18:10PM +0530, Viresh Kumar wrote:
> Lets use cpufreq_table_validate_and_show() instead of calling
> cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
> 
> Cc: Shawn Guo 
> Signed-off-by: Viresh Kumar 

I'm not copied on the patch that introduces function
cpufreq_table_validate_and_show().  So if it does the right/equivalent
thing, for cpufreq-cpu0 and imx6q-cpufreq:

Acked-by: Shawn Guo 

--
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] N900: add device tree

2013-08-12 Thread Tony Lindgren
* Jiri Kosina  [130810 13:36]:
> On Sat, 10 Aug 2013, Pavel Machek wrote:
> 
> > [I wonder if this is clean-enough cause for "trivial in resubmit
> > mode?]
> 
> On Sat, 10 Aug 2013, Belisko Marek wrote:
> 
> > Same for gta04 (omap3 based device) [1].
> > It was send upstream 2 times and second time there is no reply from 
> > 1.3.2013.
> 
> Hi guys,
> 
> once I am able to match signoffs in the patches to MAINTAINERS, I can take 
> those through trivial.git in "re-transmission mode" (or feeeding those 
> thgough akpm si an option as well).
> 
> Please just send the patches to me in a new thread properly with all the 
> Acks/Signoffs, and mark those appropriately (i.e. maintainer that would 
> normally push this upstream desurfaced).

Sorry for the delays, I think Benoit is still on vacation. Plus the
non-functioning email address issue certainly does not help..

Anyways, let's just let Benoit queue these to avoid pointless merge
conflicts with the .dts files as discussed several times earlier.

Regards,

Tony
--
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] N900: add device tree

2013-08-12 Thread Tony Lindgren
* Pavel Machek  [130811 06:54]:
> Hi!
> 
> > >> [I wonder if this is clean-enough cause for "trivial in resubmit
> > >> mode?]
> > >
> > > On Sat, 10 Aug 2013, Belisko Marek wrote:
> > >
> > >> Same for gta04 (omap3 based device) [1].
> > >> It was send upstream 2 times and second time there is no reply from 
> > >> 1.3.2013.
> > >
> > > Hi guys,
> > >
> > > once I am able to match signoffs in the patches to MAINTAINERS, I can take
> > > those through trivial.git in "re-transmission mode" (or feeeding those
> > > thgough akpm si an option as well).
> > >
> > > Please just send the patches to me in a new thread properly with all the
> > > Acks/Signoffs, and mark those appropriately (i.e. maintainer that would
> > > normally push this upstream desurfaced).
> > 
> > I noticed that you are using Benoit older emails address
> > (b-cous...@ti.com) which no longer exists instead of his new email
> > address (benoit.cous...@linaro.org). So, it may be possible that
> > Benoit have not even been getting your patches.
> 
> Thanks for update.
> 
> > I'll send a patch to MAINTAINERS updating Benoit's email address so
> > get_maintainer.pl will stop lying.
> 
> Thanks!
> 
> Benoit, could you take a look at the patch from this thread? I can
> resend it, but it should be in pretty much _all_ the webmail archives
> now :-).

Hopefully Benoit will be back online after vacation soon :)

Regaqrds,

Tony
--
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 11/44] cpufreq: at32ap: Use generic cpufreq routines

2013-08-12 Thread Viresh Kumar
On 12 August 2013 13:00, Hans-Christian Egtvedt  wrote:
> I'll add it on my todo-list and have a look at it in the evening (-:

Thanks.

> How hard can it be™

Its not about being hard but about knowing your platform well..
--
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] i2c-designware: make *CNT values configurable

2013-08-12 Thread Christian Ruppert
On Mon, Aug 05, 2013 at 12:02:26PM +0200, Wolfram Sang wrote:
> 
> > > >Would it make sense to add generic I2C device tree properties for those
> > > >parameters? These parameters are independent of the actual bus driver,
> > > >rather a PCB property... And as such the correct place would be device
> > > >tree or ACPI or similar.
> > > 
> > > If there are other bus drivers that make use of tr/tf transition
> > > times, I think it makes sense.
> > 
> > Wolfram, what's your opinion on this?
> 
> If it is a PCB property, it makes sense to have generic bindings for
> it. Can they have very-safe defaults and thus be optional?

We can definitely have safe defaults that work for a given
driver/hardware. I don't think the same defaults would be safe for all
drivers/hardware: The timing strategies of different I2C hardware seems
to vary widely (which edges of the clock are sampled, how does different
hardware deal with hold times etc) and depending on which parameters are
available to the driver to control these timings, the safe values would
either have to be the minimum or the maximum in the range allowed by the
I2C specification.
Every driver would thus have to implement its own defaults in case the
properties are not defined.

  Christian


pgph8IgAHxQ3L.pgp
Description: PGP signature


Re: [PATCH 08/35] cpufreq: cpufreq-cpu0: use cpufreq_table_validate_and_show()

2013-08-12 Thread Viresh Kumar
On 12 August 2013 13:05, Shawn Guo  wrote:
> On Thu, Aug 08, 2013 at 07:18:10PM +0530, Viresh Kumar wrote:
>> Lets use cpufreq_table_validate_and_show() instead of calling
>> cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().
>>
>> Cc: Shawn Guo 
>> Signed-off-by: Viresh Kumar 
>
> I'm not copied on the patch that introduces function
> cpufreq_table_validate_and_show().  So if it does the right/equivalent
> thing, for cpufreq-cpu0 and imx6q-cpufreq:

You better check it :)

https://lkml.org/lkml/2013/8/8/266

I wasn't probably following the right way for sending mails as I was expecting
people to look at these patches over list..

In the next series with 44 patch I tried to fix this issue. And so cc'd people
on cover-letter and the important patch they must check.

> Acked-by: Shawn Guo 

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/


[PATCH 1/2] f2fs: check the free space first in new_node_page

2013-08-12 Thread Jaegeuk Kim
Let's check the free space in prior to the main process of allocating a new node
page.

Signed-off-by: Jaegeuk Kim 
---
 fs/f2fs/node.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index bb8fbda..858a333 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -833,29 +833,29 @@ struct page *new_node_page(struct dnode_of_data *dn,
if (!page)
return ERR_PTR(-ENOMEM);
 
-   get_node_info(sbi, dn->nid, &old_ni);
+   if (!inc_valid_node_count(sbi, dn->inode, 1)) {
+   err = -ENOSPC;
+   goto fail;
+   }
 
-   SetPageUptodate(page);
-   fill_node_footer(page, dn->nid, dn->inode->i_ino, ofs, true);
+   get_node_info(sbi, dn->nid, &old_ni);
 
/* Reinitialize old_ni with new node page */
BUG_ON(old_ni.blk_addr != NULL_ADDR);
new_ni = old_ni;
new_ni.ino = dn->inode->i_ino;
-
-   if (!inc_valid_node_count(sbi, dn->inode, 1)) {
-   err = -ENOSPC;
-   goto fail;
-   }
set_node_addr(sbi, &new_ni, NEW_ADDR);
+
+   fill_node_footer(page, dn->nid, dn->inode->i_ino, ofs, true);
set_cold_node(dn->inode, page);
+   SetPageUptodate(page);
+   set_page_dirty(page);
 
dn->node_page = page;
if (ipage)
update_inode(dn->inode, ipage);
else
sync_inode_page(dn);
-   set_page_dirty(page);
if (ofs == 0)
inc_valid_inode_count(sbi);
 
-- 
1.8.3.1.437.g0dbd812

--
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 13/44] cpufreq: cpu0: Use generic cpufreq routines

2013-08-12 Thread Shawn Guo
On Sat, Aug 10, 2013 at 12:14:09PM +0530, Viresh Kumar wrote:
> Most of the CPUFreq drivers do similar things in .exit() and .verify() 
> routines
> and .attr. So its better if we have generic routines for them which can be 
> used
> by cpufreq drivers then.
> 
> This patch uses these generic routines for this driver.
> 
> Cc: Shawn Guo 
> Signed-off-by: Viresh Kumar 

Acked-by: Shawn Guo 

--
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 2/2] f2fs: should cover i_xattr_nid with its xattr node page lock

2013-08-12 Thread Jaegeuk Kim
Previously, f2fs_setxattr assigns i_xattr_nid in the inode page inconsistently.

The scenario is:

= Thread 1 = = Thread 2 = = fi->i_xattr_nid =  = on-disk nid =

f2fs_setxattr   0 0
  new_node_page X 0
   sync_inode_page  X X
   checkpoint   X X -.
grab_cache_page X X  |
--> allocate a new xattr node block or -ENOSPC  <'

At this moment, the checkpoint stores inconsistent data where the inode has
i_xattr_nid but actual xattr node block is not allocated yet.

So, we should assign the real i_xattr_nid only after its xattr node block is
allocated.

Signed-off-by: Jaegeuk Kim 
---
 fs/f2fs/node.c  |  3 +++
 fs/f2fs/xattr.c | 10 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 858a333..1c21344 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -851,6 +851,9 @@ struct page *new_node_page(struct dnode_of_data *dn,
SetPageUptodate(page);
set_page_dirty(page);
 
+   if (ofs == XATTR_NODE_OFFSET)
+   F2FS_I(dn->inode)->i_xattr_nid = dn->nid;
+
dn->node_page = page;
if (ipage)
update_inode(dn->inode, ipage);
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index fb16f71..3bc307c 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -378,23 +378,23 @@ int f2fs_setxattr(struct inode *inode, int name_index, 
const char *name,
if (!fi->i_xattr_nid) {
/* Allocate new attribute block */
struct dnode_of_data dn;
+   nid_t new_nid;
 
-   if (!alloc_nid(sbi, &fi->i_xattr_nid)) {
+   if (!alloc_nid(sbi, &new_nid)) {
error = -ENOSPC;
goto exit;
}
-   set_new_dnode(&dn, inode, NULL, NULL, fi->i_xattr_nid);
+   set_new_dnode(&dn, inode, NULL, NULL, new_nid);
mark_inode_dirty(inode);
 
page = new_node_page(&dn, XATTR_NODE_OFFSET, ipage);
if (IS_ERR(page)) {
-   alloc_nid_failed(sbi, fi->i_xattr_nid);
-   fi->i_xattr_nid = 0;
+   alloc_nid_failed(sbi, new_nid);
error = PTR_ERR(page);
goto exit;
}
 
-   alloc_nid_done(sbi, fi->i_xattr_nid);
+   alloc_nid_done(sbi, new_nid);
base_addr = page_address(page);
header = XATTR_HDR(base_addr);
header->h_magic = cpu_to_le32(F2FS_XATTR_MAGIC);
-- 
1.8.3.1.437.g0dbd812

--
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/44] cpufreq: imx6q: Use generic cpufreq routines

2013-08-12 Thread Shawn Guo
On Sat, Aug 10, 2013 at 12:14:17PM +0530, Viresh Kumar wrote:
> Most of the CPUFreq drivers do similar things in .exit() and .verify() 
> routines
> and .attr. So its better if we have generic routines for them which can be 
> used
> by cpufreq drivers then.
> 
> This patch uses these generic routines for this driver.
> 
> Cc: Shawn Guo 
> Signed-off-by: Viresh Kumar 

Shawn Guo 

--
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/


Reproducible data corruption since 3.7.x on i5-3340M machines

2013-08-12 Thread Ben Tebulin
Shameless self-bump: Since kernel 3.7.x i can reproduce a sporadic data
corruption using git on 2 different machine (same model, though).

Can anybody give me a hint who can help to trace down/fix this regression?

For more information please refer to my first post on Friday.

Sorry to bother again, but I have no clue where to ask elsewhere.
--
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/44] cpufreq: imx6q: Use generic cpufreq routines

2013-08-12 Thread Viresh Kumar
On 12 August 2013 13:28, Shawn Guo  wrote:
> On Sat, Aug 10, 2013 at 12:14:17PM +0530, Viresh Kumar wrote:
>> Most of the CPUFreq drivers do similar things in .exit() and .verify() 
>> routines
>> and .attr. So its better if we have generic routines for them which can be 
>> used
>> by cpufreq drivers then.
>>
>> This patch uses these generic routines for this driver.
>>
>> Cc: Shawn Guo 
>> Signed-off-by: Viresh Kumar 
>
> Shawn Guo 

I assume you meant an Ack here :)
--
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 01/10] irqchip: GIC: Add Cortex-A7 compatible string

2013-08-12 Thread Maxime Ripard
Hi Thomas,

On Sun, Aug 04, 2013 at 11:47:28AM +0200, Maxime Ripard wrote:
> The GIC can also be found on Cortex-A7 based SoCs. Register a new
> compatible string for those cases.

I'd like this set to go in 3.12, could you review/merge this patch?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [ANNOUNCE] 3.10.4-rt1

2013-08-12 Thread Sebastian Andrzej Siewior
* Paul Gortmaker | 2013-08-02 10:19:36 [-0400]:

>The list of donor victims that aren't used in asm is getting
>smaller, but TIF_POLLING_NRFLAG seems OK and it puts RESCHED
>and RESCHED_LAZY right beside each other.

Applied & merged into the original patch. Thanks.

>Thanks guys,
>Paul.

Sebastian
--
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 02/10] clk: sunxi: fix initialization of basic clocks

2013-08-12 Thread Maxime Ripard
Hi Mike,

On Sun, Aug 04, 2013 at 11:47:29AM +0200, Maxime Ripard wrote:
> From: Emilio López 
> 
> With the recent move towards CLK_OF_DECLARE(...), the driver stopped
> initializing osc32k, which is compatible "fixed-clock". This is because
> we never called of_clk_init(NULL). Fix this by moving the only other
> simple clock (osc24M) to use CLK_OF_DECLARE(...) and call of_clk_init(NULL)
> to initialize both of them.

I'd like this patch to go in 3.12, and I need it to merge quite a few
other patches. Could you either review or merge it?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [GIT PULL 00/47] perf/core improvements and fixes

2013-08-12 Thread Ingo Molnar

* Arnaldo Carvalho de Melo  wrote:

> From: Arnaldo Carvalho de Melo 
> 
> Hi Ingo,
> 
>   Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 93786a5f6aeb9c032c1c240246c5aabcf457b38f:
> 
>   watchdog: Make it work under full dynticks (2013-07-30 22:29:15 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux 
> tags/perf-core-for-mingo
> 
> for you to fetch changes up to cecb977e24da1465cdb0ff2d10d22e5891dc3e6c:
> 
>   Revert "tools lib lk: Fix for cross build" (2013-08-07 17:35:41 -0300)
> 
> 
> perf/core improvements and fixes:
> 
> . Do annotation using /proc/kcore and /proc/kallsyms, removing the
>   need for a vmlinux file kernel assembly annotation. This also improves
>   this use case because vmlinux has just the initial kernel image, not
>   what is actually in use after various code patchings by things like
>   alternatives, etc. From Adrian Hunter.
> 
> . Various improvements and fixes to the "vmlinux matches kallsyms" 'perf test'
>   entry, related to the /proc/kcore annotation feature.
> 
> . Add --initial-delay option to 'perf stat' to skip measuring for
>   the startup phase, from Andi Kleen.
> 
> . perf kvm stat live mode, that combines aspects of 'perf kvm stat' record and
>   report, from David Ahern.
> 
> . Add option to analyze specific VM in perf kvm stat report, from David Ahern.
> 
> . Do not require /lib/modules/* on a guest, fix from Jason Wessel.
> 
> . Group leader sampling, that allows just one event in a group to sample while
>   the other events have just its values read, from Jiri Olsa.
> 
> . Add support for a new modifier "D", which requests that the event, or group
>   of events, be pinned to the PMU, from Michael Ellerman.
> 
> . Fix segmentation fault on the gtk browser, from Namhyung Kim.
> 
> Signed-off-by: Arnaldo Carvalho de Melo 
> 
> 
> Adrian Hunter (13):
>   perf symbols: avoid SyS kernel syscall aliases
>   perf tests: Add test for reading object code
>   perf symbols: Load kernel maps before using
>   perf tools: Make it possible to read object code from vmlinux
>   perf tests: Adjust the vmlinux symtab matches kallsyms test
>   perf tools: Make it possible to read object code from kernel modules
>   perf symbols: Add support for reading from /proc/kcore
>   perf tests: Adjust the vmlinux symtab matches kallsyms test again
>   perf tests: Add kcore to the object code reading test
>   perf annotate: Allow disassembly using /proc/kcore
>   perf annotate: Put dso name in symbol annotation title
>   perf annotate: Remove nop at end of annotation
>   perf annotate: Add call target name if it is missing
> 
> Andi Kleen (4):
>   perf evlist: Remove obsolete dummy execve
>   perf evsel: Add support for enabling counters
>   perf stat: Add support for --initial-delay option
>   perf stat: Flush output after each line in interval mode
> 
> Arnaldo Carvalho de Melo (3):
>   perf trace: Beautify 'connect' result
>   perf python: Remove duplicate TID bit from mask
>   perf annotate browser: Improve description of '?' hotkey
> 
> David Ahern (10):
>   perf evsel: Actually show symbol offset in stack trace when requested
>   perf tools: Fix compile of util/tsc.c
>   perf top: move CONSOLE_CLEAR to header file
>   perf stats: Add max and min stats
>   perf session: Export a few functions for event processing
>   perf kvm: Split out tracepoints from record args
>   perf session: Export queue_event function
>   perf kvm: Add live mode
>   perf kvm: Add min and max stats to display
>   perf kvm stat report: Add option to analyze specific VM
> 
> Ingo Molnar (1):
>   perf annotate browser: Fix typo
> 
> Jason Wessel (1):
>   perf machine: Do not require /lib/modules/* on a guest
> 
> Jiri Olsa (10):
>   perf: Add PERF_EVENT_IOC_ID ioctl to return event ID
>   perf: Do not get values from disabled counters in group format read
>   perf evlist: Use PERF_EVENT_IOC_ID perf ioctl to read event id
>   perf tools: Add support for parsing PERF_SAMPLE_READ sample type
>   perf evlist: Fix event ID retrieval for group format read case
>   perf evlist: Add perf_evlist__id2sid method to get event ID related data
>   perf evsel: Add PERF_SAMPLE_READ sample related processing
>   perf tools: Add 'S' event/group modifier to read sample value
>   perf tests: Add attr record group sampling test
>   perf tests: Add parse events tests for leader sampling
> 
> Joonsoo Kim (1):
>   Revert "tools lib lk: Fix for cross build"
> 
> Michael Ellerman (2):
>   perf tools: Add support for pinned modifier
>   perf tests: Add tests of new pinned modifier
> 
> Namhyung Kim (2):
>   perf util: Add parse_nsec_time(

Re: [PATCHv3 07/10] pinctrl: sunxi: Add Allwinner A31 pins set

2013-08-12 Thread Maxime Ripard
Hi Linus,

On Sun, Aug 04, 2013 at 11:47:34AM +0200, Maxime Ripard wrote:
> The Allwinner A31 SoC uses the same IP than the one found in the
> A10/A13, with only different pins. Add the pins and the associated
> functions found in the A31.

I'd like this to be in 3.12 if it's okay for you. Do you have any
comments on it?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


[PATCH] remoteproc: ste_modem: Staticize local symbols

2013-08-12 Thread Jingoo Han
These local symbols are used only in this file.
Fix the following sparse warnings:

drivers/remoteproc/ste_modem_rproc.c:167:27: warning: symbol 'sproc_fw_ops' was 
not declared. Should it be static?
drivers/remoteproc/ste_modem_rproc.c:196:25: warning: symbol 'sproc_dev_cb' was 
not declared. Should it be static?

Signed-off-by: Jingoo Han 
---
 drivers/remoteproc/ste_modem_rproc.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/ste_modem_rproc.c 
b/drivers/remoteproc/ste_modem_rproc.c
index 1ec39a4..c4ac910 100644
--- a/drivers/remoteproc/ste_modem_rproc.c
+++ b/drivers/remoteproc/ste_modem_rproc.c
@@ -164,7 +164,7 @@ sproc_find_loaded_rsc_table(struct rproc *rproc, const 
struct firmware *fw)
 }
 
 /* STE modem firmware handler operations */
-const struct rproc_fw_ops sproc_fw_ops = {
+static const struct rproc_fw_ops sproc_fw_ops = {
.load = sproc_load_segments,
.find_rsc_table = sproc_find_rsc_table,
.find_loaded_rsc_table = sproc_find_loaded_rsc_table,
@@ -193,7 +193,7 @@ static void sproc_kick_callback(struct ste_modem_device 
*mdev, int vqid)
sproc_dbg(sproc, "no message was found in vqid %d\n", vqid);
 }
 
-struct ste_modem_dev_cb sproc_dev_cb = {
+static struct ste_modem_dev_cb sproc_dev_cb = {
.kick = sproc_kick_callback,
 };
 
-- 
1.7.10.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/


RE: [PATCH] iwlwifi: mvm: make debugfs write() operations write up to count bytes

2013-08-12 Thread Berg, Johannes
> Some debugfs write() operations of the MVM Firmware will ignore the count
> argument, and will copy more bytes than what was specified.
> Fix this by getting the right count of bytes.
> 
> This will also honor restrictions put on the number of bytes to write.

That makes some sense.

> To be consitant this patch also switches the initializer from 'char buf[x] = 
> {}' to
> the explicit memset() as it is done in other places of the same file.

I'd rather this (a) be done in a separate patch, and (b) the other way around, 
switch everything to C99.

> Cc: sta...@vger.kernel.org

That doesn't really make sense for the debugfs interface.

> + memset(buf, 0, sizeof(buf));
> + if (count > sizeof(buf) - 1)
> + count = sizeof(buf) - 1;

Why -1? And why not use min()/min_t()?

johannes
-- 

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052

--
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 16/16] arch/arm/mach-pxa/stargate2.c: Avoid using ARRAY_AND_SIZE(e) as a function argument

2013-08-12 Thread Jonathan Cameron
On 08/11/13 17:51, Julia Lawall wrote:
> From: Julia Lawall 
> 
> Replace ARRAY_AND_SIZE(e) in function argument position to avoid hiding the
> arity of the called function.
> 
> The semantic match that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // 
> @@
> expression e,f;
> @@
> 
> f(...,
> - ARRAY_AND_SIZE(e)
> + e,ARRAY_SIZE(e)
>   ,...)
> // 
> 
> Signed-off-by: Julia Lawall 
Acked-by: Jonathan Cameron 

Thanks,
> 
> ---
> Not compiled.
> 
>  arch/arm/mach-pxa/stargate2.c |   13 -
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
> index 62aea3e..adacedd 100644
> --- a/arch/arm/mach-pxa/stargate2.c
> +++ b/arch/arm/mach-pxa/stargate2.c
> @@ -406,7 +406,8 @@ static struct i2c_pxa_platform_data i2c_pdata = {
>  static void __init imote2_stargate2_init(void)
>  {
>  
> - pxa2xx_mfp_config(ARRAY_AND_SIZE(sg2_im2_unified_pin_config));
> + pxa2xx_mfp_config(sg2_im2_unified_pin_config,
> +   ARRAY_SIZE(sg2_im2_unified_pin_config));
>  
>   pxa_set_ffuart_info(NULL);
>   pxa_set_btuart_info(NULL);
> @@ -604,7 +605,7 @@ static struct platform_device *imote2_devices[] = {
>  
>  static void __init imote2_init(void)
>  {
> - pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config));
> + pxa2xx_mfp_config(imote2_pin_config, ARRAY_SIZE(imote2_pin_config));
>  
>   imote2_stargate2_init();
>  
> @@ -983,13 +984,15 @@ static void __init stargate2_init(void)
>  prior to connecting the MFP stuff up. */
>   __raw_writel(__raw_readl(MECR) & ~MECR_NOS, MECR);
>  
> - pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
> + pxa2xx_mfp_config(stargate2_pin_config,
> +   ARRAY_SIZE(stargate2_pin_config));
>  
>   imote2_stargate2_init();
>  
> - platform_add_devices(ARRAY_AND_SIZE(stargate2_devices));
> + platform_add_devices(stargate2_devices, ARRAY_SIZE(stargate2_devices));
>  
> - i2c_register_board_info(0, ARRAY_AND_SIZE(stargate2_i2c_board_info));
> + i2c_register_board_info(0, stargate2_i2c_board_info,
> + ARRAY_SIZE(stargate2_i2c_board_info));
>   i2c_register_board_info(1, stargate2_pwr_i2c_board_info,
>   ARRAY_SIZE(stargate2_pwr_i2c_board_info));
>  
> 
--
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] ARM: OMAP2+: hwmod-data: Add SSI information

2013-08-12 Thread Tony Lindgren
* Sebastian Reichel  [130811 09:25]:
> From: Sebastian Reichel 
> 
> This patch adds Synchronous Serial Interface (SSI) hwmod support for
> OMAP34xx SoCs.

This should be queued or acked by Paul.

Regards,

Tony

>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  104 
> 
>  1 file changed, 104 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
> b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> index 0c3a427..74006c4 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> @@ -3693,6 +3693,109 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__aes 
> = {
>   .user   = OCP_USER_MPU | OCP_USER_SDMA,
>  };
>  
> +/*
> + * 'ssi' class
> + * synchronous serial interface (multichannel and full-duplex serial if)
> + */
> +
> +static struct omap_hwmod_class_sysconfig omap34xx_ssi_sysc = {
> + .rev_offs   = 0x,
> + .sysc_offs  = 0x0010,
> + .syss_offs  = 0x0014,
> + .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_EMUFREE |
> +SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
> +SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
> + .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
> +SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
> +MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
> + .sysc_fields= &omap_hwmod_sysc_type1,
> +};
> +
> +static struct omap_hwmod_class omap34xx_ssi_hwmod_class = {
> + .name   = "ssi",
> + .sysc   = &omap34xx_ssi_sysc,
> +};
> +
> +static struct omap_hwmod_irq_info omap34xx_ssi_irqs[] = {
> + { .name = "ssi_p1_mpu_irq0", .irq = 67 },
> + { .name = "ssi_p1_mpu_irq1", .irq = 68 },
> + { .name = "ssi_p2_mpu_irq0", .irq = 69 },
> + { .name = "ssi_p2_mpu_irq1", .irq = 70 },
> + { .name = "ssi_gdd_mpu", .irq = 71 },
> + { .irq = -1 },
> +};
> +
> +static struct omap_hwmod_addr_space omap34xx_ssi_addrs[] = {
> + {
> + .name   = "sys",
> + .pa_start   = 0x48058000,
> + .pa_end = 0x48058fff,
> + .flags  = ADDR_TYPE_RT,
> + },
> + {
> + /* generic distributed DMA */
> + .name   = "gdd",
> + .pa_start   = 0x48059000,
> + .pa_end = 0x48059fff,
> + .flags  = ADDR_TYPE_RT,
> + },
> + {
> + /* port 1: synchronous serial transmitter */
> + .name   = "p1_sst",
> + .pa_start   = 0x4805a000,
> + .pa_end = 0x4805a7ff,
> + .flags  = ADDR_TYPE_RT,
> + },
> + {
> + /* port 1: synchronous serial receiver */
> + .name   = "p1_ssr",
> + .pa_start   = 0x4805a800,
> + .pa_end = 0x4805afff,
> + .flags  = ADDR_TYPE_RT,
> + },
> + {
> + /* port 2: synchronous serial transmitter */
> + .name   = "p2_sst",
> + .pa_start   = 0x4805b000,
> + .pa_end = 0x4805b7ff,
> + .flags  = ADDR_TYPE_RT,
> + },
> + {
> + /* port 2: synchronous serial receiver */
> + .name   = "p2_ssr",
> + .pa_start   = 0x4805b800,
> + .pa_end = 0x4805bfff,
> + .flags  = ADDR_TYPE_RT,
> + },
> + {}
> +};
> +
> +static struct omap_hwmod omap34xx_ssi_hwmod = {
> + .name   = "ssi",
> + .class  = &omap34xx_ssi_hwmod_class,
> + .clkdm_name = "l3_init_clkdm",
> + .mpu_irqs   = omap34xx_ssi_irqs,
> + .main_clk   = "ssi_ssr_fck",
> + .prcm   = {
> + .omap2 = {
> + .prcm_reg_id= 1,
> + .module_bit = OMAP3430_EN_SSI_SHIFT,
> + .module_offs= WKUP_MOD,
> + .idlest_reg_id  = 1,
> + .idlest_idle_bit= OMAP3430ES2_ST_SSI_IDLE_SHIFT,
> + },
> + },
> +};
> +
> +/* SSI -> l3 */
> +static struct omap_hwmod_ocp_if omap34xx_l3__ssi = {
> + .master = &omap3xxx_l3_main_hwmod,
> + .slave  = &omap34xx_ssi_hwmod,
> + .clk= "ssi_ick",
> + .addr   = omap34xx_ssi_addrs,
> + .user   = OCP_USER_MPU | OCP_USER_SDMA,
> +};
> +
>  static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
>   &omap3xxx_l3_main__l4_core,
>   &omap3xxx_l3_main__l4_per,
> @@ -3818,6 +3921,7 @@ static struct omap_hwmod_ocp_if 
> *omap34xx_hwmod_ocp_ifs[] __initdata = {
>  #ifdef CONFIG_OMAP_IOMMU_IVA2
>   &omap3xxx_l3_main__mmu_iva,
>  #endif
> + &omap34xx_l3__ssi,
>   NULL
>  };
>  
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: sen

Re: [PATCHv3 5/9] pinctrl: sunxi: Fix inconsistent indentation

2013-08-12 Thread Maxime Ripard
Hi Linus,

On Sun, Aug 04, 2013 at 11:58:46AM +0200, Maxime Ripard wrote:
> Some pin functions in the array were not indented like the other
> functions in this array. Fix this.

Could you please take this trivial patch for 3.12?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCH 2/3] ARM: OMAP2+: HSI: Introduce OMAP SSI driver

2013-08-12 Thread Tony Lindgren
* Sebastian Reichel  [130811 09:25]:
> From: Sebastian Reichel 
> 
> This patch adds an OMAP SSI driver to the HSI framework.
> 
> The Synchronous Serial Interface (SSI) is a legacy version
> of HSI. As in the case of HSI, it is mainly used to connect
> Application engines (APE) with cellular modem engines (CMT)
> in cellular handsets.
> 
> It provides a multichannel, full-duplex, multi-core communication
> with no reference clock. The OMAP SSI block is capable of reaching
> speeds of 110 Mbit/s.

Good to see this being worked on, maybe we can finally start
making calls with mainline kernel :)

This one should be queued by:

$ scripts/get_maintainer.pl -f drivers/hsi

This should be a stand alone patch, right? You should resend
with those people in cc.

Regards,

Tony
--
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/3] ARM: OMAP2+: Add SSI driver configuration

2013-08-12 Thread Tony Lindgren
* Sebastian Reichel  [130811 09:25]:
> From: Sebastian Reichel 
> 
> This patch configures and activates the OMAP SSI driver on the RX-51.

Hmm, I'd rather see this be DT only driver at this point. We're pretty
close to flipping omap3 to be DT only, and I'd rather not add new
platform code at this point. With DT, none of this patch is needed,
you can do all this in the driver probe based on the .dts configuration.

Regards,

Tony

>  arch/arm/mach-omap2/Makefile |4 ++
>  arch/arm/mach-omap2/board-rx51-peripherals.c |   10 +++-
>  arch/arm/mach-omap2/ssi.c|   82 
> ++
>  3 files changed, 95 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/mach-omap2/ssi.c
> 
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index d4f6715..ace860d 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -222,6 +222,10 @@ ifneq ($(CONFIG_DRM_OMAP),)
>  obj-y+= drm.o
>  endif
>  
> +# Synchronous Serial Interface (SSI)
> +omap-ssi-$(CONFIG_OMAP_SSI)  := ssi.o
> +obj-y+= $(omap-ssi-m) $(omap-ssi-y)
> +
>  # Specific board support
>  obj-$(CONFIG_MACH_OMAP_GENERIC)  += board-generic.o
>  obj-$(CONFIG_MACH_OMAP_H4)   += board-h4.o
> diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
> b/arch/arm/mach-omap2/board-rx51-peripherals.c
> index 9c2dd10..e2ca155 100644
> --- a/arch/arm/mach-omap2/board-rx51-peripherals.c
> +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
> @@ -27,6 +27,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  
> @@ -73,6 +74,8 @@
>  #define LIS302_IRQ1_GPIO 181
>  #define LIS302_IRQ2_GPIO 180  /* Not yet in use */
>  
> +#define RX51_CAWAKE_GPIO 151
> +
>  /* List all SPI devices here. Note that the list/probe order seems to 
> matter! */
>  enum {
>   RX51_SPI_WL1251,
> @@ -265,6 +268,11 @@ static struct spi_board_info 
> rx51_peripherals_spi_board_info[] __initdata = {
>   },
>  };
>  
> +static struct omap_ssi_board_config ssi_board_config = {
> + .num_ports = 1,
> + .cawake_gpio = { RX51_CAWAKE_GPIO },
> +};
> +
>  static struct platform_device rx51_battery_device = {
>   .name   = "rx51-battery",
>   .id = -1,
> @@ -1295,7 +1303,7 @@ void __init rx51_peripherals_init(void)
>   if (partition)
>   omap_hsmmc_init(mmc);
>  
> + omap_ssi_config(&ssi_board_config);
>   rx51_charger_init();
>   rx51_init_twl4030_hwmon();
>  }
> -
> diff --git a/arch/arm/mach-omap2/ssi.c b/arch/arm/mach-omap2/ssi.c
> new file mode 100644
> index 000..a9d6eee
> --- /dev/null
> +++ b/arch/arm/mach-omap2/ssi.c
> @@ -0,0 +1,82 @@
> +/*
> + * linux/arch/arm/mach-omap2/ssi.c
> + *
> + * Copyright (C) 2010 Nokia Corporation. All rights reserved.
> + *
> + * Contact: Carlos Chinea 
> + *
> + * 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, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "omap_hwmod.h"
> +#include "omap_device.h"
> +#include "omap-pm.h"
> +
> +static struct omap_ssi_platform_data ssi_pdata = {
> + .num_ports  = SSI_NUM_PORTS,
> + .cawake_gpio= {0},
> + .get_dev_context_loss_count  = omap_pm_get_dev_context_loss_count,
> +};
> +
> +int __init omap_ssi_config(struct omap_ssi_board_config *ssi_config)
> +{
> + unsigned int port, offset, cawake_gpio;
> + int err;
> +
> + ssi_pdata.num_ports = ssi_config->num_ports;
> +
> + for (port = 0, offset = 7; port < ssi_config->num_ports; port++, offset 
> += 5) {
> + cawake_gpio = ssi_config->cawake_gpio[port];
> + if (!cawake_gpio)
> + continue; /* Nothing to do */
> + err = gpio_request(cawake_gpio, "cawake");
> + if (err < 0)
> + goto rback;
> + gpio_direction_input(cawake_gpio);
> +
> + ssi_pdata.cawake_gpio[port] = ssi_config->cawake_gpio[port];
> + }
> +
> + return 0;
> +
> +rback:
> + pr_err("omap-ssi: Request cawake (gpio%d) failed\n", cawake_gpio);
> + while (port > 0)
> + gpio_free(ssi_config->cawake_gpio[--port]);
> +
> + return err;
> +}
> +
> +static int __init omap_ssi_init(void)
> +{
> + 

Re: [PATCHv3 4/9] pinctrl: sunxi: Add Allwinner A20 pins set

2013-08-12 Thread Maxime Ripard
Hi Linus,

On Sun, Aug 04, 2013 at 11:58:45AM +0200, Maxime Ripard wrote:
> The Allwinner A20 is pin-compatible with the older A10, so the two pin
> set are quite similar. However, since the A20 has new features, we can't
> just use the A10 pin set as is, and we need to define our own for the
> A20.

I'd like this to get merged in 3.12, do you have any comments on this
patch?

It's mostly just another round of pin sets additions for yet another
SoC, like we already had a few times.

Hopefully, it will be the end of it, unless if Allwinner release a new
SoC.

The only missing feature now is the gpio irq support for the A31 that
had a slightly different interrupts handling. Anyway, this support will
likely be in 3.13.

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCH 21/44] cpufreq: imx6q: Use generic cpufreq routines

2013-08-12 Thread Shawn Guo
On Mon, Aug 12, 2013 at 01:40:36PM +0530, Viresh Kumar wrote:
> On 12 August 2013 13:28, Shawn Guo  wrote:
> > On Sat, Aug 10, 2013 at 12:14:17PM +0530, Viresh Kumar wrote:
> >> Most of the CPUFreq drivers do similar things in .exit() and .verify() 
> >> routines
> >> and .attr. So its better if we have generic routines for them which can be 
> >> used
> >> by cpufreq drivers then.
> >>
> >> This patch uses these generic routines for this driver.
> >>
> >> Cc: Shawn Guo 
> >> Signed-off-by: Viresh Kumar 
> >
> > Shawn Guo 
> 
> I assume you meant an Ack here :)

Ah, yeah.

Acked-by: Shawn Guo 

--
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 0/2] clk: sunxi: Add clock support for the A10s

2013-08-12 Thread Maxime Ripard
Hi Mike,

On Mon, Aug 05, 2013 at 10:39:24PM +0200, Maxime Ripard wrote:
> This small patchset adds support for the gates found in the Allwinner A10s 
> SoC.
> Since the gates are the only clock that differ from the other supported
> Allwinner SoCs so far, the two patches are quite trivial.

It would be great if you could merge this in 3.12.
Do you have comments on this one?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCHv3 0/4] Add support for the Allwinner A31 clocks

2013-08-12 Thread Maxime Ripard
Hi Mike, Emilio,

On Mon, Aug 05, 2013 at 10:42:57PM +0200, Maxime Ripard wrote:
> Hi everyone,
> 
> The Allwinner A31 SoC has a quite different clock tree and structure that the
> other Allwinner SoCs that we already merged, so it requires more work than 
> what
> we had for the other SoCs until now.
> 
> It's also an opportunity to do some minor cleanup/refactoring to land the new
> code properly.
> 
> This patch set is based on the "ARM: sunxi: Add support for the Allwinner A31
> SoC" serie I sent previously.

It would be great if this could go in 3.12.
Could you review these patches? The two first should be trivial, only
the third one isn't and adds the basic A31 clocks support to the driver.

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


[PATCH] sched: Give idle_balance() a break when it does not move tasks.

2013-08-12 Thread Jason Low
When running benchmarks on an 8 socket (80 core) machine, newidle load balance
was being attempted frequently, but no tasks were moved most of the time. The
most common reason was due to find_busiest_group returning NULL (for example,
groups were already balanced within domains). Another common reason was that
move tasks was attempted but it couldn't find a suitable task to move.

In situations where idle balance does not need or is not able to move tasks,
attempting it frequently may lower performance by consuming kernel time while
also ending up not doing anything. Functions such as update_sd_lb_stats(),
idle_cpu(), acquiring rq lock, ect... show up as hot kernel functions as
reported by perf during these situations.

In this patch, idle balance attempts for a CPU will be blocked for a
brief duration (10 ms) after newidle load balance is attempted for the CPU but
did not move tasks. The idea is that if a CPU just attempted a new idle
load balance and found that it either does not need to do any balancing or is
unable to move a task over for all sched domains, then it should
avoid re-attempting it on the same CPU too soon once again.

This patch is able to provide good performance boosts of many AIM7 workloads
on an 8 socket machine 80 core while still preserving performance of a few
workloads that I have also been running which benefit from idle balancing.

The table below compares the average jobs per minute at 10-100, 200-1000, and
1100-2000 users between the vanilla 3.11-rc4 kernel and 3.11-rc4 kernel with
this patch with Hyperthreading enabled.


workload | % improvement   | % improvement  | % improvement
 | with patch  | with patch | with patch
 | 1100-2000 users | 200-1000 users | 10-100 users

alltests | +13.9%  | +5.6%  | +0.9%

custom   | +20.3%  | +20.7% | +12.2%

disk | +22.3%  | +18.7% | +18.3%

fserver  | +62.6%  | +27.3% | -0.9%

high_systime | +17.7%  | +10.7% | +0.6%

new_fserver  | +53.1%  | +20.2% | -0.2%

shared   | +10.3%  | +10.8% | +10.7%



Signed-off-by: Jason Low 
---
 kernel/sched/core.c  |1 +
 kernel/sched/fair.c  |   10 +-
 kernel/sched/sched.h |5 +
 3 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index b7c32cb..b1fcf6d 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6458,6 +6458,7 @@ void __init sched_init(void)
rq->online = 0;
rq->idle_stamp = 0;
rq->avg_idle = 2*sysctl_sched_migration_cost;
+   rq->next_newidle_balance = jiffies;
 
INIT_LIST_HEAD(&rq->cfs_tasks);
 
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 9565645..70d96d6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5277,10 +5277,12 @@ void idle_balance(int this_cpu, struct rq *this_rq)
struct sched_domain *sd;
int pulled_task = 0;
unsigned long next_balance = jiffies + HZ;
+   bool load_balance_attempted = false;
 
this_rq->idle_stamp = rq_clock(this_rq);
 
-   if (this_rq->avg_idle < sysctl_sched_migration_cost)
+   if (this_rq->avg_idle < sysctl_sched_migration_cost ||
+   time_before(jiffies, this_rq->next_newidle_balance))
return;
 
/*
@@ -5298,6 +5300,8 @@ void idle_balance(int this_cpu, struct rq *this_rq)
continue;
 
if (sd->flags & SD_BALANCE_NEWIDLE) {
+   load_balance_attempted = true;
+
/* If we've pulled tasks over stop searching: */
pulled_task = load_balance(this_cpu, this_rq,
   sd, CPU_NEWLY_IDLE, 
&balance);
@@ -5322,6 +5326,10 @@ void idle_balance(int this_cpu, struct rq *this_rq)
 */
this_rq->next_balance = next_balance;
}
+
+   /* Give idle balance on this CPU a break when it isn't moving tasks */
+   if (load_balance_attempted && !pulled_task)
+   this_rq->next_newidle_balance = jiffies + (HZ / 100);
 }
 
 /*
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index ef0a7b2..6a70be9 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -524,6 +524,11 @@ struct rq {

[PATCH v4] regulator: palmas: model SMPS10 as two regulators

2013-08-12 Thread Kishon Vijay Abraham I
SMPS10 has two outputs OUT1 and OUT2 and have one input IN1.
SMPS10-OUT2 is connected to SMPS10-IN1 and can be configured either
in BOOST mode or BYPASS mode. regulator_enable of SMPS10-OUT2 configures
it in BOOST mode. For BYPASS mode regulator_allow_bypass() API can be
used. SMPS10-OUT1 is connected to SMPS10-OUT2 and can be enabled using
regulator_enable().

[ axel@ingics.com : Simplify regulator_desc setting for SMPS10_[OUT1|OUT2]

Signed-off-by: J Keerthy 
Signed-off-by: Laxman Dewangan 
Signed-off-by: Kishon Vijay Abraham I 
Signed-off-by: Axel Lin 
---
Changes from v3:
rolled in Axel's fix.
rebased to Linux 3.11-rc5

Changes from v2:
Fixed the compilation error.
drivers/regulator/palmas-regulator.c: In function 'palmas_regulators_probe':
drivers/regulator/palmas-regulator.c:850:8: error: 'PALMAS_REG_SMPS10'
undeclared (first use in this function)
   case PALMAS_REG_SMPS10:
^
Changes from v1:
Reversed the order of SMPS10_OUT2 and SMPS10_OUT1 since the input signal
of OUT1 is OUT2

 drivers/regulator/palmas-regulator.c |   30 --
 include/linux/mfd/palmas.h   |9 +
 2 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/drivers/regulator/palmas-regulator.c 
b/drivers/regulator/palmas-regulator.c
index d0c8785..ab58e95 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -97,11 +97,16 @@ static const struct regs_info palmas_regs_info[] = {
.ctrl_addr  = PALMAS_SMPS9_CTRL,
},
{
-   .name   = "SMPS10",
+   .name   = "SMPS10_OUT2",
.sname  = "smps10-in",
.ctrl_addr  = PALMAS_SMPS10_CTRL,
},
{
+   .name   = "SMPS10_OUT1",
+   .sname  = "smps10-out2",
+   .ctrl_addr  = PALMAS_SMPS10_CTRL,
+   },
+   {
.name   = "LDO1",
.sname  = "ldo1-in",
.vsel_addr  = PALMAS_LDO1_VOLTAGE,
@@ -487,6 +492,8 @@ static struct regulator_ops palmas_ops_smps10 = {
.set_voltage_sel= regulator_set_voltage_sel_regmap,
.list_voltage   = regulator_list_voltage_linear,
.map_voltage= regulator_map_voltage_linear,
+   .set_bypass = regulator_set_bypass_regmap,
+   .get_bypass = regulator_get_bypass_regmap,
 };
 
 static int palmas_is_enabled_ldo(struct regulator_dev *dev)
@@ -538,7 +545,8 @@ static int palmas_smps_init(struct palmas *palmas, int id,
return ret;
 
switch (id) {
-   case PALMAS_REG_SMPS10:
+   case PALMAS_REG_SMPS10_OUT1:
+   case PALMAS_REG_SMPS10_OUT2:
reg &= ~PALMAS_SMPS10_CTRL_MODE_SLEEP_MASK;
if (reg_init->mode_sleep)
reg |= reg_init->mode_sleep <<
@@ -681,7 +689,8 @@ static struct of_regulator_match palmas_matches[] = {
{ .name = "smps7", },
{ .name = "smps8", },
{ .name = "smps9", },
-   { .name = "smps10", },
+   { .name = "smps10_out2", },
+   { .name = "smps10_out1", },
{ .name = "ldo1", },
{ .name = "ldo2", },
{ .name = "ldo3", },
@@ -838,7 +847,8 @@ static int palmas_regulators_probe(struct platform_device 
*pdev)
continue;
ramp_delay_support = true;
break;
-   case PALMAS_REG_SMPS10:
+   case PALMAS_REG_SMPS10_OUT1:
+   case PALMAS_REG_SMPS10_OUT2:
if (!PALMAS_PMIC_HAS(palmas, SMPS10_BOOST))
continue;
}
@@ -872,7 +882,8 @@ static int palmas_regulators_probe(struct platform_device 
*pdev)
pmic->desc[id].id = id;
 
switch (id) {
-   case PALMAS_REG_SMPS10:
+   case PALMAS_REG_SMPS10_OUT1:
+   case PALMAS_REG_SMPS10_OUT2:
pmic->desc[id].n_voltages = PALMAS_SMPS10_NUM_VOLTAGES;
pmic->desc[id].ops = &palmas_ops_smps10;
pmic->desc[id].vsel_reg =
@@ -882,7 +893,14 @@ static int palmas_regulators_probe(struct platform_device 
*pdev)
pmic->desc[id].enable_reg =
PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE,
PALMAS_SMPS10_CTRL);
-   pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
+   if (id == PALMAS_REG_SMPS10_OUT1)
+   pmic->desc[id].enable_mask = SMPS10_SWITCH_EN;
+   else
+   pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
+   pmic->desc[id].bypass_reg =
+   PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE,
+  

Re: [PATCH V9 09/14] perf: make events stream always parsable

2013-08-12 Thread Peter Zijlstra
On Mon, Aug 05, 2013 at 07:26:29PM +0300, Adrian Hunter wrote:
> The event stream is not always parsable because the format of a sample
> is dependent on the sample_type of the selected event.  When there
> is more than one selected event and the sample_types are not the
> same then parsing becomes problematic.  A sample can be matched to its
> selected event using the ID that is allocated when the event is opened.
> Unfortunately, to get the ID from the sample means first parsing it.
> 
> This patch adds a new sample format bit PERF_SAMPLE_IDENTIFER that puts
> the ID at a fixed position so that the ID can be retrieved without
> parsing the sample.  For sample events, that is the first position
> immediately after the header.  For non-sample events, that is the last
> position.
> 
> In this respect parsing samples requires that the sample_type and ID
> values are recorded.  For example, perf tools records struct perf_event_attr
> and the IDs within the perf.data file.  Those must be read first
> before it is possible to parse samples found later in the perf.data file.
> 
> Signed-off-by: Adrian Hunter 

Acked-by: Peter Zijlstra 


--
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 3/6] usb: phy: msm: Migrate to Managed Device Resource allocation

2013-08-12 Thread Ivan T. Ivanov

Hi, 

On Mon, 2013-07-29 at 15:25 +0300, Felipe Balbi wrote:
> Hi,
> 
> On Mon, Jul 29, 2013 at 10:04:21AM +0300, Ivan T. Ivanov wrote:
> > motg->irq = platform_get_irq(pdev, 0);
> > -   if (!motg->irq) {
> > +   if (motg->irq < 0) {
> 
> looks like this particular hunk isn't part of $subject.
> 

Indeed. Will remove it. 

Thanks, 
Ivan


--
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 part5 0/7] Arrange hotpluggable memory as ZONE_MOVABLE.

2013-08-12 Thread Tang Chen

On 08/10/2013 12:32 AM, Tejun Heo wrote:

Hello,

On Thu, Aug 08, 2013 at 06:16:12PM +0800, Tang Chen wrote:

In previous parts' patches, we have obtained SRAT earlier enough, right after
memblock is ready. So this patch-set does the following things:

Can you please set up a git branch with all patches?

Thanks.


Please refer to :

https://github.com/imtangchen/linux movablenode-boot-option

It contains all 5 parts patches.

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/


[PATCH] PCI: exynos: add support for MSI

2013-08-12 Thread Jingoo Han
This patch adds support for Message Signaled Interrupt in the
Exynops PCIe diver using Synopsys designware PCIe core IP.

Signed-off-by: Siva Reddy Kallam 
Signed-off-by: Srikanth T Shivanand 
Signed-off-by: Jingoo Han 
Cc: Pratyush Anand 
Cc: Mohit KUMAR 
---
 arch/arm/boot/dts/exynos5440.dtsi  |2 +
 arch/arm/mach-exynos/Kconfig   |1 +
 drivers/pci/host/pci-exynos.c  |   60 ++
 drivers/pci/host/pcie-designware.c |  213 
 drivers/pci/host/pcie-designware.h |8 ++
 5 files changed, 284 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5440.dtsi 
b/arch/arm/boot/dts/exynos5440.dtsi
index 586134e..3746835 100644
--- a/arch/arm/boot/dts/exynos5440.dtsi
+++ b/arch/arm/boot/dts/exynos5440.dtsi
@@ -249,6 +249,7 @@
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0x0 0 &gic 53>;
num-lanes = <4>;
+   msi-base = <200>;
};
 
pcie@2a {
@@ -269,5 +270,6 @@
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0x0 0 &gic 56>;
num-lanes = <4>;
+   msi-base = <232>;
};
 };
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 855d4a7..9ef1c95 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -93,6 +93,7 @@ config SOC_EXYNOS5440
default y
depends on ARCH_EXYNOS5
select ARCH_HAS_OPP
+   select ARCH_SUPPORTS_MSI
select HAVE_ARM_ARCH_TIMER
select AUTO_ZRELADDR
select MIGHT_HAVE_PCI
diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c
index 012ca8a..d0477d0 100644
--- a/drivers/pci/host/pci-exynos.c
+++ b/drivers/pci/host/pci-exynos.c
@@ -48,6 +48,7 @@ struct exynos_pcie {
 #define PCIE_IRQ_SPECIAL   0x008
 #define PCIE_IRQ_EN_PULSE  0x00c
 #define PCIE_IRQ_EN_LEVEL  0x010
+#define IRQ_MSI_ENABLE (0x1 << 2)
 #define PCIE_IRQ_EN_SPECIAL0x014
 #define PCIE_PWR_RESET 0x018
 #define PCIE_CORE_RESET0x01c
@@ -320,9 +321,51 @@ static irqreturn_t exynos_pcie_irq_handler(int irq, void 
*arg)
return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_PCI_MSI
+static void exynos_pcie_clear_irq_level(struct pcie_port *pp)
+{
+   u32 val;
+   struct exynos_pcie *exynos_pcie = to_exynos_pcie(pp);
+   void __iomem *elbi_base = exynos_pcie->elbi_base;
+
+   val = readl(elbi_base + PCIE_IRQ_LEVEL);
+   writel(val, elbi_base + PCIE_IRQ_LEVEL);
+   return;
+}
+
+static irqreturn_t exynos_pcie_msi_irq_handler(int irq, void *arg)
+{
+   struct pcie_port *pp = arg;
+
+   /* handle msi irq */
+   dw_handle_msi_irq(pp);
+   exynos_pcie_clear_irq_level(pp);
+
+   return IRQ_HANDLED;
+}
+
+static void exynos_pcie_msi_init(struct pcie_port *pp)
+{
+   u32 val;
+   struct exynos_pcie *exynos_pcie = to_exynos_pcie(pp);
+   void __iomem *elbi_base = exynos_pcie->elbi_base;
+
+   dw_pcie_msi_init(pp);
+
+   /* enable MSI interrupt */
+   val = readl(elbi_base + PCIE_IRQ_EN_LEVEL);
+   val |= IRQ_MSI_ENABLE;
+   writel(val, elbi_base + PCIE_IRQ_EN_LEVEL);
+   return;
+}
+#endif
+
 static void exynos_pcie_enable_interrupts(struct pcie_port *pp)
 {
exynos_pcie_enable_irq_pulse(pp);
+#ifdef CONFIG_PCI_MSI
+   exynos_pcie_msi_init(pp);
+#endif
return;
 }
 
@@ -408,6 +451,23 @@ static int add_pcie_port(struct pcie_port *pp, struct 
platform_device *pdev)
return ret;
}
 
+#ifdef CONFIG_PCI_MSI
+   pp->msi_irq = platform_get_irq(pdev, 0);
+
+   if (!pp->msi_irq) {
+   dev_err(&pdev->dev, "failed to get msi irq\n");
+   return -ENODEV;
+   }
+
+   ret = devm_request_irq(&pdev->dev, pp->msi_irq,
+   exynos_pcie_msi_irq_handler,
+   IRQF_SHARED, "exynos-pcie", pp);
+   if (ret) {
+   dev_err(&pdev->dev, "failed to request msi irq\n");
+   return ret;
+   }
+#endif
+
pp->root_bus_nr = -1;
pp->ops = &exynos_pcie_host_ops;
 
diff --git a/drivers/pci/host/pcie-designware.c 
b/drivers/pci/host/pcie-designware.c
index 77b0c25..5a47f11 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -11,8 +11,10 @@
  * published by the Free Software Foundation.
  */
 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -62,6 +64,14 @@
 #define PCIE_ATU_FUNC(x)   (((x) & 0x7) << 16)
 #define PCIE_ATU_UPPER_TARGET  0x91C
 
+#ifdef CONFIG_PCI_MSI
+#define MAX_MSI_IRQS   32
+#define MAX_MSI_CTRLS  8
+
+static unsigned int msi_data;
+static DECLARE_BITMAP(msi_irq_in_use, MAX_MSI_IRQS);
+#endif
+
 static struct hw_pci dw_pci;
 
 unsigned long global_io_offset;
@@ -144,6 +154,202 @@ int dw_pc

Re: [PATCH v6 2/8] cpufreq: Add boost frequency support in core

2013-08-12 Thread Lukasz Majewski
On Fri, 26 Jul 2013 15:06:45 +0530 Viresh Kumar viresh.ku...@linaro.org
wrote,
> On 26 July 2013 14:03, Lukasz Majewski  wrote:
> > The problem here is with the cpufreq_driver->set_boost() call.
> >
> > I tried to avoid acquiring lock at one function and release it at
> > another (in this case cpufreq_boost_set_sw), especially since the
> > __cpufreq_governor() acquires its own lock - good place for
> > deadlock.
> >
> > Is it OK for you to grab lock at one function
> > (cpufreq_boost_trigger_state()) and then at other function
> > (cpufreq_boost_set_sw) release it before calling
> > __cpufreq_governor() and grab it again after its completion?
> 
> Problem is not only that.. but we shouldn't call boost_set() of
> drivers like acpi-cpufreq with this lock. Leave it as it is for
> now.. Let me see if I can think of any problems that can happen due
> to this.

Do you have any second thoughts about this? Shall I leave it as it is
now?

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform 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 v6 2/8] cpufreq: Add boost frequency support in core

2013-08-12 Thread Viresh Kumar
On 12 August 2013 14:37, Lukasz Majewski  wrote:
> Do you have any second thoughts about this? Shall I leave it as it is
> now?

Honestly speaking I didn't had a chance to look into this..
Leave it as is, in case there is some problem we can patch it later.
--
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] PCI: exynos: add support for MSI

2013-08-12 Thread Sachin Kamat
Hi Jingoo,

On 12 August 2013 14:26, Jingoo Han  wrote:
> This patch adds support for Message Signaled Interrupt in the
> Exynops PCIe diver using Synopsys designware PCIe core IP.

s/Exynops PCIe diver/Exynos PCIe driver

>
> Signed-off-by: Siva Reddy Kallam 
> Signed-off-by: Srikanth T Shivanand 
> Signed-off-by: Jingoo Han 
> Cc: Pratyush Anand 
> Cc: Mohit KUMAR 
> ---
>  arch/arm/boot/dts/exynos5440.dtsi  |2 +
>  arch/arm/mach-exynos/Kconfig   |1 +
>  drivers/pci/host/pci-exynos.c  |   60 ++
>  drivers/pci/host/pcie-designware.c |  213 
> 
>  drivers/pci/host/pcie-designware.h |8 ++
>  5 files changed, 284 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos5440.dtsi 
> b/arch/arm/boot/dts/exynos5440.dtsi
> index 586134e..3746835 100644
> --- a/arch/arm/boot/dts/exynos5440.dtsi
> +++ b/arch/arm/boot/dts/exynos5440.dtsi
> @@ -249,6 +249,7 @@
> interrupt-map-mask = <0 0 0 0>;
> interrupt-map = <0x0 0 &gic 53>;
> num-lanes = <4>;
> +   msi-base = <200>;

Please update the bindings documentation too.

> };
>
> pcie@2a {
> @@ -269,5 +270,6 @@
[snip]
>
> +#ifdef CONFIG_PCI_MSI
> +static void exynos_pcie_clear_irq_level(struct pcie_port *pp)
> +{
> +   u32 val;
> +   struct exynos_pcie *exynos_pcie = to_exynos_pcie(pp);
> +   void __iomem *elbi_base = exynos_pcie->elbi_base;
> +
> +   val = readl(elbi_base + PCIE_IRQ_LEVEL);
> +   writel(val, elbi_base + PCIE_IRQ_LEVEL);

Sorry, I did not get this. Writing the value read from the same
register without any operation.

-- 
With warm regards,
Sachin
--
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/8] cpufreq:acpi:x86: Adjust the acpi-cpufreq.c code to work with common boost solution

2013-08-12 Thread Lukasz Majewski
On Fri, 26 Jul 2013 14:54:07 +0530 Viresh Kumar viresh.ku...@linaro.org
wrote,
> On 26 July 2013 13:39, Lukasz Majewski  wrote:
> > On Fri, 26 Jul 2013 12:58:02 +0530 Viresh Kumar wrote,
> >> On 25 July 2013 22:03, Lukasz Majewski 
> >> wrote:
> >> > diff --git a/drivers/cpufreq/acpi-cpufreq.c
> >> > b/drivers/cpufreq/acpi-cpufreq.c
> >>
> >> >  static void __init acpi_cpufreq_boost_init(void)
> >> >  {
> >> > +   acpi_cpufreq_driver.boost_supported = false;
> >  [*]
> >>
> >> Would be better if we do this in else of below if.
> >
> > We need to set boost_supported = false at [*] for the case when:
> > 1. msrs_alloc fails
> > or
> > 2. acpi_cpufreq is built as a module and can be inserted and removed
> > several times. Without [*] we could end up with wrong (not false)
> > initial state.
> 
> Hmm.. Now that I see the code again, we don't need to set it to false
> as it is a global variable and this field is already set to false..

Ok, I will delete the line at [*].

> 
> >> > if (boot_cpu_has(X86_FEATURE_CPB) ||
> >> > boot_cpu_has(X86_FEATURE_IDA)) { msrs = msrs_alloc();
> >>
> >>
> >> > @@ -1021,12 +995,11 @@ static int __init acpi_cpufreq_init(void)
> >> > *iter = &cpb;
> >> > }
> >> >  #endif
> >> > +   acpi_cpufreq_boost_init();
> >  [**]
> >>
> >> We are calling it before registering cpufreq driver. Will this have
> >> any complications?
> >
> > When we call [**] after the cpufreq_register_driver [***] we end up
> > with sysfs boost attribute not exported at x86.
> > The boost attribute is exported at [***] only when
> > acpi_cpufreq.boost_supported = true. However support for boost at
> > x86 is evaluated at acpi_cpufreq_boost_init().
> 
> I understand why you moved it above cpufreq driver register. I was
> thinking if there can be few side effects of this..

Have any problem with the above change came to your mind? 

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform 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 v6 3/8] cpufreq:acpi:x86: Adjust the acpi-cpufreq.c code to work with common boost solution

2013-08-12 Thread Viresh Kumar
On 12 August 2013 14:42, Lukasz Majewski  wrote:
> Have any problem with the above change came to your mind?

No.
--
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] gcc feature request: Moving blocks into sections

2013-08-12 Thread Peter Zijlstra
On Mon, Aug 05, 2013 at 12:55:15PM -0400, Steven Rostedt wrote:
> [ sent to both Linux kernel mailing list and to gcc list ]
> 

Let me hijack this thread for something related...

I've been wanting to 'abuse' static_key/asm-goto to sort-of JIT
if-forest functions like perf_prepare_sample() and perf_output_sample().

They are of the form:

void func(obj, args..)
{
unsigned long f = ...;

if (f & F1)
do_f1();

if (f & F2)
do_f2();

...

if (f & FN)
do_fn();
}

Where f is constant for the entire lifetime of the particular object.

So I was thinking of having these functions use static_key/asm-goto;
then write the proper static key values unsafe so as to avoid all
trickery (as these functions would never actually be used) and copy the
end result into object private memory. The object will then use indirect
calls into these functions.

The advantage of using something like this is that it would work for all
architectures that now support the asm-goto feature. For arch/gcc
combinations that do not we'd simply revert to the current state of
affairs.

I suppose the question is, do people strenuously object to creativity
like that and or is there something GCC can do to make this
easier/better still?

--
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 4/8] thermal:boost: Automatic enable/disable of BOOST feature

2013-08-12 Thread Lukasz Majewski
Dear Zhang, Eduardo,

> This patch provides auto disable/enable operation for boost. When any
> defined trip point is passed, the boost is disabled.
> In that moment thermal monitor workqueue is woken up and it monitors
> if the device temperature drops below 75% of the smallest trip point.
> When device cools down, the boost is enabled again.
> 
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Myungjoo Ham 
> 
> ---
> Changes for v6:
> - Disable boost only when supported and enabled
> - Protect boost related thermal_zone_device struct fields with mutex
> - Evaluate temperature trend during boost enable decision
> - Create separate methods to handle boost enable/disable
>   (thermal_boost_{enable|disable}) operations
> - Boost is disabled at any trip point passage (not only the non
> critical one)
> - Add stub definitions for cpufreq boost functions used when
>   CONFIG_CPU_FREQ is NOT defined.
> 
> Changes for v5:
> - Move boost disable code from cpu_cooling.c to thermal_core.c
>   (to handle_non_critical_trips)
> - Extent struct thermal_zone_device by adding overheated bool flag
> - Implement auto enable of boost after device cools down
> - Introduce boost_polling flag, which indicates if thermal uses it's
> predefined pool delay or has woken up thermal workqueue only to wait
> until device cools down.
> 
> Changes for v4:
> - New patch
> 

ping...

>  drivers/thermal/thermal_core.c |   55
> 
> include/linux/cpufreq.h|   15 +++
> include/linux/thermal.h|2 ++ 3 files changed, 72
> insertions(+)
> 
> diff --git a/drivers/thermal/thermal_core.c
> b/drivers/thermal/thermal_core.c index 1f02e8e..8f4be55 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -34,6 +34,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  
> @@ -354,9 +355,59 @@ static void handle_critical_trips(struct
> thermal_zone_device *tz, }
>  }
>  
> +static int thermal_boost_enable(struct thermal_zone_device *tz)
> +{
> + enum thermal_trend trend = get_tz_trend(tz, 0);
> + long trip_temp;
> +
> + if (!tz->ops->get_trip_temp || !tz->overheated)
> + return -EPERM;
> + if (trend == THERMAL_TREND_RAISING || trend ==
> THERMAL_TREND_RAISE_FULL)
> + return -EBUSY;
> +
> + tz->ops->get_trip_temp(tz, 0, &trip_temp);
> + /*
> +  * Enable boost again only when current temperature is less
> +  * than 75% of trip_temp[0]
> +  */
> + if ((tz->temperature + (trip_temp >> 2)) < trip_temp) {
> + mutex_lock(&tz->lock);
> + tz->overheated = false;
> + if (tz->boost_polling) {
> + tz->boost_polling = false;
> + tz->polling_delay = 0;
> + }
> + mutex_unlock(&tz->lock);
> + cpufreq_boost_trigger_state(1);
> + return 0;
> + }
> + return -EBUSY;
> +}
> +
> +static void thermal_boost_disable(struct thermal_zone_device *tz)
> +{
> + cpufreq_boost_trigger_state(0);
> +
> + /*
> +  * If no workqueue for monitoring is running - start one with
> +  * 1000 ms monitoring period
> +  * If workqueue already running - do not change its period
> and only
> +  * test if target CPU has cooled down
> +  */
> + mutex_lock(&tz->lock);
> + if (!tz->polling_delay) {
> + tz->boost_polling = true;
> + tz->polling_delay = 1000;
> + }
> + tz->overheated = true;
> + mutex_unlock(&tz->lock);
> +}
> +
>  static void handle_thermal_trip(struct thermal_zone_device *tz, int
> trip) {
>   enum thermal_trip_type type;
> + if (cpufreq_boost_supported() && cpufreq_boost_enabled())
> + thermal_boost_disable(tz);
>  
>   tz->ops->get_trip_type(tz, trip, &type);
>  
> @@ -455,6 +506,10 @@ static void thermal_zone_device_check(struct
> work_struct *work) struct thermal_zone_device *tz =
> container_of(work, struct thermal_zone_device,
> poll_queue.work);
> + if (cpufreq_boost_supported())
> + if (!thermal_boost_enable(tz))
> + return;
> +
>   thermal_zone_device_update(tz);
>  }
>  
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 49a73c9..3d9276d 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -435,9 +435,24 @@ int cpufreq_frequency_table_target(struct
> cpufreq_policy *policy, unsigned int relation,
>  unsigned int *index);
>  
> +#ifdef CONFIG_CPU_FREQ
>  int cpufreq_boost_trigger_state(int state);
>  int cpufreq_boost_supported(void);
>  int cpufreq_boost_enabled(void);
> +#else
> +static inline int cpufreq_boost_trigger_state(int state)
> +{
> + return 0;
> +}
> +static inline int cpufreq_boost_supported(void)
> +{
> + return 0;
> +}
> +static inline int cpufreq_boost_enabled(void)
> +{
>

Re: perf, percpu: panic in account_event

2013-08-12 Thread Peter Zijlstra
On Mon, Aug 05, 2013 at 05:19:18PM -0400, Sasha Levin wrote:
> Hi all,
> 
> While fuzzing with trinity inside a KVM tools guest running latest -next 
> kernel,
> I've stumbled on the following spew.
> 
> It seems to happen on the following line in account_event():
> 
>   if (event->attr.freq)
>   atomic_inc(&per_cpu(perf_freq_events, cpu));  <--- here
> 

Right, Frederic even send a fix for this already. I suppose holidays got
in the way of getting it merged quickly though, sorry for that.

Merged his fix, will hopefully get it into tip soon.
--
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 tty-next] n_tty: Fix termios_rwsem lockdep false positive

2013-08-12 Thread Artem Savkov
Hi Peter,

On Sun, Aug 11, 2013 at 08:04:23AM -0400, Peter Hurley wrote:
> Lockdep reports a circular lock dependency between
> atomic_read_lock and termios_rwsem [1]. However, a lock
> order deadlock is not possible since CPU1 only holds a
> read lock which cannot prevent CPU0 from also acquiring
> a read lock on the same r/w semaphore.
> 
> Unfortunately, lockdep cannot currently distinguish whether
> the locks are read or write for any particular lock graph,
> merely that the locks _were_ previously read and/or write.
> 
> Until lockdep is fixed, re-order atomic_read_lock so
> termios_rwsem can be dropped and reacquired without
> triggering lockdep.

Works fine, thanks.

Reported-and-tested-by: Artem Savkov 

> Reported-by: Artem Savkov 
> Reported-by: Sergey Senozhatsky 
> Signed-off-by: Peter Hurley 
> 
> [1] Initial lockdep report from Artem Savkov 
> 
>  ==
>  [ INFO: possible circular locking dependency detected ]
>  3.11.0-rc3-next-20130730+ #140 Tainted: GW
>  ---
>  bash/1198 is trying to acquire lock:
>   (&tty->termios_rwsem){..}, at: [] 
> n_tty_read+0x49b/0x660
> 
>  but task is already holding lock:
>   (&ldata->atomic_read_lock){+.+...}, at: [] 
> n_tty_read+0x1d0/0x660
> 
>  which lock already depends on the new lock.
> 
>  the existing dependency chain (in reverse order) is:
> 
>  -> #1 (&ldata->atomic_read_lock){+.+...}:
> [] validate_chain+0x73c/0x850
> [] __lock_acquire+0x500/0x5d0
> [] lock_acquire+0x179/0x1d0
> [] mutex_lock_interruptible_nested+0x7c/0x540
> [] n_tty_read+0x1d0/0x660
> [] tty_read+0x86/0xf0
> [] vfs_read+0xc3/0x130
> [] SyS_read+0x62/0xa0
> [] system_call_fastpath+0x16/0x1b
> 
>  -> #0 (&tty->termios_rwsem){..}:
> [] check_prev_add+0x14f/0x590
> [] validate_chain+0x73c/0x850
> [] __lock_acquire+0x500/0x5d0
> [] lock_acquire+0x179/0x1d0
> [] down_read+0x51/0xa0
> [] n_tty_read+0x49b/0x660
> [] tty_read+0x86/0xf0
> [] vfs_read+0xc3/0x130
> [] SyS_read+0x62/0xa0
> [] system_call_fastpath+0x16/0x1b
> 
>  other info that might help us debug this:
> 
>   Possible unsafe locking scenario:
> 
> CPU0CPU1
> 
>lock(&ldata->atomic_read_lock);
> lock(&tty->termios_rwsem);
> lock(&ldata->atomic_read_lock);
>lock(&tty->termios_rwsem);
> 
>   *** DEADLOCK ***
> 
>  2 locks held by bash/1198:
>   #0:  (&tty->ldisc_sem){.+.+.+}, at: [] 
> tty_ldisc_ref_wait+0x24/0x60
>   #1:  (&ldata->atomic_read_lock){+.+...}, at: [] 
> n_tty_read+0x1d0/0x660
> 
>  stack backtrace:
>  CPU: 1 PID: 1198 Comm: bash Tainted: GW3.11.0-rc3-next-20130730+ 
> #140
>  Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
>    880019acdb28 81d34074 0002
>    880019acdb78 8110ed75 880019acdb98
>   880019fd 880019acdb78 880019fd0638 880019fd0670
>  Call Trace:
>   [] dump_stack+0x59/0x7d
>   [] print_circular_bug+0x105/0x120
>   [] check_prev_add+0x14f/0x590
>   [] ? _raw_spin_unlock_irq+0x4f/0x70
>   [] validate_chain+0x73c/0x850
>   [] ? trace_hardirqs_off_caller+0x1f/0x190
>   [] __lock_acquire+0x500/0x5d0
>   [] lock_acquire+0x179/0x1d0
>   [] ? n_tty_read+0x49b/0x660
>   [] down_read+0x51/0xa0
>   [] ? n_tty_read+0x49b/0x660
>   [] n_tty_read+0x49b/0x660
>   [] ? try_to_wake_up+0x210/0x210
>   [] tty_read+0x86/0xf0
>   [] vfs_read+0xc3/0x130
>   [] SyS_read+0x62/0xa0
>   [] ? trace_hardirqs_on_thunk+0x3a/0x3f
>   [] system_call_fastpath+0x16/0x1b
> ---
>  drivers/tty/n_tty.c | 25 +++--
>  1 file changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
> index dd8ae0c..c9a9ddd 100644
> --- a/drivers/tty/n_tty.c
> +++ b/drivers/tty/n_tty.c
> @@ -2122,6 +2122,17 @@ static ssize_t n_tty_read(struct tty_struct *tty, 
> struct file *file,
>   if (c < 0)
>   return c;
>  
> + /*
> +  *  Internal serialization of reads.
> +  */
> + if (file->f_flags & O_NONBLOCK) {
> + if (!mutex_trylock(&ldata->atomic_read_lock))
> + return -EAGAIN;
> + } else {
> + if (mutex_lock_interruptible(&ldata->atomic_read_lock))
> + return -ERESTARTSYS;
> + }
> +
>   down_read(&tty->termios_rwsem);
>  
>   minimum = time = 0;
> @@ -2141,20 +2152,6 @@ static ssize_t n_tty_read(struct tty_struct *tty, 
> struct file *file,
>   }
>   }
>  
> - /*
> -  *  Internal serialization of reads.
> -  */
> - if (file->f_flags & O_NONBLOCK) {
> - if (!mutex_trylock(&ldata->atomic_read_lock)) {
> - up_read(&t

[PATCH] ftrace: Add initialization check in trace_printk for *puts paths

2013-08-12 Thread Jiri Olsa
Adding initialization check in trace_printk for *puts
paths, plus unifying the check for all related cases.

Cc: Steven Rostedt 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
---
 kernel/trace/trace.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 882ec1d..cb7cf96 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -126,6 +126,9 @@ static char *default_bootup_tracer;
 
 static bool allocate_snapshot;
 
+#define TRACE_PRINTK_DENIED \
+   unlikely(tracing_selftest_running || tracing_disabled)
+
 static int __init set_cmdline_ftrace(char *str)
 {
strlcpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
@@ -430,6 +433,9 @@ int __trace_puts(unsigned long ip, const char *str, int 
size)
unsigned long irq_flags;
int alloc;
 
+   if (TRACE_PRINTK_DENIED)
+   return 0;
+
alloc = sizeof(*entry) + size + 2; /* possible \n added */
 
local_save_flags(irq_flags);
@@ -470,6 +476,9 @@ int __trace_bputs(unsigned long ip, const char *str)
unsigned long irq_flags;
int size = sizeof(struct bputs_entry);
 
+   if (TRACE_PRINTK_DENIED)
+   return 0;
+
local_save_flags(irq_flags);
buffer = global_trace.trace_buffer.buffer;
event = trace_buffer_lock_reserve(buffer, TRACE_BPUTS, size,
@@ -1757,7 +1766,7 @@ void trace_dump_stack(int skip)
 {
unsigned long flags;
 
-   if (tracing_disabled || tracing_selftest_running)
+   if (TRACE_PRINTK_DENIED)
return;
 
local_save_flags(flags);
@@ -1976,7 +1985,7 @@ int trace_vbprintk(unsigned long ip, const char *fmt, 
va_list args)
char *tbuffer;
int len = 0, size, pc;
 
-   if (unlikely(tracing_selftest_running || tracing_disabled))
+   if (TRACE_PRINTK_DENIED)
return 0;
 
/* Don't pollute graph traces with trace_vprintk internals */
@@ -2032,7 +2041,7 @@ __trace_array_vprintk(struct ring_buffer *buffer,
unsigned long flags;
char *tbuffer;
 
-   if (tracing_disabled || tracing_selftest_running)
+   if (TRACE_PRINTK_DENIED)
return 0;
 
/* Don't pollute graph traces with trace_vprintk internals */
-- 
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] arm: omap5: dts: split SMPS10 dt node

2013-08-12 Thread Kishon Vijay Abraham I
SMPS10 has two outputs OUT1 and OUT2. Hence SMPS10 is modeled as
two regulators. The dt node is split to reflect it.

Signed-off-by: Kishon Vijay Abraham I 
---
 arch/arm/boot/dts/omap5-uevm.dts |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 65d7b60..05b9b12 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -334,9 +334,18 @@
ti,smps-range = <0x80>;
};
 
-   smps10_reg: smps10 {
+   smps10_out2_reg: smps10_out2 {
/* VBUS_5V_OTG */
-   regulator-name = "smps10";
+   regulator-name = "smps10_out2";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   regulator-always-on;
+   regulator-boot-on;
+   };
+
+   smps10_out1_reg: smps10_out1 {
+   /* VBUS_5V_OTG */
+   regulator-name = "smps10_out1";
regulator-min-microvolt = <500>;
regulator-max-microvolt = <500>;
regulator-always-on;
-- 
1.7.10.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/


Re: Non-enumerable devices on USB and other enumerable buses

2013-08-12 Thread Mark Brown
On Sun, Aug 11, 2013 at 09:53:01PM -0400, Alan Stern wrote:
> On Sun, 11 Aug 2013, Mark Brown wrote:

> > One example that's bugging me right now is that on the Insignal Arndale
> > platform there's a USB hub connected to one of the USB ports on the SoC
> > (not as a PHY, it seems we also need the internal PHY running to talk to
> > the device).  The hub needs to be "plugged" into the SoC after the SoC
> > USB controller has started with some GPIOs so we need to tell the system
> > that the hub exists and needs to be synchronised with the USB controller.

> On the surface, this seems like a particularly simple case.  Why wait 
> until the SoC's USB controller has started?  Why not "plug in" the hub 
> via the GPIOs right from the beginning?

I tried that, it doesn't seem to work - for some reason it seems that
the hub is only successfully enumerated if it starts after its parent is
running.  I don't know enough about USB to speculate on why that might
be, the GPIOs are brining the device out of reset not applying power or
anything.

> > Another case that's going to be problematic once it's in mainline is
> > Slimbus - this is a bus used in some embedded audio subsystems which is
> > enumerable in a similar manner to USB but where the devices on the bus
> > are normally powered up only on demand (causing them to hotplug when
> > used and unplug when idle) and have at least interrupt lines wired to
> > the SoC using a normal interrupt outside the enumerable bus.

> That is indeed more difficult, because it requires geniune cooperation 
> between the bus and platform subsystems.

Yeah.  You might want to do the same with for example a USB network
controller when you're in flight only mode, that seems to be one of the
more common reasons for doing this sort of thing with USB.


signature.asc
Description: Digital signature


Re: [PATCH v6 6/8] cpufreq:exynos:Extend Exynos cpufreq driver to support boost framework

2013-08-12 Thread Lukasz Majewski
On Fri, 26 Jul 2013 15:56:53 +0530 Viresh Kumar viresh.ku...@linaro.org
wrote,
> On 25 July 2013 22:03, Lukasz Majewski  wrote:
> 
> > diff --git a/drivers/cpufreq/exynos-cpufreq.c
> > b/drivers/cpufreq/exynos-cpufreq.c index 9ae1871..175172d9 100644
> > --- a/drivers/cpufreq/exynos-cpufreq.c
> > +++ b/drivers/cpufreq/exynos-cpufreq.c
> > @@ -270,6 +270,9 @@ static int exynos_cpufreq_cpu_exit(struct
> > cpufreq_policy *policy)
> >
> >  static struct freq_attr *exynos_cpufreq_attr[] = {
> > &cpufreq_freq_attr_scaling_available_freqs,
> > +#ifdef CONFIG_CPU_FREQ_BOOST_SW
> 
> Use ARM_EXYNOS_CPU_FREQ_BOOST_SW instead.

Ok, the ARM_EXYNOS_CPU_FREQ_BOOST_SW looks more appropriate here.

> 
> > +   &cpufreq_freq_attr_scaling_boost_freqs,
> > +#endif
> > NULL,
> >  };
> >
> > @@ -332,6 +335,9 @@ static int __init exynos_cpufreq_probe(struct
> > platform_device *pdev)
> >
> > locking_frequency = exynos_getspeed(0);
> >
> > +#ifdef CONFIG_CPU_FREQ_BOOST_SW
> > +   exynos_driver.boost_supported = true;
> > +#endif
> 
> So, why here and not in the definition of exynos_driver?

Ok, I will move the above code to struct cpufreq_driver exynos_driver

> 
> > register_pm_notifier(&exynos_cpufreq_nb);
> >
> > if (cpufreq_register_driver(&exynos_driver)) {
> > --
> > 1.7.10.4
> >



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform 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: WARNING: CPU: 26 PID: 93793 at fs/ext4/inode.c:230 ext4_evict_inode+0x4c9/0x500 [ext4]() still in 3.11-rc3

2013-08-12 Thread Jan Kara
On Wed 07-08-13 14:07:43, Davidlohr Bueso wrote:
> On Wed, 2013-08-07 at 20:45 +0200, Jan Kara wrote:
> > On Wed 07-08-13 11:08:43, Davidlohr Bueso wrote:
> > > Hi Jan,
> > > 
> > > On Wed, 2013-08-07 at 17:20 +0200, Jan Kara wrote:
> > > > On Thu 01-08-13 20:58:46, Davidlohr Bueso wrote:
> > > > > On Thu, 2013-08-01 at 22:33 +0200, Jan Kara wrote:
> > > > > >   Hi,
> > > > > > 
> > > > > > On Thu 01-08-13 13:14:19, Davidlohr Bueso wrote:
> > > > > > > FYI I'm seeing loads of the following messages with Linus' latest
> > > > > > > 3.11-rc3 (which includes 822dbba33458cd6ad)
> > > > > >   Thanks for notice. I see you are running reaim to trigger this. 
> > > > > > What
> > > > > > workload?
> > > > > 
> > > > > After re-running the workloads one by one, I finally hit the issue 
> > > > > again
> > > > > with 'dbase'. FWIW I'm using ramdisks + ext4.
> > > >   Hum, I'm not able to reproduce this with current Linus' kernel - 
> > > > commit
> > > > e4ef108fcde0b97ed38923ba1ea06c7a152bab9e - I've tried with ramdisk but 
> > > > no
> > > > luck. Are you using some special mount options?
> > > > 
> > > 
> > > I just hit the issue again with today's latest pull, 3.11-rc4 (which has
> > > e4ef108fcde0b97ed38923ba1ea06c7a152bab9e as of yesterday). I create the
> > > fs with "-b 4096 -J size=4", and mount it with
> > > "journal_async_commit,nobarrier,async,noatime,nodiratime"
> >   Still no success :(.
> > 
> > > I cannot really think of any additional info I can give you, but if you
> > > think of something else just shout :)
> >   Maybe what's your reaim.config? And what is fs size and machine config?
> 
> The machine is an 8 socket, 80 core, 256Gb RAM, HP DL980 server. No
> special storage being used. Attached is the reaim.config and
> workfile.dbase files.
  This is curious. I was trying really hard even on a similar machine
(well, about half of your size) but no luck with reproducing the warning
you see. OTOH I was getting a *flood* of warnings from
ext4_da_update_reserve_space() - I've fixed that up and posted patch to
linux-ext4 (ext4: Fix warning in ext4_da_update_reserve_space()).

Honza
> 
> Thanks,
> Davidlohr
> 
> > 
> > Honza
> > 
> > 
> > > > > > > [ cut here ]
> > > > > > > WARNING: CPU: 26 PID: 93793 at fs/ext4/inode.c:230 
> > > > > > > ext4_evict_inode+0x4c9/0x500 [ext4]()
> > > > > > > Modules linked in: autofs4 cpufreq_ondemand freq_table sunrpc 
> > > > > > > 8021q garp stp llc pcc_cpufreq ipt_REJECT nf_conntrack_ipv4 
> > > > > > > nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT 
> > > > > > > nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack 
> > > > > > > ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log 
> > > > > > > dm_mod uinput iTCO_wdt iTCO_vendor_support coretemp kvm_intel kvm 
> > > > > > > crc32c_intel ghash_clmulni_intel microcode pcspkr sg lpc_ich 
> > > > > > > mfd_core hpilo hpwdt i7core_edac edac_core netxen_nic mperf ext4 
> > > > > > > jbd2 mbcache sd_mod crc_t10dif aesni_intel ablk_helper cryptd lrw 
> > > > > > > gf128mul glue_helper aes_x86_64 hpsa radeon ttm drm_kms_helper 
> > > > > > > drm i2c_algo_bit i2c_core [last unloaded: freq_table]
> > > > > > > CPU: 26 PID: 93793 Comm: reaim Tainted: GW3.11.0-rc3+ 
> > > > > > > #1
> > > > > > > Hardware name: HP ProLiant DL980 G7, BIOS P66 06/24/2011
> > > > > > >  00e6 8985db603d78 8153ce4d 
> > > > > > > 00e6
> > > > > > >   8985db603db8 8104cf1c 
> > > > > > > 8985db603dc8
> > > > > > >  8b05c485b8b0 8b05c485b9b8 8b05c485b800 
> > > > > > > ff9c
> > > > > > > Call Trace:
> > > > > > >  [] dump_stack+0x49/0x5c
> > > > > > >  [] warn_slowpath_common+0x8c/0xc0
> > > > > > >  [] warn_slowpath_null+0x1a/0x20
> > > > > > >  [] ext4_evict_inode+0x4c9/0x500 [ext4]
> > > > > > >  [] evict+0xa7/0x1c0
> > > > > > >  [] iput_final+0xe3/0x170
> > > > > > >  [] iput+0x3e/0x50
> > > > > > >  [] do_unlinkat+0x1c6/0x280
> > > > > > >  [] ? task_work_run+0x94/0xf0
> > > > > > >  [] ? do_notify_resume+0x84/0x90
> > > > > > >  [] SyS_unlink+0x16/0x20
> > > > > > >  [] system_call_fastpath+0x16/0x1b
> > > > > > > ---[ end trace 15e812809616488b ]---
> > > > > > > 
> > > > > > > 
> > > > > 
> > > > > 
> > > 
> > > 
> 

> # Sample configuration file for the reaim workload
> # cliff white, OSDL 4/2003
> #
> # This is a comment (duh)
> # all variables are named in UPPER CASE, unless you want
> # to write a better option parser. Send me a patch
> # I'm keeping this, but not used yet
> #
> # The disk tests in the AIM-7 test consist of three groups:
> # basic block I/O tests, the same tests with an added sync,
> # and the sync I/O tests. Each test determines file size from a
> # global variable, disk_iteration_count.
> # 
> # There are two configuration variables that control this,
> 

Re: [PATCH] ftrace: Add initialization check in trace_printk for *puts paths

2013-08-12 Thread zhangwei(Jovi)
On 2013/8/12 17:34, Jiri Olsa wrote:
> Adding initialization check in trace_printk for *puts
> paths, plus unifying the check for all related cases.
> 
> Cc: Steven Rostedt 
> Cc: Frederic Weisbecker 
> Cc: Ingo Molnar 
> ---
Missed Signed-off-by tag?

>  kernel/trace/trace.c | 15 ---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 882ec1d..cb7cf96 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -126,6 +126,9 @@ static char *default_bootup_tracer;
>  
>  static bool allocate_snapshot;
>  
> +#define TRACE_PRINTK_DENIED \
> + unlikely(tracing_selftest_running || tracing_disabled)
> +
>  static int __init set_cmdline_ftrace(char *str)
>  {
>   strlcpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
> @@ -430,6 +433,9 @@ int __trace_puts(unsigned long ip, const char *str, int 
> size)
>   unsigned long irq_flags;
>   int alloc;
>  
> + if (TRACE_PRINTK_DENIED)
> + return 0;
> +
>   alloc = sizeof(*entry) + size + 2; /* possible \n added */
>  
>   local_save_flags(irq_flags);
> @@ -470,6 +476,9 @@ int __trace_bputs(unsigned long ip, const char *str)
>   unsigned long irq_flags;
>   int size = sizeof(struct bputs_entry);
>  
> + if (TRACE_PRINTK_DENIED)
> + return 0;
> +
>   local_save_flags(irq_flags);
>   buffer = global_trace.trace_buffer.buffer;
>   event = trace_buffer_lock_reserve(buffer, TRACE_BPUTS, size,
> @@ -1757,7 +1766,7 @@ void trace_dump_stack(int skip)
>  {
>   unsigned long flags;
>  
> - if (tracing_disabled || tracing_selftest_running)
> + if (TRACE_PRINTK_DENIED)
>   return;
>  
>   local_save_flags(flags);
> @@ -1976,7 +1985,7 @@ int trace_vbprintk(unsigned long ip, const char *fmt, 
> va_list args)
>   char *tbuffer;
>   int len = 0, size, pc;
>  
> - if (unlikely(tracing_selftest_running || tracing_disabled))
> + if (TRACE_PRINTK_DENIED)
>   return 0;
>  
>   /* Don't pollute graph traces with trace_vprintk internals */
> @@ -2032,7 +2041,7 @@ __trace_array_vprintk(struct ring_buffer *buffer,
>   unsigned long flags;
>   char *tbuffer;
>  
> - if (tracing_disabled || tracing_selftest_running)
> + if (TRACE_PRINTK_DENIED)
>   return 0;
>  
>   /* Don't pollute graph traces with trace_vprintk internals */
> 


--
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] arm: spear: platsmp: fix lock definition

2013-08-12 Thread Sebastian Andrzej Siewior
* Felipe Balbi | 2013-08-01 16:54:24 [+0300]:
>
>compile tested only, I don't have any spear boards.
>
>But at least solves the argument error compile warnings.

looks very correct :) Applied and folded back into the original patch.

Sebastian
--
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/6] Staging: winbond: wb35reg: changed sleep function from msleep to usleep

2013-08-12 Thread Pavel Machek
On Mon 2013-08-05 11:58:27, Iker Pedrosa wrote:
> Changed sleep function from msleep to usleep according to the documentation.
> 
> Signed-off-by: Iker Pedrosa 

Can you explain why this is good idea?

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.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/6] Staging: winbond: wb35reg: avoided use of extern function

2013-08-12 Thread Pavel Machek
On Mon 2013-08-05 11:58:29, Iker Pedrosa wrote:
> Prototype of a function added to the header to avoid the use of extern.
> 
> Signed-off-by: Iker Pedrosa 

ACK.

> ---
>  drivers/staging/winbond/phy_calibration.h | 1 +
>  drivers/staging/winbond/wb35reg.c | 3 +--
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/winbond/phy_calibration.h 
> b/drivers/staging/winbond/phy_calibration.h
> index 84f6e84..78fc680 100644
> --- a/drivers/staging/winbond/phy_calibration.h
> +++ b/drivers/staging/winbond/phy_calibration.h
> @@ -79,6 +79,7 @@
>  #define SHIFT_IQCAL_TONE_Q(x)((x) >> 13)
>  
>  void phy_set_rf_data(struct hw_data *pHwData, u32 index, u32 value);
> +void phy_calibration_winbond(struct hw_data *phw_data, u32 frequency);
>  #define phy_init_rf(_A)  /* RFSynthesizer_initial(_A) */
>  
>  #endif
> diff --git a/drivers/staging/winbond/wb35reg.c 
> b/drivers/staging/winbond/wb35reg.c
> index 1314f93..a500904 100644
> --- a/drivers/staging/winbond/wb35reg.c
> +++ b/drivers/staging/winbond/wb35reg.c
> @@ -1,10 +1,9 @@
>  #include "wb35reg_f.h"
> +#include "phy_calibration.h"
>  
>  #include 
>  #include 
>  
> -extern void phy_calibration_winbond(struct hw_data *phw_data, u32 frequency);
> -
>  /*
>   * true  : read command process successfully
>   * false : register not support

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.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 4/6] Staging: winbond: mds: fixed some lines over 80 characters

2013-08-12 Thread Pavel Machek
On Mon 2013-08-05 11:58:30, Iker Pedrosa wrote:
> Fixed some coding style issues
> 
> Signed-off-by: Iker Pedrosa 

ACK.

> ---
>  drivers/staging/winbond/mds.c | 56 
> +--
>  1 file changed, 33 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/staging/winbond/mds.c b/drivers/staging/winbond/mds.c
> index faa93f0..fcc3d21 100644
> --- a/drivers/staging/winbond/mds.c
> +++ b/drivers/staging/winbond/mds.c
> @@ -15,7 +15,8 @@ Mds_initial(struct wbsoft_priv *adapter)
>   return hal_get_tx_buffer(&adapter->sHwData, &pMds->pTxBuffer);
>  }
>  
> -static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct 
> wb35_descriptor *pDes,  u8 *buffer)
> +static void Mds_DurationSet(struct wbsoft_priv *adapter,
> + struct wb35_descriptor *pDes, u8 *buffer)
>  {
>   struct T00_descriptor *pT00;
>   struct T01_descriptor *pT01;
> @@ -43,10 +44,11 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  
> struct wb35_descriptor
>* Set RTS/CTS mechanism
>**/
>   if (!boGroupAddr) {
> - /* NOTE : If the protection mode is enabled and the MSDU will 
> be fragmented,
> -  *   the tx rates of MPDUs will all be DSSS rates. 
> So it will not use
> -  *   CTS-to-self in this case. CTS-To-self will 
> only be used when without
> -  *   fragmentation. -- 20050112 */
> + /* NOTE : If the protection mode is enabled and the MSDU will
> +  *be fragmented, the tx rates of MPDUs will all be DSSS
> +  *rates. So it will not use CTS-to-self in this case.
> +  *CTS-To-self will only be used when without
> +  *fragmentation. -- 20050112 */
>   BodyLen = (u16)pT00->T00_frame_length;  /* include 802.11 
> header */
>   BodyLen += 4;   /* CRC */
>  
> @@ -90,8 +92,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  
> struct wb35_descriptor
>* CTS Rate : 24 Mega bps
>* CTS frame length = 14 bytes */
>   Duration += (DEFAULT_SIFSTIME +
> - 
> PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION +
> - ((112 + 22 + 
> 95)/96)*Tsym);
> + 
> PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION +
> + ((112 + 22 + 95)/96)*Tsym);
>   } else {
>   /* CTS + 1 SIFS + CTS duration
>* CTS Rate : ?? Mega bps
> @@ -101,7 +103,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  
> struct wb35_descriptor
>   else
>   Duration += 
> SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME;
>  
> - Duration += (((112 + Rate-1) / Rate) + 
> DEFAULT_SIFSTIME);
> + Duration += (((112 + Rate-1) / Rate) +
> +  DEFAULT_SIFSTIME);
>   }
>   }
>  
> @@ -127,9 +130,10 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, 
>  struct wb35_descriptor
>*  Rate : ??Mega bps
>*  ACK frame length = 14 bytes, tx rate = 24M 
> */
>   Duration = 
> PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION * 3;
> - Duration += (((NextBodyLen*8 + 22 + Rate*4 - 
> 1)/(Rate*4)) * Tsym +
> - (((2*14)*8 + 22 + 
> 95)/96)*Tsym +
> - DEFAULT_SIFSTIME*3);
> + Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)
> +  /(Rate*4)) * Tsym +
> +  (((2*14)*8 + 22 + 95)/96)*Tsym +
> + DEFAULT_SIFSTIME*3);
>   } else {
>   /* DSSS
>*  data transmit time + 2 ACK + 3 SIFS
> @@ -141,8 +145,9 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  
> struct wb35_descriptor
>   else
>   Duration = 
> SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME*3;
>  
> - Duration += (((NextBodyLen + (2*14))*8 + 
> Rate-1) / Rate +
> - DEFAULT_SIFSTIME*3);
> + Duration += (((NextBodyLen + (2*14))*8
> +  + Rate-1) / Rate +
> + DEFAULT_SIFSTIME*3);
>   }

Re: [PATCH 2/6] Staging: winbond: wb35reg: white space deleted

2013-08-12 Thread Pavel Machek
On Mon 2013-08-05 11:58:28, Iker Pedrosa wrote:
> White space deleted before a semicolon.
> 
> Signed-off-by: Iker Pedrosa 

ACK.

> ---
>  drivers/staging/winbond/wb35reg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/winbond/wb35reg.c 
> b/drivers/staging/winbond/wb35reg.c
> index 34a2618..1314f93 100644
> --- a/drivers/staging/winbond/wb35reg.c
> +++ b/drivers/staging/winbond/wb35reg.c
> @@ -44,7 +44,7 @@ unsigned char Wb35Reg_BurstWrite(struct hw_data *pHwData, 
> u16 RegisterNo, u32 *p
>   reg_queue->pBuffer = (u32 *)((u8 *)reg_queue + sizeof(struct 
> wb35_reg_queue));
>   memcpy(reg_queue->pBuffer, pRegisterData, DataSize);
>   /* the function for reversing register data from little endian to big 
> endian */
> - for (i = 0; i < NumberOfData ; i++)
> + for (i = 0; i < NumberOfData; i++)
>   reg_queue->pBuffer[i] = cpu_to_le32(reg_queue->pBuffer[i]);
>  
>   dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct 
> wb35_reg_queue) + DataSize);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.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] ftrace: Add initialization check in trace_printk for *puts paths

2013-08-12 Thread Jiri Olsa
On Mon, Aug 12, 2013 at 06:01:55PM +0800, zhangwei(Jovi) wrote:
> On 2013/8/12 17:34, Jiri Olsa wrote:
> > Adding initialization check in trace_printk for *puts
> > paths, plus unifying the check for all related cases.
> > 
> > Cc: Steven Rostedt 
> > Cc: Frederic Weisbecker 
> > Cc: Ingo Molnar 
> > ---
> Missed Signed-off-by tag?

rgh... yes ;-) thanks

Signed-off-by: Jiri Olsa 
--
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 5/6] Staging: winbond: mds_f: fixed lines over 80 characters

2013-08-12 Thread Pavel Machek
On Mon 2013-08-05 11:58:31, Iker Pedrosa wrote:
> Fixed some coding style issues.
> 
> Signed-off-by: Iker Pedrosa 

ACK.

> ---
>  drivers/staging/winbond/mds_f.h | 12 
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/winbond/mds_f.h b/drivers/staging/winbond/mds_f.h
> index ce8be07..ce5a78c 100644
> --- a/drivers/staging/winbond/mds_f.h
> +++ b/drivers/staging/winbond/mds_f.h
> @@ -7,13 +7,17 @@
>  unsigned char Mds_initial(struct wbsoft_priv *adapter);
>  void Mds_Tx(struct wbsoft_priv *adapter);
>  void Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor 
> *pt02);
> -void Mds_MpduProcess(struct wbsoft_priv *adapter, struct wb35_descriptor 
> *prxdes);
> +void Mds_MpduProcess(struct wbsoft_priv *adapter,
> +  struct wb35_descriptor *prxdes);
>  extern void DataDmp(u8 *pdata, u32 len, u32 offset);
>  
>  /* For data frame sending */
>  u16 MDS_GetPacketSize(struct wbsoft_priv *adapter);
> -void MDS_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor 
> *pdes);
> -void MDS_GetNextPacketComplete(struct wbsoft_priv *adapter, struct 
> wb35_descriptor *pdes);
> -void MDS_SendResult(struct wbsoft_priv *adapter, u8 packetid, unsigned char 
> sendok);
> +void MDS_GetNextPacket(struct wbsoft_priv *adapter,
> +struct wb35_descriptor *pdes);
> +void MDS_GetNextPacketComplete(struct wbsoft_priv *adapter,
> +struct wb35_descriptor *pdes);
> +void MDS_SendResult(struct wbsoft_priv *adapter, u8 packetid,
> + unsigned char sendok);
>  
>  #endif

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.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 6/6] Staging: winbond: mds_f: deleted extern function

2013-08-12 Thread Pavel Machek
On Mon 2013-08-05 11:58:32, Iker Pedrosa wrote:
> Deleted an extern function that wasn't used in this driver.
> 
> Signed-off-by: Iker Pedrosa 

ACK.

> ---
>  drivers/staging/winbond/mds_f.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/winbond/mds_f.h b/drivers/staging/winbond/mds_f.h
> index ce5a78c..159b2eb 100644
> --- a/drivers/staging/winbond/mds_f.h
> +++ b/drivers/staging/winbond/mds_f.h
> @@ -9,7 +9,6 @@ void Mds_Tx(struct wbsoft_priv *adapter);
>  void Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor 
> *pt02);
>  void Mds_MpduProcess(struct wbsoft_priv *adapter,
>struct wb35_descriptor *prxdes);
> -extern void DataDmp(u8 *pdata, u32 len, u32 offset);
>  
>  /* For data frame sending */
>  u16 MDS_GetPacketSize(struct wbsoft_priv *adapter);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.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 17/18] spi: s3c64xx: Always select S3C64XX_PL080 when ARCH_S3C64XX is enabled

2013-08-12 Thread Mark Brown
On Mon, Aug 12, 2013 at 01:03:19AM +0200, Tomasz Figa wrote:
> On Sunday 11 of August 2013 20:11:40 Mark Brown wrote:

> > Do we need the select here (or should we have other selects for the
> > Exynos SoCs)?

> The driver would build fine without this symbol selected, but since it 
> relies on availability of DMA, it doesn't make too much sense to build it 
> this way. This kind of selects makes kernel configuration more user 
> friendly IMHO.

> Possibly adding appropriate selects (PL330) for s5p* and exynos could make 
> sense.

Right.  On these SoCs it's probably worth doing it in the arch/arm code
rather than for every device using the controller though, it's the same
DMA controller for everything.


signature.asc
Description: Digital signature


[tip:perf/core] perf tools: Add support for parsing PERF_SAMPLE_READ sample type

2013-08-12 Thread tip-bot for Jiri Olsa
Commit-ID:  9ede473cc9f655f8a10cfc8ebbf04c48d84db7ee
Gitweb: http://git.kernel.org/tip/9ede473cc9f655f8a10cfc8ebbf04c48d84db7ee
Author: Jiri Olsa 
AuthorDate: Wed, 10 Oct 2012 17:38:13 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:20 -0300

perf tools: Add support for parsing PERF_SAMPLE_READ sample type

Adding support to parse out the PERF_SAMPLE_READ sample bits.  The code
contains both single and group format specification.

This code parse out and prepare PERF_SAMPLE_READ data into the
perf_sample struct. It will be used for group leader sampling feature
comming in shortly.

Signed-off-by: Jiri Olsa 
Acked-by: Namhyung Kim 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Link: http://lkml.kernel.org/n/tip-0tgdoln5rwk3wocshb442...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/event.h   | 18 ++
 tools/perf/util/evlist.c  | 26 ++
 tools/perf/util/evlist.h  |  2 ++
 tools/perf/util/evsel.c   | 30 --
 tools/perf/util/session.c | 38 ++
 5 files changed, 112 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 1ebb8fb..6119a64 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -80,6 +80,23 @@ struct stack_dump {
char *data;
 };
 
+struct sample_read_value {
+   u64 value;
+   u64 id;
+};
+
+struct sample_read {
+   u64 time_enabled;
+   u64 time_running;
+   union {
+   struct {
+   u64 nr;
+   struct sample_read_value *values;
+   } group;
+   struct sample_read_value one;
+   };
+};
+
 struct perf_sample {
u64 ip;
u32 pid, tid;
@@ -97,6 +114,7 @@ struct perf_sample {
struct branch_stack *branch_stack;
struct regs_dump  user_regs;
struct stack_dump user_stack;
+   struct sample_read read;
 };
 
 #define PERF_MEM_DATA_SRC_NONE \
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 0d3b739..df77a44 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -676,6 +676,32 @@ u64 perf_evlist__sample_type(struct perf_evlist *evlist)
return first->attr.sample_type;
 }
 
+bool perf_evlist__valid_read_format(struct perf_evlist *evlist)
+{
+   struct perf_evsel *first = perf_evlist__first(evlist), *pos = first;
+   u64 read_format = first->attr.read_format;
+   u64 sample_type = first->attr.sample_type;
+
+   list_for_each_entry_continue(pos, &evlist->entries, node) {
+   if (read_format != pos->attr.read_format)
+   return false;
+   }
+
+   /* PERF_SAMPLE_READ imples PERF_FORMAT_ID. */
+   if ((sample_type & PERF_SAMPLE_READ) &&
+   !(read_format & PERF_FORMAT_ID)) {
+   return false;
+   }
+
+   return true;
+}
+
+u64 perf_evlist__read_format(struct perf_evlist *evlist)
+{
+   struct perf_evsel *first = perf_evlist__first(evlist);
+   return first->attr.read_format;
+}
+
 u16 perf_evlist__id_hdr_size(struct perf_evlist *evlist)
 {
struct perf_evsel *first = perf_evlist__first(evlist);
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 0583d36..c7178b7 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -118,6 +118,7 @@ int perf_evlist__apply_filters(struct perf_evlist *evlist);
 void __perf_evlist__set_leader(struct list_head *list);
 void perf_evlist__set_leader(struct perf_evlist *evlist);
 
+u64 perf_evlist__read_format(struct perf_evlist *evlist);
 u64 perf_evlist__sample_type(struct perf_evlist *evlist);
 bool perf_evlist__sample_id_all(struct perf_evlist *evlist);
 u16 perf_evlist__id_hdr_size(struct perf_evlist *evlist);
@@ -127,6 +128,7 @@ int perf_evlist__parse_sample(struct perf_evlist *evlist, 
union perf_event *even
 
 bool perf_evlist__valid_sample_type(struct perf_evlist *evlist);
 bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist);
+bool perf_evlist__valid_read_format(struct perf_evlist *evlist);
 
 void perf_evlist__splice_list_tail(struct perf_evlist *evlist,
   struct list_head *list,
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 8bed0c1..9ab8fff 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1096,8 +1096,34 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, 
union perf_event *event,
}
 
if (type & PERF_SAMPLE_READ) {
-   fprintf(stderr, "PERF_SAMPLE_READ is unsupported for now\n");
-   return -1;
+   u64 read_format = evsel->attr.read_format;
+
+   if (read_format & PERF_FORMAT_GROUP)
+   data->read.group.nr = *array;
+   else
+   data->read.one.value = *array;
+

[tip:perf/core] perf: Add PERF_EVENT_IOC_ID ioctl to return event ID

2013-08-12 Thread tip-bot for Jiri Olsa
Commit-ID:  cf4957f17f2a89984915ea808876d9c82225b862
Gitweb: http://git.kernel.org/tip/cf4957f17f2a89984915ea808876d9c82225b862
Author: Jiri Olsa 
AuthorDate: Wed, 24 Oct 2012 13:37:58 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:19 -0300

perf: Add PERF_EVENT_IOC_ID ioctl to return event ID

The only way to get the event ID is by reading the event fd,
followed by parsing the ID value out of the returned data.

While this is ok for current read format used by perf tool,
it is not ok when we use PERF_FORMAT_GROUP format.

With this format the data are returned for the whole group
and there's no way to find out what ID belongs to our fd
(if we are not group leader event).

Adding a simple ioctl that returns event primary ID for given fd.

Signed-off-by: Jiri Olsa 
Acked-by: Namhyung Kim 
Acked-by: Peter Zijlstra 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Link: http://lkml.kernel.org/n/tip-v1bn5cto707jn0bon34af...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 include/uapi/linux/perf_event.h | 1 +
 kernel/events/core.c| 9 +
 2 files changed, 10 insertions(+)

diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index efef1d3..62c25a2 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -321,6 +321,7 @@ struct perf_event_attr {
 #define PERF_EVENT_IOC_PERIOD  _IOW('$', 4, __u64)
 #define PERF_EVENT_IOC_SET_OUTPUT  _IO ('$', 5)
 #define PERF_EVENT_IOC_SET_FILTER  _IOW('$', 6, char *)
+#define PERF_EVENT_IOC_ID  _IOR('$', 7, u64 *)
 
 enum perf_event_ioc_flags {
PERF_IOC_FLAG_GROUP = 1U << 0,
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 916cf1f..5200b60 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3568,6 +3568,15 @@ static long perf_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
case PERF_EVENT_IOC_PERIOD:
return perf_event_period(event, (u64 __user *)arg);
 
+   case PERF_EVENT_IOC_ID:
+   {
+   u64 id = primary_event_id(event);
+
+   if (copy_to_user((void __user *)arg, &id, sizeof(id)))
+   return -EFAULT;
+   return 0;
+   }
+
case PERF_EVENT_IOC_SET_OUTPUT:
{
int ret;
--
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:perf/core] perf evsel: Add PERF_SAMPLE_READ sample related processing

2013-08-12 Thread tip-bot for Jiri Olsa
Commit-ID:  e4caec0d1af3d608d52e6b92d09fb862d7691d4b
Gitweb: http://git.kernel.org/tip/e4caec0d1af3d608d52e6b92d09fb862d7691d4b
Author: Jiri Olsa 
AuthorDate: Wed, 10 Oct 2012 18:52:24 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:22 -0300

perf evsel: Add PERF_SAMPLE_READ sample related processing

For sample with sample type PERF_SAMPLE_READ the period value is stored
in the 'struct sample_read'.

Moreover if the read format has PERF_FORMAT_GROUP, the 'struct
sample_read' contains period values for all events in the group (for
which the sample's event is a leader).

We deliver separated samples for all the values contained within the
'struct sample_read'.

Signed-off-by: Jiri Olsa 
Acked-by: Namhyung Kim 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Link: http://lkml.kernel.org/n/tip-6mdm5xkrm6kypouh1c33c...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/evsel.h   |  3 ++
 tools/perf/util/session.c | 72 ++-
 2 files changed, 74 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 3f156cc..6a2cf26 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -38,6 +38,9 @@ struct perf_sample_id {
struct hlist_node   node;
u64 id;
struct perf_evsel   *evsel;
+
+   /* Holds total ID period value for PERF_SAMPLE_READ processing. */
+   u64 period;
 };
 
 /** struct perf_evsel - event selector
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index f082921..9247d9c 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -860,6 +860,75 @@ static struct machine *
return &session->machines.host;
 }
 
+static int deliver_sample_value(struct perf_session *session,
+   struct perf_tool *tool,
+   union perf_event *event,
+   struct perf_sample *sample,
+   struct sample_read_value *v,
+   struct machine *machine)
+{
+   struct perf_sample_id *sid;
+
+   sid = perf_evlist__id2sid(session->evlist, v->id);
+   if (sid) {
+   sample->id = v->id;
+   sample->period = v->value - sid->period;
+   sid->period= v->value;
+   }
+
+   if (!sid || sid->evsel == NULL) {
+   ++session->stats.nr_unknown_id;
+   return 0;
+   }
+
+   return tool->sample(tool, event, sample, sid->evsel, machine);
+}
+
+static int deliver_sample_group(struct perf_session *session,
+   struct perf_tool *tool,
+   union  perf_event *event,
+   struct perf_sample *sample,
+   struct machine *machine)
+{
+   int ret = -EINVAL;
+   u64 i;
+
+   for (i = 0; i < sample->read.group.nr; i++) {
+   ret = deliver_sample_value(session, tool, event, sample,
+  &sample->read.group.values[i],
+  machine);
+   if (ret)
+   break;
+   }
+
+   return ret;
+}
+
+static int
+perf_session__deliver_sample(struct perf_session *session,
+struct perf_tool *tool,
+union  perf_event *event,
+struct perf_sample *sample,
+struct perf_evsel *evsel,
+struct machine *machine)
+{
+   /* We know evsel != NULL. */
+   u64 sample_type = evsel->attr.sample_type;
+   u64 read_format = evsel->attr.read_format;
+
+   /* Standard sample delievery. */
+   if (!(sample_type & PERF_SAMPLE_READ))
+   return tool->sample(tool, event, sample, evsel, machine);
+
+   /* For PERF_SAMPLE_READ we have either single or group mode. */
+   if (read_format & PERF_FORMAT_GROUP)
+   return deliver_sample_group(session, tool, event, sample,
+   machine);
+   else
+   return deliver_sample_value(session, tool, event, sample,
+   &sample->read.one, machine);
+}
+
 static int perf_session_deliver_event(struct perf_session *session,
  union perf_event *event,
  struct perf_sample *sample,
@@ -902,7 +971,8 @@ static int perf_session_deliver_event(struct perf_session 
*session,
++session->stats.nr_unprocessable_samples;
return 0;
}
-   return tool->sample(tool, event, sample, evsel, machine);
+   return perf_session__deliver_sample(session, tool, eve

[tip:perf/core] perf tests: Add attr record group sampling test

2013-08-12 Thread tip-bot for Jiri Olsa
Commit-ID:  8404db63461af62025f32f8368861fb33604e62f
Gitweb: http://git.kernel.org/tip/8404db63461af62025f32f8368861fb33604e62f
Author: Jiri Olsa 
AuthorDate: Fri, 1 Feb 2013 19:33:31 +0100
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:23 -0300

perf tests: Add attr record group sampling test

Adding test to validate perf_event_attr data for command:

  'record -e '{cycles,cache-misses}:S'

Signed-off-by: Jiri Olsa 
Acked-by: Namhyung Kim 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Link: http://lkml.kernel.org/n/tip-9eppxvhkly6gse5ximudc...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/tests/attr/test-record-group-sampling | 36 
 1 file changed, 36 insertions(+)

diff --git a/tools/perf/tests/attr/test-record-group-sampling 
b/tools/perf/tests/attr/test-record-group-sampling
new file mode 100644
index 000..658f5d6
--- /dev/null
+++ b/tools/perf/tests/attr/test-record-group-sampling
@@ -0,0 +1,36 @@
+[config]
+command = record
+args= -e '{cycles,cache-misses}:S' kill >/dev/null 2>&1
+
+[event-1:base-record]
+fd=1
+group_fd=-1
+sample_type=343
+read_format=12
+inherit=0
+
+[event-2:base-record]
+fd=2
+group_fd=1
+
+# cache-misses
+type=0
+config=3
+
+# default | PERF_SAMPLE_READ
+sample_type=343
+
+# PERF_FORMAT_ID | PERF_FORMAT_GROUP
+read_format=12
+
+mmap=0
+comm=0
+enable_on_exec=0
+disabled=0
+
+# inherit is disabled for group sampling
+inherit=0
+
+# sampling disabled
+sample_freq=0
+sample_period=0
--
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:perf/core] perf tests: Add parse events tests for leader sampling

2013-08-12 Thread tip-bot for Jiri Olsa
Commit-ID:  a9f93f97424c64f8d5d94b653a2133e491498680
Gitweb: http://git.kernel.org/tip/a9f93f97424c64f8d5d94b653a2133e491498680
Author: Jiri Olsa 
AuthorDate: Fri, 1 Feb 2013 20:37:11 +0100
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:23 -0300

perf tests: Add parse events tests for leader sampling

Adding 2 more tests to the automated parse events suite for following
event config:

  '{cycles,cache-misses,branch-misses}:S'
  '{instructions,branch-misses}:Su'

Signed-off-by: Jiri Olsa 
Acked-by: Namhyung Kim 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Link: http://lkml.kernel.org/n/tip-tmcy0ir7i8id2t54qg5if...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/tests/parse-events.c | 115 
 1 file changed, 115 insertions(+)

diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 344c844..b46379c 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -520,6 +520,7 @@ static int test__group1(struct perf_evlist *evlist)
TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel));
TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2);
TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0);
+   TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
 
/* cycles:upp */
evsel = perf_evsel__next(evsel);
@@ -535,6 +536,7 @@ static int test__group1(struct perf_evlist *evlist)
TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 2);
TEST_ASSERT_VAL("wrong leader", evsel->leader == leader);
TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1);
+   TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
 
return 0;
 }
@@ -560,6 +562,7 @@ static int test__group2(struct perf_evlist *evlist)
TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel));
TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2);
TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0);
+   TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
 
/* cache-references + :u modifier */
evsel = perf_evsel__next(evsel);
@@ -574,6 +577,7 @@ static int test__group2(struct perf_evlist *evlist)
TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
TEST_ASSERT_VAL("wrong leader", evsel->leader == leader);
TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1);
+   TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
 
/* cycles:k */
evsel = perf_evsel__next(evsel);
@@ -587,6 +591,7 @@ static int test__group2(struct perf_evlist *evlist)
TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host);
TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel));
+   TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
 
return 0;
 }
@@ -615,6 +620,7 @@ static int test__group3(struct perf_evlist *evlist 
__maybe_unused)
!strcmp(leader->group_name, "group1"));
TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2);
TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0);
+   TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
 
/* group1 cycles:kppp */
evsel = perf_evsel__next(evsel);
@@ -631,6 +637,7 @@ static int test__group3(struct perf_evlist *evlist 
__maybe_unused)
TEST_ASSERT_VAL("wrong leader", evsel->leader == leader);
TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1);
+   TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
 
/* group2 cycles + G modifier */
evsel = leader = perf_evsel__next(evsel);
@@ -648,6 +655,7 @@ static int test__group3(struct perf_evlist *evlist 
__maybe_unused)
!strcmp(leader->group_name, "group2"));
TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2);
TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0);
+   TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
 
/* group2 1:3 + G modifier */
evsel = perf_evsel__next(evsel);
@@ -661,6 +669,7 @@ static int test__group3(struct perf_evlist *evlist 
__maybe_unused)
TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
TEST_ASSERT_VAL("wrong leader", evsel->leader == leader);
TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1);
+   TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
 
/* instructions:u */
evsel = perf_evsel__next(evsel);
@@ -674,6 +683,7 @@ static int test__group3(struct perf_evlist *evlist 
__maybe_unu

[PATCH v3] arm: omap5: dts: add palmas-usb node

2013-08-12 Thread Kishon Vijay Abraham I
From: Felipe Balbi 

Without this node, there will be no palmas
driver to notify dwc3 that a cable has
been connected and, without that, dwc3
will never initialize.

[ kis...@ti.com : fix vbus-supply value after SMPS10 is modeled as 2 regulators]

Signed-off-by: Felipe Balbi 
Signed-off-by: Kishon Vijay Abraham I 
---
Change from v2:
fix vbus-supply value after SMPS10 is modeled as 2 regulators. This is needed
after SMPS10 is modeled as 2 regulators.
[1] models SMPS10 as 2 regulators.
[2] splits the SMPS10 node into two to represent the 2 regulators.

[1] -> http://comments.gmane.org/gmane.linux.kernel/1542521
[2] -> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg93779.html

 arch/arm/boot/dts/omap5-uevm.dts |   10 ++
 arch/arm/boot/dts/omap5.dtsi |2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 08b7267..51a4acc 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -272,6 +272,11 @@
interrupt-controller;
#interrupt-cells = <2>;
 
+   extcon_usb3: palmas_usb {
+   compatible = "ti,palmas-usb";
+   ti,wakeup;
+   };
+
palmas_pmic {
compatible = "ti,palmas-pmic";
interrupt-parent = <&palmas>;
@@ -450,6 +455,11 @@
phys = <0 &hsusb2_phy &hsusb3_phy>;
 };
 
+&usb3 {
+   extcon = <&extcon_usb3>;
+   vbus-supply = <&smps10_out1_reg>;
+};
+
 &mcspi1 {
 
 };
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 4e41409..1659246 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -634,7 +634,7 @@
ti,type = <2>;
};
 
-   omap_dwc3@4a02 {
+   usb3: omap_dwc3@4a02 {
compatible = "ti,dwc3";
ti,hwmods = "usb_otg_ss";
reg = <0x4a02 0x1>;
-- 
1.7.10.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/


[tip:perf/core] perf tools: Add 'S' event/ group modifier to read sample value

2013-08-12 Thread tip-bot for Jiri Olsa
Commit-ID:  3c1763115b492afb743daa4e1c8099eca6a70634
Gitweb: http://git.kernel.org/tip/3c1763115b492afb743daa4e1c8099eca6a70634
Author: Jiri Olsa 
AuthorDate: Wed, 10 Oct 2012 17:39:03 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:22 -0300

perf tools: Add 'S' event/group modifier to read sample value

Adding 'S' event/group modifier to specify that the event value/s are
read by PERF_SAMPLE_READ sample type processing, instead of the period
value offered by lower layers.

There's additional behaviour change for 'S' modifier being specified on
event group:

Currently all the events within a group makes samples. If user now
specifies 'S' within group modifier, only the leader will trigger
samples. The rest of events in the group will have sampling disabled.

And same as for single events, values of all events within the group
(including leader) are read by PERF_SAMPLE_READ sample type processing.

Following example will create event group with cycles and cache-misses
events, setting the cycles as group leader and the only event to
actually sample. Both cycles and cache-misses event period values are
read by PERF_SAMPLE_READ sample type processing with PERF_FORMAT_GROUP
read format.

Example:

  $ perf record -e '{cycles,cache-misses}:S' ls
  ...
  $ perf report --group --show-total-period --stdio
  ...
  # Samples: 36  of event 'anon group { cycles, cache-misses }'
  # Event count (approx.): 12585593
  #
  #   Overhead  Period  Command  Shared Object  
Symbol
  # ..  ..  ...  .  
..
  #
19.92%   1.20%  2505936 31   ls  [kernel.kallsyms]  [k] 
mark_held_locks
13.74%   0.47%  1729327 12   ls  [kernel.kallsyms]  [k] 
sched_clock_local
13.64%  23.72%  1716147612   ls  ld-2.14.90.so  [.] 
check_match.10805
13.12%  23.22%  1650778599   ls  libc-2.14.90.so[.] 
_nl_intern_locale_data
11.24%  29.19%  1414554753   ls  [kernel.kallsyms]  [k] 
sched_clock_cpu
 8.50%   0.35%  1070150  9   ls  [kernel.kallsyms]  [k] 
check_chain_key
  ...

Signed-off-by: Jiri Olsa 
Acked-by: Namhyung Kim 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Link: http://lkml.kernel.org/n/tip-iyoinu3axi11mymwnh2b7...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/Documentation/perf-list.txt |  1 +
 tools/perf/util/evsel.c| 29 +
 tools/perf/util/evsel.h|  1 +
 tools/perf/util/parse-events.c |  8 +++-
 tools/perf/util/parse-events.l |  2 +-
 5 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-list.txt 
b/tools/perf/Documentation/perf-list.txt
index 826f3d6..eb03f06 100644
--- a/tools/perf/Documentation/perf-list.txt
+++ b/tools/perf/Documentation/perf-list.txt
@@ -29,6 +29,7 @@ counted. The following modifiers exist:
  G - guest counting (in KVM guests)
  H - host counting (not in KVM guests)
  p - precise level
+ S - read sample value (PERF_SAMPLE_READ)
 
 The 'p' modifier can be used for specifying how precise the instruction
 address should be. The 'p' modifier can be specified multiple times:
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 9ab8fff..8f10161 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -490,6 +490,7 @@ int perf_evsel__group_desc(struct perf_evsel *evsel, char 
*buf, size_t size)
 void perf_evsel__config(struct perf_evsel *evsel,
struct perf_record_opts *opts)
 {
+   struct perf_evsel *leader = evsel->leader;
struct perf_event_attr *attr = &evsel->attr;
int track = !evsel->idx; /* only the first counter needs these */
 
@@ -499,6 +500,25 @@ void perf_evsel__config(struct perf_evsel *evsel,
perf_evsel__set_sample_bit(evsel, IP);
perf_evsel__set_sample_bit(evsel, TID);
 
+   if (evsel->sample_read) {
+   perf_evsel__set_sample_bit(evsel, READ);
+
+   /*
+* We need ID even in case of single event, because
+* PERF_SAMPLE_READ process ID specific data.
+*/
+   perf_evsel__set_sample_id(evsel);
+
+   /*
+* Apply group format only if we belong to group
+* with more than one members.
+*/
+   if (leader->nr_members > 1) {
+   attr->read_format |= PERF_FORMAT_GROUP;
+   attr->inherit = 0;
+   }
+   }
+
/*
 * We default some events to a 1 default interval. But keep
 * it a weak assumption overridable by the user.
@@ -514,6 +534,15 @@ void perf_evsel__config(struct perf_evsel *evsel,
}
}
 
+   /*
+* Disable sampling for all group members other
+

[tip:perf/core] perf evlist: Add perf_evlist__id2sid method to get event ID related data

2013-08-12 Thread tip-bot for Jiri Olsa
Commit-ID:  932a35940a3f03613796ab4855ecbb214dbdc0c2
Gitweb: http://git.kernel.org/tip/932a35940a3f03613796ab4855ecbb214dbdc0c2
Author: Jiri Olsa 
AuthorDate: Thu, 11 Oct 2012 14:10:35 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:21 -0300

perf evlist: Add perf_evlist__id2sid method to get event ID related data

This will be helpful for PERF_FORMAT_GROUP samples where we need to
store ID related period value for each event.

Signed-off-by: Jiri Olsa 
Acked-by: Namhyung Kim 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Link: http://lkml.kernel.org/n/tip-twmlgsbyim97p7cyohjwb...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/evlist.c | 21 -
 tools/perf/util/evlist.h |  2 ++
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 10fcc03..da2dd92 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -337,21 +337,32 @@ static int perf_evlist__id_add_fd(struct perf_evlist 
*evlist,
return 0;
 }
 
-struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id)
+struct perf_sample_id *perf_evlist__id2sid(struct perf_evlist *evlist, u64 id)
 {
struct hlist_head *head;
struct perf_sample_id *sid;
int hash;
 
-   if (evlist->nr_entries == 1)
-   return perf_evlist__first(evlist);
-
hash = hash_64(id, PERF_EVLIST__HLIST_BITS);
head = &evlist->heads[hash];
 
hlist_for_each_entry(sid, head, node)
if (sid->id == id)
-   return sid->evsel;
+   return sid;
+
+   return NULL;
+}
+
+struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id)
+{
+   struct perf_sample_id *sid;
+
+   if (evlist->nr_entries == 1)
+   return perf_evlist__first(evlist);
+
+   sid = perf_evlist__id2sid(evlist, id);
+   if (sid)
+   return sid->evsel;
 
if (!perf_evlist__sample_id_all(evlist))
return perf_evlist__first(evlist);
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index c7178b7..327abab 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -78,6 +78,8 @@ void perf_evlist__add_pollfd(struct perf_evlist *evlist, int 
fd);
 
 struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id);
 
+struct perf_sample_id *perf_evlist__id2sid(struct perf_evlist *evlist, u64 id);
+
 union perf_event *perf_evlist__mmap_read(struct perf_evlist *self, int idx);
 
 int perf_evlist__open(struct perf_evlist *evlist);
--
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:perf/core] perf evsel: Actually show symbol offset in stack trace when requested

2013-08-12 Thread tip-bot for David Ahern
Commit-ID:  251f426fddd9217ce6e4478653d3ee33df518030
Gitweb: http://git.kernel.org/tip/251f426fddd9217ce6e4478653d3ee33df518030
Author: David Ahern 
AuthorDate: Sun, 28 Jul 2013 09:14:34 -0600
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:24 -0300

perf evsel: Actually show symbol offset in stack trace when requested

Symbol offset is one of the fields that can be requested in perf-script.
Currently you do not get that data when requested. e.g.,

perf script -f comm,tid,pid,time,cpu,sym,symoff,ip
...
gcc  6201/6201  [006] 762250.617897:
81090d95 update_curr
810911b8 dequeue_entity
81091825 dequeue_task_fair
81087163 dequeue_task
81087c03 deactivate_task
...

With this patch you get the offset:
...
gcc  6201/6201  [006] 762250.617897:
81090d95 update_curr+0x1c5
810911b8 dequeue_entity+0x28
81091825 dequeue_task_fair+0x45
81087163 dequeue_task+0x93
81087c03 deactivate_task+0x23
...

Signed-off-by: David Ahern 
Link: 
http://lkml.kernel.org/r/1375024474-45726-1-git-send-email-dsah...@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/session.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 9247d9c..a0ce5a4 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1519,8 +1519,13 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, 
union perf_event *event,
printf("\t%16" PRIx64, node->ip);
if (print_sym) {
printf(" ");
-   symbol__fprintf_symname(node->sym, stdout);
+   if (print_symoffset) {
+   al.addr = node->ip;
+   symbol__fprintf_symname_offs(node->sym, 
&al, stdout);
+   } else
+   symbol__fprintf_symname(node->sym, 
stdout);
}
+
if (print_dso) {
printf(" (");
map__fprintf_dsoname(node->map, stdout);
--
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:perf/core] perf tools: Fix compile of util/tsc.c

2013-08-12 Thread tip-bot for David Ahern
Commit-ID:  602bab1b883090ffd125ed1253fe8ec127c048b1
Gitweb: http://git.kernel.org/tip/602bab1b883090ffd125ed1253fe8ec127c048b1
Author: David Ahern 
AuthorDate: Fri, 26 Jul 2013 08:27:23 -0600
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:24 -0300

perf tools: Fix compile of util/tsc.c

On Fedora 18, with gcc 4.6.4 compile fails with:

arch/x86/util/tsc.c: In function ‘perf_time_to_tsc’:
arch/x86/util/tsc.c:13:6: error: declaration of ‘time’ shadows a global 
declaration [-Werror=shadow]
cc1: all warnings being treated as errors
make: *** [/tmp/junk/arch/x86/util/tsc.o] Error 1
make: *** Waiting for unfinished jobs

Fix by renaming the local variable.

Signed-off-by: David Ahern 
Cc: Adrian Hunter 
Link: 
http://lkml.kernel.org/r/1374848843-43127-1-git-send-email-dsah...@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/arch/x86/util/tsc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c
index f111744..9570c2b 100644
--- a/tools/perf/arch/x86/util/tsc.c
+++ b/tools/perf/arch/x86/util/tsc.c
@@ -10,11 +10,11 @@
 
 u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc)
 {
-   u64 time, quot, rem;
+   u64 t, quot, rem;
 
-   time = ns - tc->time_zero;
-   quot = time / tc->time_mult;
-   rem  = time % tc->time_mult;
+   t = ns - tc->time_zero;
+   quot = t / tc->time_mult;
+   rem  = t % tc->time_mult;
return (quot << tc->time_shift) +
   (rem << tc->time_shift) / tc->time_mult;
 }
--
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:perf/core] perf python: Remove duplicate TID bit from mask

2013-08-12 Thread tip-bot for Arnaldo Carvalho de Melo
Commit-ID:  3223565cdf856fa07024e5db7ca24e1b1b38d1db
Gitweb: http://git.kernel.org/tip/3223565cdf856fa07024e5db7ca24e1b1b38d1db
Author: Arnaldo Carvalho de Melo 
AuthorDate: Thu, 1 Aug 2013 17:00:45 -0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:25 -0300

perf python: Remove duplicate TID bit from mask

Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Mike Galbraith 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Cc: Thiago Peixoto 
Link: http://lkml.kernel.org/n/tip-jurgz6myq125o1ql6lldh...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/python/twatch.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/python/twatch.py b/tools/perf/python/twatch.py
index b11cca5..2225162 100755
--- a/tools/perf/python/twatch.py
+++ b/tools/perf/python/twatch.py
@@ -21,7 +21,7 @@ def main():
evsel = perf.evsel(task = 1, comm = 1, mmap = 0,
   wakeup_events = 1, watermark = 1,
   sample_id_all = 1,
-  sample_type = perf.SAMPLE_PERIOD | perf.SAMPLE_TID | 
perf.SAMPLE_CPU | perf.SAMPLE_TID)
+  sample_type = perf.SAMPLE_PERIOD | perf.SAMPLE_TID | 
perf.SAMPLE_CPU)
evsel.open(cpus = cpus, threads = threads);
evlist = perf.evlist(cpus, threads)
evlist.add(evsel)
--
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:perf/core] perf evlist: Remove obsolete dummy execve

2013-08-12 Thread tip-bot for Andi Kleen
Commit-ID:  5c6974f49832a55edc9ca744323778947c104ca0
Gitweb: http://git.kernel.org/tip/5c6974f49832a55edc9ca744323778947c104ca0
Author: Andi Kleen 
AuthorDate: Fri, 2 Aug 2013 17:41:09 -0700
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:28 -0300

perf evlist: Remove obsolete dummy execve

Minor cleanup.

The dummy execve to pre-resolve the PLT is obsolete since
"enable_on_execve" was added. The counters are only
running after the execve anyways. So just remove it.

Signed-off-by: Andi Kleen 
Reviewed-by: Jiri Olsa 
Cc: Jiri Olsa 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375490473-1503-2-git-send-email-a...@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/evlist.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index da2dd92..c7d111f 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -837,13 +837,6 @@ int perf_evlist__prepare_workload(struct perf_evlist 
*evlist,
fcntl(go_pipe[0], F_SETFD, FD_CLOEXEC);
 
/*
-* Do a dummy execvp to get the PLT entry resolved,
-* so we avoid the resolver overhead on the real
-* execvp call.
-*/
-   execvp("", (char **)argv);
-
-   /*
 * Tell the parent we're ready to go
 */
close(child_ready_pipe[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/


[tip:perf/core] perf session: Export a few functions for event processing

2013-08-12 Thread tip-bot for David Ahern
Commit-ID:  9c5014022f5d5b09abc8b713da81b3d2db319699
Gitweb: http://git.kernel.org/tip/9c5014022f5d5b09abc8b713da81b3d2db319699
Author: David Ahern 
AuthorDate: Fri, 2 Aug 2013 14:05:41 -0600
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:27 -0300

perf session: Export a few functions for event processing

Allows kvm live mode to reuse the event processing and ordered samples
processing used by the perf-report path.

v2: removed flush_sample_queue as noticed by Jiri

Signed-off-by: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Runzhen Wang 
Cc: Xiao Guangrong 
Link: 
http://lkml.kernel.org/r/1375473947-64285-4-git-send-email-dsah...@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/session.c | 12 ++--
 tools/perf/util/session.h |  7 +++
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index a0ce5a4..b5ebd47 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -250,7 +250,7 @@ static int process_finished_round(struct perf_tool *tool,
  union perf_event *event,
  struct perf_session *session);
 
-static void perf_tool__fill_defaults(struct perf_tool *tool)
+void perf_tool__fill_defaults(struct perf_tool *tool)
 {
if (tool->sample == NULL)
tool->sample = process_event_sample_stub;
@@ -495,7 +495,7 @@ static int perf_session_deliver_event(struct perf_session 
*session,
  u64 file_offset);
 
 static int flush_sample_queue(struct perf_session *s,
-  struct perf_tool *tool)
+  struct perf_tool *tool)
 {
struct ordered_samples *os = &s->ordered_samples;
struct list_head *head = &os->samples;
@@ -1049,10 +1049,10 @@ static void event_swap(union perf_event *event, bool 
sample_id_all)
swap(event, sample_id_all);
 }
 
-static int perf_session__process_event(struct perf_session *session,
-  union perf_event *event,
-  struct perf_tool *tool,
-  u64 file_offset)
+int perf_session__process_event(struct perf_session *session,
+   union perf_event *event,
+   struct perf_tool *tool,
+   u64 file_offset)
 {
struct perf_sample sample;
int ret;
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index ad8d3d4..9818fc2 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -56,6 +56,13 @@ int __perf_session__process_events(struct perf_session *self,
 int perf_session__process_events(struct perf_session *self,
 struct perf_tool *tool);
 
+int perf_session__process_event(struct perf_session *session,
+   union perf_event *event,
+   struct perf_tool *tool,
+   u64 file_offset);
+
+void perf_tool__fill_defaults(struct perf_tool *tool);
+
 int perf_session__resolve_callchain(struct perf_session *self, struct 
perf_evsel *evsel,
struct thread *thread,
struct ip_callchain *chain,
--
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:perf/core] perf stats: Add max and min stats

2013-08-12 Thread tip-bot for David Ahern
Commit-ID:  ffe4f3c0d109dc53e1b3448ac457052107f34a84
Gitweb: http://git.kernel.org/tip/ffe4f3c0d109dc53e1b3448ac457052107f34a84
Author: David Ahern 
AuthorDate: Fri, 2 Aug 2013 14:05:40 -0600
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:26 -0300

perf stats: Add max and min stats

Need an initialization function to set min to -1 to
differentiate from an actual min of 0.

Signed-off-by: David Ahern 
Reviewed-by: Xiao Guangrong 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Runzhen Wang 
Cc: Xiao Guangrong 
Link: 
http://lkml.kernel.org/r/1375473947-64285-3-git-send-email-dsah...@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/stat.c | 6 ++
 tools/perf/util/stat.h | 9 +
 2 files changed, 15 insertions(+)

diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 7c59c28..6506b3d 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -10,6 +10,12 @@ void update_stats(struct stats *stats, u64 val)
delta = val - stats->mean;
stats->mean += delta / stats->n;
stats->M2 += delta*(val - stats->mean);
+
+   if (val > stats->max)
+   stats->max = val;
+
+   if (val < stats->min)
+   stats->min = val;
 }
 
 double avg_stats(struct stats *stats)
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index 588367c..ae8ccd7 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -6,6 +6,7 @@
 struct stats
 {
double n, mean, M2;
+   u64 max, min;
 };
 
 void update_stats(struct stats *stats, u64 val);
@@ -13,4 +14,12 @@ double avg_stats(struct stats *stats);
 double stddev_stats(struct stats *stats);
 double rel_stddev_stats(double stddev, double avg);
 
+static inline void init_stats(struct stats *stats)
+{
+   stats->n= 0.0;
+   stats->mean = 0.0;
+   stats->M2   = 0.0;
+   stats->min  = (u64) -1;
+   stats->max  = 0;
+}
 #endif
--
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:perf/core] perf stat: Flush output after each line in interval mode

2013-08-12 Thread tip-bot for Andi Kleen
Commit-ID:  2bbf03f16a634f675c49c473b2b6528571990aea
Gitweb: http://git.kernel.org/tip/2bbf03f16a634f675c49c473b2b6528571990aea
Author: Andi Kleen 
AuthorDate: Fri, 2 Aug 2013 17:41:12 -0700
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:29 -0300

perf stat: Flush output after each line in interval mode

When interval mode is outputting to a pipe, each measurement should be
flushed individually, so that the reader sees it timely.

With a terminal each line is automatically flushed by stdio, but that is
disabled with non terminal output.

Simply fflush output after each time interval

Signed-off-by: Andi Kleen 
Reviewed-by: Jiri Olsa 
Cc: Jiri Olsa 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375490473-1503-5-git-send-email-a...@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 2e637e4..f686d5f 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -416,6 +416,8 @@ static void print_interval(void)
list_for_each_entry(counter, &evsel_list->entries, node)
print_counter_aggr(counter, prefix);
}
+
+   fflush(output);
 }
 
 static void handle_initial_delay(void)
--
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:perf/core] perf stat: Add support for --initial-delay option

2013-08-12 Thread tip-bot for Andi Kleen
Commit-ID:  411916880ff4061ac0491a154f10af4d49a0c61a
Gitweb: http://git.kernel.org/tip/411916880ff4061ac0491a154f10af4d49a0c61a
Author: Andi Kleen 
AuthorDate: Fri, 2 Aug 2013 17:41:11 -0700
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:29 -0300

perf stat: Add support for --initial-delay option

When measuring workloads the startup phase -- doing page faults, dynamic
linking, opening files -- is often very different from the rest of the
workload.  Especially with smaller kernels and using counter
multiplexing this can give significant measurement errors.

Multiplexing assumes that the workload is mostly the same over longer
periods. But at startup there is typically some spike of activity which
is relatively short.  If many groups are multiplexing the one group
seeing the spike, and which is then scaled up over the time to run all
groups, may see a significant error.

Also in general it's often not useful to measure the startup, because it
is so different from the rest.

One way around this is to use interval mode and discard the first
sample, but this can be awkward because interval mode doesn't support
intervals of less than 100ms, and also a useful interval is not
necessarily the same as a useful startup delay.

This patch adds a new --initial-delay / -D option to skip measuring for
the startup phase. The time can be specified in ms

Here's a simple example:

perf stat -e page-faults bash -c 'for i in $(seq 10) ; do true ; done'
...
 3,721 page-faults
...

If we just wait 20 ms the number of page faults is 1/3 less:

perf stat -D 20 -e page-faults bash -c 'for i in $(seq 10) ; do true ; done'
...
 2,823 page-faults
...

So we filtered out most of the startup noise from bash.

Signed-off-by: Andi Kleen 
Reviewed-by: Jiri Olsa 
Cc: Jiri Olsa 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375490473-1503-4-git-send-email-a...@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/Documentation/perf-stat.txt |  5 +
 tools/perf/builtin-stat.c  | 22 +-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-stat.txt 
b/tools/perf/Documentation/perf-stat.txt
index 2fe87fb..73c9759 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -132,6 +132,11 @@ is a useful mode to detect imbalance between physical 
cores.  To enable this mod
 use --per-core in addition to -a. (system-wide).  The output includes the
 core number and the number of online logical processors on that physical 
processor.
 
+-D msecs::
+--initial-delay msecs::
+After starting the program, wait msecs before measuring. This is useful to
+filter out the startup phase of the program, which is often very different.
+
 EXAMPLES
 
 
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 352fbd7..2e637e4 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -100,6 +100,7 @@ static const char   *pre_cmd
= NULL;
 static const char  *post_cmd   = NULL;
 static boolsync_run= false;
 static unsigned intinterval= 0;
+static unsigned intinitial_delay   = 0;
 static boolforever = false;
 static struct timespec ref_time;
 static struct cpu_map  *aggr_map;
@@ -254,7 +255,8 @@ static int create_perf_stat_counter(struct perf_evsel 
*evsel)
if (!perf_target__has_task(&target) &&
perf_evsel__is_group_leader(evsel)) {
attr->disabled = 1;
-   attr->enable_on_exec = 1;
+   if (!initial_delay)
+   attr->enable_on_exec = 1;
}
 
return perf_evsel__open_per_thread(evsel, evsel_list->threads);
@@ -416,6 +418,20 @@ static void print_interval(void)
}
 }
 
+static void handle_initial_delay(void)
+{
+   struct perf_evsel *counter;
+
+   if (initial_delay) {
+   const int ncpus = cpu_map__nr(evsel_list->cpus),
+   nthreads = thread_map__nr(evsel_list->threads);
+
+   usleep(initial_delay * 1000);
+   list_for_each_entry(counter, &evsel_list->entries, node)
+   perf_evsel__enable(counter, ncpus, nthreads);
+   }
+}
+
 static int __run_perf_stat(int argc, const char **argv)
 {
char msg[512];
@@ -486,6 +502,7 @@ static int __run_perf_stat(int argc, const char **argv)
 
if (forks) {
perf_evlist__start_workload(evsel_list);
+   handle_initial_delay();
 
if (interval) {
while (!waitpid(child_pid, &status, WNOHANG)) {
@@ -497,6 +514,7 @@ static int __run_perf_stat(int argc, const char **argv)
if (WIFSIGNALED(status))

[tip:perf/core] perf kvm: Split out tracepoints from record args

2013-08-12 Thread tip-bot for David Ahern
Commit-ID:  8fdd84c44fd09d783caa4fb81d2d680b0cf07eeb
Gitweb: http://git.kernel.org/tip/8fdd84c44fd09d783caa4fb81d2d680b0cf07eeb
Author: David Ahern 
AuthorDate: Fri, 2 Aug 2013 14:05:42 -0600
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:27 -0300

perf kvm: Split out tracepoints from record args

Needed by kvm live command. Make record_args a local while we are
messing with the args.

Signed-off-by: David Ahern 
Reviewed-by: Xiao Guangrong 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Runzhen Wang 
Cc: Xiao Guangrong 
Link: 
http://lkml.kernel.org/r/1375473947-64285-5-git-send-email-dsah...@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-kvm.c | 30 +++---
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 24b78ae..7d14a3a 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -801,16 +801,11 @@ exit:
return ret;
 }
 
-static const char * const record_args[] = {
-   "record",
-   "-R",
-   "-f",
-   "-m", "1024",
-   "-c", "1",
-   "-e", "kvm:kvm_entry",
-   "-e", "kvm:kvm_exit",
-   "-e", "kvm:kvm_mmio",
-   "-e", "kvm:kvm_pio",
+static const char * const kvm_events_tp[] = {
+   "kvm:kvm_entry",
+   "kvm:kvm_exit",
+   "kvm:kvm_mmio",
+   "kvm:kvm_pio",
 };
 
 #define STRDUP_FAIL_EXIT(s)\
@@ -826,8 +821,16 @@ kvm_events_record(struct perf_kvm_stat *kvm, int argc, 
const char **argv)
 {
unsigned int rec_argc, i, j;
const char **rec_argv;
+   const char * const record_args[] = {
+   "record",
+   "-R",
+   "-f",
+   "-m", "1024",
+   "-c", "1",
+   };
 
-   rec_argc = ARRAY_SIZE(record_args) + argc + 2;
+   rec_argc = ARRAY_SIZE(record_args) + argc + 2 +
+  2 * ARRAY_SIZE(kvm_events_tp);
rec_argv = calloc(rec_argc + 1, sizeof(char *));
 
if (rec_argv == NULL)
@@ -836,6 +839,11 @@ kvm_events_record(struct perf_kvm_stat *kvm, int argc, 
const char **argv)
for (i = 0; i < ARRAY_SIZE(record_args); i++)
rec_argv[i] = STRDUP_FAIL_EXIT(record_args[i]);
 
+   for (j = 0; j < ARRAY_SIZE(kvm_events_tp); j++) {
+   rec_argv[i++] = "-e";
+   rec_argv[i++] = STRDUP_FAIL_EXIT(kvm_events_tp[j]);
+   }
+
rec_argv[i++] = STRDUP_FAIL_EXIT("-o");
rec_argv[i++] = STRDUP_FAIL_EXIT(kvm->file_name);
 
--
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:perf/core] perf tests: Adjust the vmlinux symtab matches kallsyms test again

2013-08-12 Thread tip-bot for Adrian Hunter
Commit-ID:  82e75d00adc5bde3cf98f11e937eed6127163969
Gitweb: http://git.kernel.org/tip/82e75d00adc5bde3cf98f11e937eed6127163969
Author: Adrian Hunter 
AuthorDate: Wed, 7 Aug 2013 14:38:52 +0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:33 -0300

perf tests: Adjust the vmlinux symtab matches kallsyms test again

The kallsyms maps now may map to kcore and the symbol values now may be
file offsets.  For comparison with vmlinux the virtual memory address is
needed which is obtained by unmapping the symbol value.

The "vmlinux symtab matches kallsyms" is adjusted accordingly.

Signed-off-by: Adrian Hunter 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Mike Galbraith 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375875537-4509-9-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/tests/vmlinux-kallsyms.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tools/perf/tests/vmlinux-kallsyms.c 
b/tools/perf/tests/vmlinux-kallsyms.c
index e2e1498..2bd13ed 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -16,6 +16,8 @@ static int vmlinux_matches_kallsyms_filter(struct map *map 
__maybe_unused,
return 0;
 }
 
+#define UM(x) kallsyms_map->unmap_ip(kallsyms_map, (x))
+
 int test__vmlinux_matches_kallsyms(void)
 {
int err = -1;
@@ -74,7 +76,7 @@ int test__vmlinux_matches_kallsyms(void)
goto out;
}
 
-   ref_reloc_sym.addr = sym->start;
+   ref_reloc_sym.addr = UM(sym->start);
 
/*
 * Step 5:
@@ -131,7 +133,7 @@ int test__vmlinux_matches_kallsyms(void)
 mem_start, NULL, NULL);
pair = first_pair;
 
-   if (pair && pair->start == mem_start) {
+   if (pair && UM(pair->start) == mem_start) {
 next_pair:
if (strcmp(sym->name, pair->name) == 0) {
/*
@@ -143,11 +145,11 @@ next_pair:
 * off the real size. More than that and we
 * _really_ have a problem.
 */
-   s64 skew = mem_end - pair->end;
+   s64 skew = mem_end - UM(pair->end);
if (llabs(skew) >= page_size)
pr_debug("%#" PRIx64 ": diff end addr 
for %s v: %#" PRIx64 " k: %#" PRIx64 "\n",
 mem_start, sym->name, mem_end,
-pair->end);
+UM(pair->end));
 
/*
 * Do not count this as a failure, because we
@@ -165,7 +167,7 @@ detour:
if (nnd) {
struct symbol *next = rb_entry(nnd, 
struct symbol, rb_node);
 
-   if (next->start == mem_start) {
+   if (UM(next->start) == mem_start) {
pair = next;
goto next_pair;
}
--
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:perf/core] perf tests: Add test for reading object code

2013-08-12 Thread tip-bot for Adrian Hunter
Commit-ID:  b55ae0a976f2927ea8f15a85c43bbe6d25a68a41
Gitweb: http://git.kernel.org/tip/b55ae0a976f2927ea8f15a85c43bbe6d25a68a41
Author: Adrian Hunter 
AuthorDate: Wed, 7 Aug 2013 14:38:45 +0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:30 -0300

perf tests: Add test for reading object code

Using the information in mmap events, perf tools can read object code
associated with sampled addresses.  A test is added that compares bytes
read by perf with the same bytes read using objdump.

Signed-off-by: Adrian Hunter 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Mike Galbraith 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375875537-4509-2-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/Makefile |   1 +
 tools/perf/tests/builtin-test.c |   4 +
 tools/perf/tests/code-reading.c | 509 
 tools/perf/tests/tests.h|   1 +
 4 files changed, 515 insertions(+)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index bfd12d0..e0d3d9f 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -392,6 +392,7 @@ LIB_OBJS += $(OUTPUT)tests/sw-clock.o
 ifeq ($(ARCH),x86)
 LIB_OBJS += $(OUTPUT)tests/perf-time-to-tsc.o
 endif
+LIB_OBJS += $(OUTPUT)tests/code-reading.o
 
 BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
 BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index b7b4049..f5af192 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -100,6 +100,10 @@ static struct test {
},
 #endif
{
+   .desc = "Test object code reading",
+   .func = test__code_reading,
+   },
+   {
.func = NULL,
},
 };
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
new file mode 100644
index 000..28bee62
--- /dev/null
+++ b/tools/perf/tests/code-reading.c
@@ -0,0 +1,509 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "parse-events.h"
+#include "evlist.h"
+#include "evsel.h"
+#include "thread_map.h"
+#include "cpumap.h"
+#include "machine.h"
+#include "event.h"
+#include "thread.h"
+
+#include "tests.h"
+
+#define BUFSZ  1024
+#define READLEN128
+
+static unsigned int hex(char c)
+{
+   if (c >= '0' && c <= '9')
+   return c - '0';
+   if (c >= 'a' && c <= 'f')
+   return c - 'a' + 10;
+   return c - 'A' + 10;
+}
+
+static void read_objdump_line(const char *line, size_t line_len, void **buf,
+ size_t *len)
+{
+   const char *p;
+   size_t i;
+
+   /* Skip to a colon */
+   p = strchr(line, ':');
+   if (!p)
+   return;
+   i = p + 1 - line;
+
+   /* Read bytes */
+   while (*len) {
+   char c1, c2;
+
+   /* Skip spaces */
+   for (; i < line_len; i++) {
+   if (!isspace(line[i]))
+   break;
+   }
+   /* Get 2 hex digits */
+   if (i >= line_len || !isxdigit(line[i]))
+   break;
+   c1 = line[i++];
+   if (i >= line_len || !isxdigit(line[i]))
+   break;
+   c2 = line[i++];
+   /* Followed by a space */
+   if (i < line_len && line[i] && !isspace(line[i]))
+   break;
+   /* Store byte */
+   *(unsigned char *)*buf = (hex(c1) << 4) | hex(c2);
+   *buf += 1;
+   *len -= 1;
+   }
+}
+
+static int read_objdump_output(FILE *f, void **buf, size_t *len)
+{
+   char *line = NULL;
+   size_t line_len;
+   ssize_t ret;
+   int err = 0;
+
+   while (1) {
+   ret = getline(&line, &line_len, f);
+   if (feof(f))
+   break;
+   if (ret < 0) {
+   pr_debug("getline failed\n");
+   err = -1;
+   break;
+   }
+   read_objdump_line(line, ret, buf, len);
+   }
+
+   free(line);
+
+   return err;
+}
+
+static int read_via_objdump(const char *filename, u64 addr, void *buf,
+   size_t len)
+{
+   char cmd[PATH_MAX * 2];
+   const char *fmt;
+   FILE *f;
+   int ret;
+
+   fmt = "%s -d --start-address=0x%"PRIx64" --stop-address=0x%"PRIx64" %s";
+   ret = snprintf(cmd, sizeof(cmd), fmt, "objdump", addr, addr + len,
+  filename);
+   if (ret <= 0 || (size_t)ret >= sizeof(cmd))
+   return -1;
+
+   pr_debug("Objdump command is: %s\n", cmd);
+
+   f = popen(cmd, "r");
+   if (!f) {
+   pr_debug("popen failed\n")

[tip:perf/core] perf symbols: Add support for reading from /proc/ kcore

2013-08-12 Thread tip-bot for Adrian Hunter
Commit-ID:  8e0cf965f95edd41df11cca50b92b4cb6ea8d80a
Gitweb: http://git.kernel.org/tip/8e0cf965f95edd41df11cca50b92b4cb6ea8d80a
Author: Adrian Hunter 
AuthorDate: Wed, 7 Aug 2013 14:38:51 +0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:33 -0300

perf symbols: Add support for reading from /proc/kcore

In the absence of vmlinux, perf tools uses kallsyms for symbols.  If the
user has access, now also map to /proc/kcore.

The dso data_type is now set to either DSO_BINARY_TYPE__KCORE or
DSO_BINARY_TYPE__GUEST_KCORE as approprite.

This patch breaks the "vmlinux symtab matches kallsyms" test.  That is
fixed in a following patch.

Signed-off-by: Adrian Hunter 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Mike Galbraith 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375875537-4509-8-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/dso.c|   5 +
 tools/perf/util/dso.h|   8 ++
 tools/perf/util/machine.c|  16 +++
 tools/perf/util/map.c|  18 
 tools/perf/util/map.h|  13 +++
 tools/perf/util/symbol-elf.c |  51 +
 tools/perf/util/symbol-minimal.c |   7 ++
 tools/perf/util/symbol.c | 227 ++-
 tools/perf/util/symbol.h |   5 +
 9 files changed, 347 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 1955804..e3c1ff8 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -95,6 +95,11 @@ int dso__binary_type_file(struct dso *dso, enum 
dso_binary_type type,
 dso->long_name);
break;
 
+   case DSO_BINARY_TYPE__KCORE:
+   case DSO_BINARY_TYPE__GUEST_KCORE:
+   snprintf(file, size, "%s", dso->long_name);
+   break;
+
default:
case DSO_BINARY_TYPE__KALLSYMS:
case DSO_BINARY_TYPE__GUEST_KALLSYMS:
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 735a837..b793053 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -21,6 +21,8 @@ enum dso_binary_type {
DSO_BINARY_TYPE__SYSTEM_PATH_DSO,
DSO_BINARY_TYPE__GUEST_KMODULE,
DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE,
+   DSO_BINARY_TYPE__KCORE,
+   DSO_BINARY_TYPE__GUEST_KCORE,
DSO_BINARY_TYPE__NOT_FOUND,
 };
 
@@ -155,4 +157,10 @@ static inline bool dso__is_vmlinux(struct dso *dso)
   dso->data_type == DSO_BINARY_TYPE__GUEST_VMLINUX;
 }
 
+static inline bool dso__is_kcore(struct dso *dso)
+{
+   return dso->data_type == DSO_BINARY_TYPE__KCORE ||
+  dso->data_type == DSO_BINARY_TYPE__GUEST_KCORE;
+}
+
 #endif /* __PERF_DSO */
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index dc35dcf..ef3b49c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -856,6 +856,18 @@ static void machine__set_kernel_mmap_len(struct machine 
*machine,
}
 }
 
+static bool machine__uses_kcore(struct machine *machine)
+{
+   struct dso *dso;
+
+   list_for_each_entry(dso, &machine->kernel_dsos, node) {
+   if (dso__is_kcore(dso))
+   return true;
+   }
+
+   return false;
+}
+
 static int machine__process_kernel_mmap_event(struct machine *machine,
  union perf_event *event)
 {
@@ -864,6 +876,10 @@ static int machine__process_kernel_mmap_event(struct 
machine *machine,
enum dso_kernel_type kernel_type;
bool is_kernel_mmap;
 
+   /* If we have maps from kcore then we do not need or want any others */
+   if (machine__uses_kcore(machine))
+   return 0;
+
machine__mmap_name(machine, kmmap_prefix, sizeof(kmmap_prefix));
if (machine__is_host(machine))
kernel_type = DSO_TYPE_KERNEL;
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 4d599fe..9e8304c 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -555,3 +555,21 @@ struct map *maps__find(struct rb_root *maps, u64 ip)
 
return NULL;
 }
+
+struct map *maps__first(struct rb_root *maps)
+{
+   struct rb_node *first = rb_first(maps);
+
+   if (first)
+   return rb_entry(first, struct map, rb_node);
+   return NULL;
+}
+
+struct map *maps__next(struct map *map)
+{
+   struct rb_node *next = rb_next(&map->rb_node);
+
+   if (next)
+   return rb_entry(next, struct map, rb_node);
+   return NULL;
+}
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index a887f2c..2cc93cb 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -112,6 +112,8 @@ size_t __map_groups__fprintf_maps(struct map_groups *mg,
 void maps__insert(struct rb_root *maps, struct map *map);
 void maps__remove(struct rb_root *maps, struct map *map);
 struct map

[tip:perf/core] perf evsel: Add support for enabling counters

2013-08-12 Thread tip-bot for Andi Kleen
Commit-ID:  e2407bef968d64a28465561832686636d3380bf9
Gitweb: http://git.kernel.org/tip/e2407bef968d64a28465561832686636d3380bf9
Author: Andi Kleen 
AuthorDate: Fri, 2 Aug 2013 17:41:10 -0700
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:28 -0300

perf evsel: Add support for enabling counters

Add support for enabling already set up counters by using an
ioctl. I share some code with the filter setup.

Signed-off-by: Andi Kleen 
Reviewed-by: Jiri Olsa 
Cc: Jiri Olsa 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375490473-1503-3-git-send-email-a...@firstfloor.org
[ Fixed up 'err' variable indentation ]
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/evsel.c | 21 ++---
 tools/perf/util/evsel.h |  1 +
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 8f10161..960394e 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -634,15 +634,15 @@ int perf_evsel__alloc_fd(struct perf_evsel *evsel, int 
ncpus, int nthreads)
return evsel->fd != NULL ? 0 : -ENOMEM;
 }
 
-int perf_evsel__set_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
-  const char *filter)
+static int perf_evsel__run_ioctl(struct perf_evsel *evsel, int ncpus, int 
nthreads,
+ int ioc,  void *arg)
 {
int cpu, thread;
 
for (cpu = 0; cpu < ncpus; cpu++) {
for (thread = 0; thread < nthreads; thread++) {
int fd = FD(evsel, cpu, thread),
-   err = ioctl(fd, PERF_EVENT_IOC_SET_FILTER, filter);
+   err = ioctl(fd, ioc, arg);
 
if (err)
return err;
@@ -652,6 +652,21 @@ int perf_evsel__set_filter(struct perf_evsel *evsel, int 
ncpus, int nthreads,
return 0;
 }
 
+int perf_evsel__set_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
+  const char *filter)
+{
+   return perf_evsel__run_ioctl(evsel, ncpus, nthreads,
+PERF_EVENT_IOC_SET_FILTER,
+(void *)filter);
+}
+
+int perf_evsel__enable(struct perf_evsel *evsel, int ncpus, int nthreads)
+{
+   return perf_evsel__run_ioctl(evsel, ncpus, nthreads,
+PERF_EVENT_IOC_ENABLE,
+0);
+}
+
 int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads)
 {
evsel->sample_id = xyarray__new(ncpus, nthreads, sizeof(struct 
perf_sample_id));
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 5edc625..532a5f9 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -146,6 +146,7 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel);
 
 int perf_evsel__set_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
   const char *filter);
+int perf_evsel__enable(struct perf_evsel *evsel, int ncpus, int nthreads);
 
 int perf_evsel__open_per_cpu(struct perf_evsel *evsel,
 struct cpu_map *cpus);
--
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:perf/core] perf tests: Adjust the vmlinux symtab matches kallsyms test

2013-08-12 Thread tip-bot for Adrian Hunter
Commit-ID:  d380b34830cc76461feab012f0bc52b01e65087c
Gitweb: http://git.kernel.org/tip/d380b34830cc76461feab012f0bc52b01e65087c
Author: Adrian Hunter 
AuthorDate: Wed, 7 Aug 2013 14:38:48 +0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:32 -0300

perf tests: Adjust the vmlinux symtab matches kallsyms test

The vmlinux maps now map to the dso and the symbol values are now file
offsets.  For comparison with kallsyms the virtual memory address is
needed which is obtained by unmapping the symbol value.

The "vmlinux symtab matches kallsyms" is adjusted accordingly.

Signed-off-by: Adrian Hunter 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Mike Galbraith 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375875537-4509-5-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/tests/vmlinux-kallsyms.c | 32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/tools/perf/tests/vmlinux-kallsyms.c 
b/tools/perf/tests/vmlinux-kallsyms.c
index add1539..e2e1498 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -25,6 +25,7 @@ int test__vmlinux_matches_kallsyms(void)
struct machine kallsyms, vmlinux;
enum map_type type = MAP__FUNCTION;
struct ref_reloc_sym ref_reloc_sym = { .name = "_stext", };
+   u64 mem_start, mem_end;
 
/*
 * Step 1:
@@ -123,10 +124,14 @@ int test__vmlinux_matches_kallsyms(void)
if (sym->start == sym->end)
continue;
 
-   first_pair = machine__find_kernel_symbol(&kallsyms, type, 
sym->start, NULL, NULL);
+   mem_start = vmlinux_map->unmap_ip(vmlinux_map, sym->start);
+   mem_end = vmlinux_map->unmap_ip(vmlinux_map, sym->end);
+
+   first_pair = machine__find_kernel_symbol(&kallsyms, type,
+mem_start, NULL, NULL);
pair = first_pair;
 
-   if (pair && pair->start == sym->start) {
+   if (pair && pair->start == mem_start) {
 next_pair:
if (strcmp(sym->name, pair->name) == 0) {
/*
@@ -138,10 +143,11 @@ next_pair:
 * off the real size. More than that and we
 * _really_ have a problem.
 */
-   s64 skew = sym->end - pair->end;
+   s64 skew = mem_end - pair->end;
if (llabs(skew) >= page_size)
pr_debug("%#" PRIx64 ": diff end addr 
for %s v: %#" PRIx64 " k: %#" PRIx64 "\n",
-sym->start, sym->name, 
sym->end, pair->end);
+mem_start, sym->name, mem_end,
+pair->end);
 
/*
 * Do not count this as a failure, because we
@@ -159,7 +165,7 @@ detour:
if (nnd) {
struct symbol *next = rb_entry(nnd, 
struct symbol, rb_node);
 
-   if (next->start == sym->start) {
+   if (next->start == mem_start) {
pair = next;
goto next_pair;
}
@@ -172,10 +178,11 @@ detour:
}
 
pr_debug("%#" PRIx64 ": diff name v: %s k: 
%s\n",
-sym->start, sym->name, pair->name);
+mem_start, sym->name, pair->name);
}
} else
-   pr_debug("%#" PRIx64 ": %s not on kallsyms\n", 
sym->start, sym->name);
+   pr_debug("%#" PRIx64 ": %s not on kallsyms\n",
+mem_start, sym->name);
 
err = -1;
}
@@ -208,16 +215,19 @@ detour:
for (nd = rb_first(&vmlinux.kmaps.maps[type]); nd; nd = rb_next(nd)) {
struct map *pos = rb_entry(nd, struct map, rb_node), *pair;
 
-   pair = map_groups__find(&kallsyms.kmaps, type, pos->start);
+   mem_start = vmlinux_map->unmap_ip(vmlinux_map, pos->start);
+   mem_end = vmlinux_map->unmap_ip(vmlinux_map, pos->end);
+
+   pair = map_groups__find(&kallsyms.kmaps, type, mem_start);
if (pair == NULL || pair->priv)
continue;
 
-   if (pair->start == pos->start) {
+   if (pair->start == mem_start) {
 

[tip:perf/core] perf symbols: avoid SyS kernel syscall aliases

2013-08-12 Thread tip-bot for Adrian Hunter
Commit-ID:  3445432b7b24665cf4693fc4794c62d4d768a978
Gitweb: http://git.kernel.org/tip/3445432b7b24665cf4693fc4794c62d4d768a978
Author: Adrian Hunter 
AuthorDate: Wed, 7 Aug 2013 14:38:49 +0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:30 -0300

perf symbols: avoid SyS kernel syscall aliases

When removing duplicate symbols, prefer to remove syscall aliases
starting with SyS or compat_SyS.

A side-effect of that is that it results in slightly improved results
for the "vmlinux symtab matches kallsyms" test.

Signed-off-by: Adrian Hunter 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Mike Galbraith 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375875537-4509-6-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/symbol.c | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 02718e7..ea62ecd 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -87,6 +87,7 @@ static int choose_best_symbol(struct symbol *syma, struct 
symbol *symb)
 {
s64 a;
s64 b;
+   size_t na, nb;
 
/* Prefer a symbol with non zero length */
a = syma->end - syma->start;
@@ -120,11 +121,21 @@ static int choose_best_symbol(struct symbol *syma, struct 
symbol *symb)
else if (a > b)
return SYMBOL_B;
 
-   /* If all else fails, choose the symbol with the longest name */
-   if (strlen(syma->name) >= strlen(symb->name))
+   /* Choose the symbol with the longest name */
+   na = strlen(syma->name);
+   nb = strlen(symb->name);
+   if (na > nb)
return SYMBOL_A;
-   else
+   else if (na < nb)
+   return SYMBOL_B;
+
+   /* Avoid "SyS" kernel syscall aliases */
+   if (na >= 3 && !strncmp(syma->name, "SyS", 3))
return SYMBOL_B;
+   if (na >= 10 && !strncmp(syma->name, "compat_SyS", 10))
+   return SYMBOL_B;
+
+   return SYMBOL_A;
 }
 
 void symbols__fixup_duplicate(struct rb_root *symbols)
--
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:perf/core] perf tools: Make it possible to read object code from kernel modules

2013-08-12 Thread tip-bot for Adrian Hunter
Commit-ID:  0131c4ec794a7409eafff0c79105309540aaca4d
Gitweb: http://git.kernel.org/tip/0131c4ec794a7409eafff0c79105309540aaca4d
Author: Adrian Hunter 
AuthorDate: Wed, 7 Aug 2013 14:38:50 +0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:32 -0300

perf tools: Make it possible to read object code from kernel modules

The new "object code reading" test shows that it is not possible to read
object code from kernel modules.  That is because the mappings do not
map to the dsos.  This patch fixes that.

This involves identifying and flagging relocatable (ELF type ET_REL)
files (e.g. kernel modules) for symbol adjustment and updating
map__rip_2objdump() accordingly.  The kmodule parameter of
dso__load_sym() is taken into use and the module map altered to map to
the dso.

Signed-off-by: Adrian Hunter 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Mike Galbraith 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375875537-4509-7-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/dso.c|  1 +
 tools/perf/util/dso.h|  1 +
 tools/perf/util/map.c| 14 +-
 tools/perf/util/symbol-elf.c | 25 -
 tools/perf/util/symbol.c | 11 ---
 5 files changed, 43 insertions(+), 9 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 121583d..1955804 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -419,6 +419,7 @@ struct dso *dso__new(const char *name)
dso->symtab_type = DSO_BINARY_TYPE__NOT_FOUND;
dso->data_type   = DSO_BINARY_TYPE__NOT_FOUND;
dso->loaded = 0;
+   dso->rel = 0;
dso->sorted_by_name = 0;
dso->has_build_id = 0;
dso->kernel = DSO_TYPE_USER;
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 02aadaf..735a837 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -85,6 +85,7 @@ struct dso {
u8   lname_alloc:1;
u8   sorted_by_name;
u8   loaded;
+   u8   rel;
u8   build_id[BUILD_ID_SIZE];
const char   *short_name;
char *long_name;
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 5f662a3..4d599fe 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -248,14 +248,18 @@ size_t map__fprintf_dsoname(struct map *map, FILE *fp)
 
 /*
  * objdump wants/reports absolute IPs for ET_EXEC, and RIPs for ET_DYN.
- * map->dso->adjust_symbols==1 for ET_EXEC-like cases.
+ * map->dso->adjust_symbols==1 for ET_EXEC-like cases except ET_REL which is
+ * relative to section start.
  */
 u64 map__rip_2objdump(struct map *map, u64 rip)
 {
-   u64 addr = map->dso->adjust_symbols ?
-   map->unmap_ip(map, rip) :   /* RIP -> IP */
-   rip;
-   return addr;
+   if (!map->dso->adjust_symbols)
+   return rip;
+
+   if (map->dso->rel)
+   return rip - map->pgoff;
+
+   return map->unmap_ip(map, rip);
 }
 
 void map_groups__init(struct map_groups *mg)
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index ed6f443..3eaa7b4 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -599,11 +599,13 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, 
const char *name,
if (dso->kernel == DSO_TYPE_USER) {
GElf_Shdr shdr;
ss->adjust_symbols = (ehdr.e_type == ET_EXEC ||
+   ehdr.e_type == ET_REL ||
elf_section_by_name(elf, &ehdr, &shdr,
 ".gnu.prelink_undo",
 NULL) != NULL);
} else {
-   ss->adjust_symbols = ehdr.e_type == ET_EXEC;
+   ss->adjust_symbols = ehdr.e_type == ET_EXEC ||
+ehdr.e_type == ET_REL;
}
 
ss->name   = strdup(name);
@@ -676,6 +678,14 @@ int dso__load_sym(struct dso *dso, struct map *map,
bool remap_kernel = false, adjust_kernel_syms = false;
 
dso->symtab_type = syms_ss->type;
+   dso->rel = syms_ss->ehdr.e_type == ET_REL;
+
+   /*
+* Modules may already have symbols from kallsyms, but those symbols
+* have the wrong values for the dso maps, so remove them.
+*/
+   if (kmodule && syms_ss->symtab)
+   symbols__delete(&dso->symbols[map->type]);
 
if (!syms_ss->symtab) {
syms_ss->symtab  = syms_ss->dynsym;
@@ -828,11 +838,24 @@ int dso__load_sym(struct dso *dso, struct map *map,
map_groups__insert(kmap->kmaps, map);
   

[tip:perf/core] perf symbols: Load kernel maps before using

2013-08-12 Thread tip-bot for Adrian Hunter
Commit-ID:  5b7ba82a75915e739709d0ace4bb559cb280db09
Gitweb: http://git.kernel.org/tip/5b7ba82a75915e739709d0ace4bb559cb280db09
Author: Adrian Hunter 
AuthorDate: Wed, 7 Aug 2013 14:38:46 +0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:31 -0300

perf symbols: Load kernel maps before using

In order to use kernel maps to read object code, those maps must be
adjusted to map to the dso file offset.  Because lazy-initialization is
used, that is not done until symbols are loaded.  However the maps are
first used by thread__find_addr_map() before symbols are loaded.  So
this patch changes thread__find_addr() to "load" kernel maps before
using them.

Signed-off-by: Adrian Hunter 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Mike Galbraith 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375875537-4509-3-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-inject.c |  2 +-
 tools/perf/builtin-script.c |  4 ++--
 tools/perf/tests/code-reading.c |  2 +-
 tools/perf/util/build-id.c  |  2 +-
 tools/perf/util/event.c | 18 ++
 tools/perf/util/thread.h|  2 +-
 tools/perf/util/unwind.c|  4 ++--
 7 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 1d8de2e..f012a98 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -206,7 +206,7 @@ static int perf_event__inject_buildid(struct perf_tool 
*tool,
}
 
thread__find_addr_map(thread, machine, cpumode, MAP__FUNCTION,
- event->ip.ip, &al);
+ event->ip.ip, &al, NULL);
 
if (al.map != NULL) {
if (!al.map->dso->hit) {
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 1cad370..cd616ff 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -341,10 +341,10 @@ static void print_sample_addr(union perf_event *event,
return;
 
thread__find_addr_map(thread, machine, cpumode, MAP__FUNCTION,
- sample->addr, &al);
+ sample->addr, &al, NULL);
if (!al.map)
thread__find_addr_map(thread, machine, cpumode, MAP__VARIABLE,
- sample->addr, &al);
+ sample->addr, &al, NULL);
 
al.cpu = sample->cpu;
al.sym = NULL;
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 28bee62..0c7b052 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -138,7 +138,7 @@ static int read_object_code(u64 addr, size_t len, u8 
cpumode,
pr_debug("Reading object code for memory address: %#"PRIx64"\n", addr);
 
thread__find_addr_map(thread, machine, cpumode, MAP__FUNCTION, addr,
- &al);
+ &al, NULL);
if (!al.map || !al.map->dso) {
pr_debug("thread__find_addr_map failed\n");
return -1;
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 5295625..3a0f508 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -33,7 +33,7 @@ int build_id__mark_dso_hit(struct perf_tool *tool 
__maybe_unused,
}
 
thread__find_addr_map(thread, machine, cpumode, MAP__FUNCTION,
- event->ip.ip, &al);
+ event->ip.ip, &al, NULL);
 
if (al.map != NULL)
al.map->dso->hit = 1;
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 9541270..cc7c0c9 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -592,9 +592,10 @@ int perf_event__process(struct perf_tool *tool 
__maybe_unused,
 void thread__find_addr_map(struct thread *self,
   struct machine *machine, u8 cpumode,
   enum map_type type, u64 addr,
-  struct addr_location *al)
+  struct addr_location *al, symbol_filter_t filter)
 {
struct map_groups *mg = &self->mg;
+   bool load_map = false;
 
al->thread = self;
al->addr = addr;
@@ -609,11 +610,13 @@ void thread__find_addr_map(struct thread *self,
if (cpumode == PERF_RECORD_MISC_KERNEL && perf_host) {
al->level = 'k';
mg = &machine->kmaps;
+   load_map = true;
} else if (cpumode == PERF_RECORD_MISC_USER && perf_host) {
al->level = '.';
} else if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) {
al->level = 'g';
mg = &machine->kmaps;
+   load_map = true;
} else {
/*
 

[tip:perf/core] perf tools: Make it possible to read object code from vmlinux

2013-08-12 Thread tip-bot for Adrian Hunter
Commit-ID:  39b12f7812710e9a5896805d96812b3ede7491e8
Gitweb: http://git.kernel.org/tip/39b12f7812710e9a5896805d96812b3ede7491e8
Author: Adrian Hunter 
AuthorDate: Wed, 7 Aug 2013 14:38:47 +0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:31 -0300

perf tools: Make it possible to read object code from vmlinux

The new "object code reading" test shows that it is not possible to read
object code from vmlinux.  That is because the mappings do not map to
the dso.  This patch fixes that.

A side-effect of changing the kernel map is that the "reloc" offset must
be taken into account.  As a result of that separate map functions for
relocation are no longer needed.

Also fixing up the maps to match the symbols no longer makes sense and
so is not done.

The vmlinux dso data_type is now set to either DSO_BINARY_TYPE__VMLINUX
or DSO_BINARY_TYPE__GUEST_VMLINUX as approprite, which enables the
correct file name to be determined by dso__binary_type_file().

This patch breaks the "vmlinux symtab matches kallsyms" test.  That is
fixed in a following patch.

Signed-off-by: Adrian Hunter 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Mike Galbraith 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1375875537-4509-4-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/dso.c|   4 +-
 tools/perf/util/dso.h|   8 
 tools/perf/util/machine.c|   4 +-
 tools/perf/util/map.c|  35 ---
 tools/perf/util/symbol-elf.c | 100 +++
 tools/perf/util/symbol.c |  22 +-
 6 files changed, 112 insertions(+), 61 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index c4374f0..121583d 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -78,6 +78,8 @@ int dso__binary_type_file(struct dso *dso, enum 
dso_binary_type type,
 symbol_conf.symfs, build_id_hex, build_id_hex + 2);
break;
 
+   case DSO_BINARY_TYPE__VMLINUX:
+   case DSO_BINARY_TYPE__GUEST_VMLINUX:
case DSO_BINARY_TYPE__SYSTEM_PATH_DSO:
snprintf(file, size, "%s%s",
 symbol_conf.symfs, dso->long_name);
@@ -95,9 +97,7 @@ int dso__binary_type_file(struct dso *dso, enum 
dso_binary_type type,
 
default:
case DSO_BINARY_TYPE__KALLSYMS:
-   case DSO_BINARY_TYPE__VMLINUX:
case DSO_BINARY_TYPE__GUEST_KALLSYMS:
-   case DSO_BINARY_TYPE__GUEST_VMLINUX:
case DSO_BINARY_TYPE__JAVA_JIT:
case DSO_BINARY_TYPE__NOT_FOUND:
ret = -1;
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index d51aaf2..02aadaf 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -3,6 +3,7 @@
 
 #include 
 #include 
+#include 
 #include "types.h"
 #include "map.h"
 
@@ -146,4 +147,11 @@ size_t dso__fprintf_buildid(struct dso *dso, FILE *fp);
 size_t dso__fprintf_symbols_by_name(struct dso *dso,
enum map_type type, FILE *fp);
 size_t dso__fprintf(struct dso *dso, enum map_type type, FILE *fp);
+
+static inline bool dso__is_vmlinux(struct dso *dso)
+{
+   return dso->data_type == DSO_BINARY_TYPE__VMLINUX ||
+  dso->data_type == DSO_BINARY_TYPE__GUEST_VMLINUX;
+}
+
 #endif /* __PERF_DSO */
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index f9f9d63..dc35dcf 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -628,10 +628,8 @@ int machine__load_vmlinux_path(struct machine *machine, 
enum map_type type,
struct map *map = machine->vmlinux_maps[type];
int ret = dso__load_vmlinux_path(map->dso, map, filter);
 
-   if (ret > 0) {
+   if (ret > 0)
dso__set_loaded(map->dso, type);
-   map__reloc_vmlinux(map);
-   }
 
return ret;
 }
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 8bcdf9e..5f662a3 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -182,12 +182,6 @@ int map__load(struct map *map, symbol_filter_t filter)
 #endif
return -1;
}
-   /*
-* Only applies to the kernel, as its symtabs aren't relative like the
-* module ones.
-*/
-   if (map->dso->kernel)
-   map__reloc_vmlinux(map);
 
return 0;
 }
@@ -513,35 +507,6 @@ int map_groups__clone(struct map_groups *mg,
return 0;
 }
 
-static u64 map__reloc_map_ip(struct map *map, u64 ip)
-{
-   return ip + (s64)map->pgoff;
-}
-
-static u64 map__reloc_unmap_ip(struct map *map, u64 ip)
-{
-   return ip - (s64)map->pgoff;
-}
-
-void map__reloc_vmlinux(struct map *map)
-{
-   struct kmap *kmap = map__kmap(map);
-   s64 reloc;
-
-   if (!kmap->ref_reloc_sym || !kmap->ref_reloc_sym->unrelocated_addr)
-   return;
-
- 

[tip:perf/core] perf tools: Add support for pinned modifier

2013-08-12 Thread tip-bot for Michael Ellerman
Commit-ID:  e9a7c414477d20c3cc56f90f29c35b06f0f15e25
Gitweb: http://git.kernel.org/tip/e9a7c414477d20c3cc56f90f29c35b06f0f15e25
Author: Michael Ellerman 
AuthorDate: Tue, 6 Aug 2013 23:28:05 +1000
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Wed, 7 Aug 2013 17:35:40 -0300

perf tools: Add support for pinned modifier

This commit adds support for a new modifier "D", which requests that the
event, or group of events, be pinned to the PMU.

The "p" modifier is already taken for precise, and "P" may be used in
future to mean "fully precise".

So we use "D", which stands for pinneD - and looks like a padlock, or if
you're using the ":D" syntax perf smiles at you.

This is an oft-requested feature from our HW folks, who want to be able
to run a large number of events, but also want 100% accurate results for
instructions per cycle.

Comparison of results with and without pinning:

$ perf stat -e '{cycles,instructions}:D' -e cycles,instructions,...

  79,590,480,683 cycles #  0.000 GHz
 166,123,716,524 instructions   #  2.09  insns per cycle
#  0.11  stalled cycles per insn

  79,352,134,463 cycles #  0.000 GHz [11.11%]
 165,178,301,818 instructions   #  2.08  insns per cycle
#  0.11  stalled cycles per insn [11.13%]

As you can see although perf does a very good job of scaling the values
in the non-pinned case, there is some small discrepancy.

The patch is fairly straight forward, the one detail is that we need to
make sure we only request pinning for the group leader when we have a
group.

Signed-off-by: Michael Ellerman 
Acked-by: Namhyung Kim 
Acked-by: Jiri Olsa 
Tested-by: Jiri Olsa 
Cc: Jiri Olsa 
Cc: Peter Zijlstra 
Link: 
http://lkml.kernel.org/r/1375795686-4226-1-git-send-email-mich...@ellerman.id.au
[ Use perf_evsel__is_group_leader instead of open coded equivalent, as
  suggested by Jiri Olsa ]
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/Documentation/perf-list.txt |  1 +
 tools/perf/util/parse-events.c | 11 ++-
 tools/perf/util/parse-events.l |  3 ++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-list.txt 
b/tools/perf/Documentation/perf-list.txt
index eb03f06..6fce6a6 100644
--- a/tools/perf/Documentation/perf-list.txt
+++ b/tools/perf/Documentation/perf-list.txt
@@ -30,6 +30,7 @@ counted. The following modifiers exist:
  H - host counting (not in KVM guests)
  p - precise level
  S - read sample value (PERF_SAMPLE_READ)
+ D - pin the event to the PMU
 
 The 'p' modifier can be used for specifying how precise the instruction
 address should be. The 'p' modifier can be specified multiple times:
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index dba877d..9cba923 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -688,6 +688,7 @@ struct event_modifier {
int precise;
int exclude_GH;
int sample_read;
+   int pinned;
 };
 
 static int get_event_modifier(struct event_modifier *mod, char *str,
@@ -700,6 +701,7 @@ static int get_event_modifier(struct event_modifier *mod, 
char *str,
int eG = evsel ? evsel->attr.exclude_guest : 0;
int precise = evsel ? evsel->attr.precise_ip : 0;
int sample_read = 0;
+   int pinned = evsel ? evsel->attr.pinned : 0;
 
int exclude = eu | ek | eh;
int exclude_GH = evsel ? evsel->exclude_GH : 0;
@@ -734,6 +736,8 @@ static int get_event_modifier(struct event_modifier *mod, 
char *str,
eG = 1;
} else if (*str == 'S') {
sample_read = 1;
+   } else if (*str == 'D') {
+   pinned = 1;
} else
break;
 
@@ -761,6 +765,8 @@ static int get_event_modifier(struct event_modifier *mod, 
char *str,
mod->precise = precise;
mod->exclude_GH = exclude_GH;
mod->sample_read = sample_read;
+   mod->pinned = pinned;
+
return 0;
 }
 
@@ -773,7 +779,7 @@ static int check_modifier(char *str)
char *p = str;
 
/* The sizeof includes 0 byte as well. */
-   if (strlen(str) > (sizeof("ukhGHpppS") - 1))
+   if (strlen(str) > (sizeof("ukhGHpppSD") - 1))
return -1;
 
while (*p) {
@@ -812,6 +818,9 @@ int parse_events__modifier_event(struct list_head *list, 
char *str, bool add)
evsel->attr.exclude_guest  = mod.eG;
evsel->exclude_GH  = mod.exclude_GH;
evsel->sample_read = mod.sample_read;
+
+   if (perf_evsel__is_group_leader(evsel))
+   evsel->attr.pinned = mod.pinned;
}
 
return 0;
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index b36115f..0790452 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-

  1   2   3   4   5   6   7   8   >