Perf: bring CPU online if needed when disabling irq

When disabling an irq, check that the CPU is online
before trying to run on that CPU. Bring the CPU
online if necessary.

This fixes a problem where a CPU that was not online
when disabling the irq caused the disable and the
free to fail. A subsequent attempt to request the irq
also failed because it had not been freed.

Change-Id: Ib873b5ded83ab843ea4e609f196a31ef0083a213
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>

Conflicts:
	arch/arm/mach-msm/perf_debug.c
Perf: Support sw events across hotplug

When CPUs are hotplugged off and on, let the various
sw events continue after the hotplug.

Change-Id: Id1aaf30c459c9cf7c9c38967f9ccad56d4062fd3
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: perf: initialise krait perf L2 counter enables

Clear the L2 counter enables at initialisation.
They are undefined out of reset.

Change-Id: I957106012625ae09efec47d4f657381963d87a5a
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: perf: clean up duplicate constraint events

Events with a duplicate constraint are set to state=OFF when detected,
so that their duplicate counts are not read. However, they were not being
cleaned up because the core code only cleaned up ACTIVE events.
This resulted in counters not being freed and eventually running out
of resources.

Clean up the events with state==OFF that were marked that way because of
constraint duplication.
Ensure counts are not updated for OFF events.

Change-Id: If532801c79e6ad6809869eb0a3063774f00c92c3
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>

Conflicts:

	kernel/events/core.c
Perf: Make per-process counters cumulative

In order to get overall value for performance counters, remove reset during
context switches. Add mechanism to calculate deltas for output to the trace
buffer.

Change-Id: I03d894a1b3bd400d8c256c3068f917ed001fbfd9
Signed-off-by: Sheetal Sahasrabudhe <sheetals@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Perf: Fix PID for tracepoints

Make previous value of PID a per_cpu variable.
This is required to get the correct value for previous_pid.

Change-Id: I63baf8164ae9226189c745339b122d806901789d
Signed-off-by: Sheetal Sahasrabudhe <sheetals@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
scripts/kallsyms: filter symbols not in kernel address space

This patch uses CONFIG_PAGE_OFFSET to filter symbols which
are not in kernel address space because these symbols are
generally for generating code purpose and can't be run at
kernel mode, so we needn't keep them in /proc/kallsyms.

For example, on ARM there are some symbols which may be
linked in relocatable code section, then perf can't parse
symbols any more from /proc/kallsyms, this patch fixes the
problem (introduced b9b32bf70f2fb710b07c94e13afbc729afe221da)

Change-Id: I3d6321b7d87727c7c2802b3924f2e89a28e4b9ca
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@vger.kernel.org
Git-commit: f6537f2f0eba4eba3354e48dbe3047db6d8b6254
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
CRs-fixed: 583755
[nleeder@codeaurora.org: move flag to Makefile because original file
 scripts/link-vmlinux.sh does not exist in 3.4]
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Perf: preserve registers across hotplug

Preserve the registers with userspace bits in them
across hotplug and power collapse. This allows
userspace applications to use the performance counters.

Change-Id: I391563ab770df9aabb5d717b6bc4725750ad0283
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>

Conflicts:
	arch/arm/kernel/perf_event.c
msm: perf: fix formatting of trace entry

Remove extraneous comma which breaks processing of
the trace data.

Change-Id: I5fda44cde6a39b16be06c72bc968afc19636b32f
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: perf: Fix cpu id logic in tracectr notifier

The code in tracecounter context switch notifier was using
smp_processor_id() in order to get cpu number. This was resulting
into following dmesg error: "BUG: using smp_processor_id() in
preemptible [00000000] code".
Use thread_info struct to get the cpu #.

Bug: 12134522
Change-Id: Ic7c995d2c2bc25c4389248854dec91fb84ce3128
Signed-off-by: Sheetal Sahasrabudhe <sheetals@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
net: wireless: bcmdhd: Add Link Layer Statistics support

Signed-off-by: Chilam Ng <chilam@broadcom.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
net: wireless: bcmdhd: add RSSI to Link Layer Statistics

Signed-off-by: Chilam Ng <chilam@broadcom.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ASoC: msm: qdsp6v2: extra low latency mode change for audio capture

For low latency audio capture sessions adm should be opened
in low latency mode. This change checks for low latency
mode and passes the info to ADM.

Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>

Conflicts:
	sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
Reduce min capture period size from 320 to 64

Change-Id: I8d6ed9d06e49561e9a9db51940b997f321a1ae87
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: camera: Directly use stride from buffer_plane_info

stride is already in the unit of bytes. Just need to convert
it to units of 64-bit words.

Bug: 14395767
Change-Id: I57960371911c492cab7d5ca5f710ca0f16572d77
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
arm/dt: msm8974: Enable Microphone Activity Detection

Add Microphone Activity Detection(MAD)'s slimbus device ID and configure
MCLK as a supply of MAD to add MAD support.

Reference CAF commit: 43a3f2d086f6f37acc91fc96cf6d4e887da880d7

Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ARM: hammerhead: turn off android logger

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 15384806
Change-Id: If88b92e5eeb6fdb061816734a63be02a6de95132
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
video: slimport: Fix the case of TV power off

When slimport is connected and TV is off.
slimport will keep seeking for hdmi connection and not notify it.
For the case of this, when connection lost,
Call power down and init, to initialize and wait for connection

Change-Id: I9bbf8b82d77ee69fb758adf8f1805fc88f17700a
Signed-off-by: Se Hun Kim <sean2.kim@lge.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
video: slimport: Fix unblanced IRQ enable

If irq_enabled is set again, it causes the unblanced IRQ enable problem and
slimport would be not working properly. So if irq_enabled is set again,
In order to fix the problem, disable the irq and initialize the flags.

Change-Id: I27ad8ae7d553e515e15dd87744c221dbbb3a0717
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
video: slimport: Set/clear sp_tx_pd_mode in the power control function

sp_tx_pd_mode is the flag if tx power is down or not. So it should be
controlled in the power control function.

Change-Id: I394acbd6c6125dce8725aa81193b7be2abdf47b0
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>