Commit Graph

300425 Commits

Author SHA1 Message Date
Sheetal Sahasrabudhe
e11d14dfd1 KSAPI: Performance monitoring tool for Snapdragon linux
KSAPI records performance statistics for Snapdragon linux platform.
It uses the /proc FS as a means to exchange configuration data and counter
statistics. It can monitor the counter statistics for Scorpion processor
supported hardware performance counters on a per thread basis or AXI
counters on an overall system basis.

Change-Id: Iaaf51db68dbd6d5a55fe34328d041bde5015230d
Signed-off-by: Sheetal Sahasrabudhe <sheetals@codeaurora.org>
(cherry picked from commit 4e6bb52bcee479762f283b4a44a1bdd4f1277aa2)

Conflicts:

	arch/arm/Kconfig
2013-02-20 01:32:08 -08:00
Rohit Vaswani
8636af8f7a arm: process.c: Define arm_pm_idle
Define arm_pm_idle to be arch_idle which is defined in pm-8x60.c
(This code should be moved to the pm-8x60 file later on)

Change-Id: I345d436111c585e4dfbae367dac5d24d1a1f9711
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2013-02-20 01:32:08 -08:00
Rohit Vaswani
8f6baaa96f arm: fiq: Provide empty stubs for fiq functions
A driver using fiq functions should be usable on targets
with or without CONFIG_FIQ enabled. Instead of making code
dependent on #ifdef CONFIG_FIQ, add empty stubs for the fiq
functions.

Change-Id: Ie8b1905ba53664d99bd707be3c83291c97eb1066
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
(cherry picked from commit eb81fb3bdea411fed5c26400f9769bad7fb0743f)
2013-02-20 01:32:07 -08:00
Stepan Moskovchenko
efe7991590 msm: Configure Krait-specific settings
Write a Krait-specific configuration setting when enabling
the MMU.

Change-Id: I539526a4a3fa28b4b466db35c589afecab4ed257
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit 6fd9c9295ce2f95af2868bf2b0b3a7d3c2985aa0)

Conflicts:

	arch/arm/mach-msm/idle-v7.S
2013-02-20 01:32:07 -08:00
Rohit Vaswani
3b3b1aa473 ARM: Disable the external caches during restart
ARM restart code flushes the cpu caches, but leaves
the external caches unflushed. Disable the external cache
to get all the desired data and prevent loss of further
information.

Change-Id: Ie6a6765cdc1dfc8ee7d4c4ed473fdbf4d5ef9b88
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
(cherry picked from commit eee780eafdf990702fdd8178b865af322b2a7621)

Conflicts:

	arch/arm/kernel/process.c
2013-02-20 01:32:06 -08:00
Jeff Ohlstein
3bf244a816 smp: change printks that occur every hotplug to pr_debugs
Hotplug occurs frequently enough on our targets that its messages are
clogging up the logs. There is no need for any messages to be printed
when hotplug is successful.

Change-Id: Icf213ab409ba428f39439f886cdf4c070a48bfbf
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
(cherry picked from commit 4d0bd4217b4e451843dc21208036d25f9d2871f8)

Conflicts:

	arch/arm/kernel/smp.c
2013-02-20 01:32:06 -08:00
Santosh Shilimkar
26027790e5 ARM: smp: Fix Unknown IPI message 0x1
Commit 'ad3b6993' converted ARM smp_cross_call() to take IPI number
as a parameter to handle more event than SGI and do_IPI was suppose
to recover SGI number. But the do_IPI doesn't consider it and it's
getting detected as 'Unknown IPI message 0x1' with ipi numbers are
moved to starts from 'IPI_TIMER=2"

There can be 16 different SGI but only SGI1 is used as IPI so
only that one is handled in do_IPI as IPI_CPU_START.

Added IPI_CPU_START because it wasn't used and thought it's
appropriate. Not sure whether its the right one.

Change-Id: I4dbe7c489d9611fbbb4036c15ac247659fde4119
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Russell King <rmk+kernel at arm.linux.org.uk>
[johlstei@codeaurora.org: fixed bounds check error]
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
(cherry picked from commit 7f685e51169149a877cb3100670567fb03c969f5)
2013-02-20 01:32:05 -08:00
Larry Bassel
0672ddbaee arm: support very early callback into board functions
Due to changes of the order of initialization of
the ARM-specfic memory management code in 3.0, it
is necessary to create a way to call platform specific
code earlier than is currently possible.

Change-Id: I77dae10c85085358f7240889a50b78b07d5af6d1
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit f81fb5655af9aaf573cb11b9a64e0a826fa580e2)

Conflicts:

	arch/arm/kernel/setup.c
2013-02-20 01:32:05 -08:00
Jin Hong
2b50aa3639 arm: show present cpu instead of online cpu in /proc/cpuinfo
Some userspace applications use /proc/cpuinfo to determine how many CPUs
the system has. CPU hotplug can offline a CPU at runtime and causing the
offline CPU not present in /proc/cpuinfo if we only show online cpu in
/proc/cpuinfo.

CRs-Fixed: 354430
Change-Id: I22a15d2d141c713dcd4abaa8bb74ecad6508900f
Signed-off-by: Jin Hong <jinh@codeaurora.org>
(cherry picked from commit 1e28794d0ff00fc6567d68b5b4e863b0745cfe20)
2013-02-20 01:32:04 -08:00
Stepan Moskovchenko
65e4950d12 arm: Add condition code check to SWP emulator
When emulating a SWP/SWPB instruction, check the condition
code of the instruction and compare it against CPSR status
bits rather than relying on the architecture to only raise
an undefined instruction exception if the condition checks
are passing.

Change-Id: I9707960b091c3a5af20e396e0b6d5ed2aaf935ff
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit 3308e7be1800faab8988f2b87c83c3bbb72d7e22)
2013-02-20 01:32:03 -08:00
Stephen Boyd
cc2d715407 msm: clock: Support clk_prepare/unprepare()
Fill in the boiler plate prepare()/unprepare() code. Add a
prepare count and a prepare lock to protect the prepare/unprepare
paths. Also handle the parent/child relationship similarly to how
enable/disable is done.

In particular, WARN() whenever a driver calls clk_enable() before
calling clk_prepare() and whenever a driver calls clk_unprepare()
before calling clk_disable(). This should catch a few bugs even
though it's technically not SMP safe if an enable call is racing
with an unprepare call for example.

We also mark PLLs and XOs as already warned since those are
mostly internal clocks that driver authors aren't aware of. The
markings will be removed when the local clock driver is updated
to handle prepare/unprepare in another patch.

Change-Id: I41dd39d27a279f3477c6e1cef292ac5308d65243
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 3bbf3462ee55a3a0ad48c50214f6263401fc9265)

Conflicts:

	arch/arm/mach-msm/clock-7x30.c
	arch/arm/mach-msm/clock-8960.c
	arch/arm/mach-msm/clock-8x60.c
	arch/arm/mach-msm/clock-9615.c
	arch/arm/mach-msm/clock-debug.c
	arch/arm/mach-msm/clock-rpm.h
	arch/arm/mach-msm/clock.c
	arch/arm/mach-msm/clock.h
2013-02-20 01:32:03 -08:00
Jeff Ohlstein
a562039b92 msm: timer: Use generic sched_clock interface
Change-Id: If733b547cabc7b30ba610f675a9657c3800db384
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
2013-02-20 01:32:02 -08:00
Taniya Das
ea19dcbaba ARM: Kconfig: Fix HAVE_ARM_SCU for MSM_SMP
Select HAVE_ARM_SCU for all targets, irrespective of the chip using the
ARM's SCU.

Change-Id: Icf3706e0c4149ebf834b64b5ed14de98b137b94b
Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit 2760d854e5743bc11be7d56ebe4a42406ff15a6c)

Conflicts:

	arch/arm/Kconfig
2013-02-20 01:32:02 -08:00
Suren Eda Naarayana Kulothungan
8226f46a08 arm: common: CP register access tool for Read/Write to CP registers
The tool can be used to read/write to CP registers by
passing the CP parameters through /sys interface. SMP
support added.

Change-Id: I01d3621f2b6f17d959a237d207b817992404ef88
Signed-off-by: Suren Eda Naarayana Kulothungan <sedanaar@codeaurora.org>
(cherry picked from commit c399b9755096e95036362f00f819c28650eb1a10)

Conflicts:

	arch/arm/Kconfig
	arch/arm/common/Makefile
2013-02-20 01:32:01 -08:00
Jay Chokshi
b24e6e7327 arm: Kconfig: Disable CONFIG_OABI_COMPAT feature on SMP targets
When this option is enabled to support Old ABI, it introduces
a race condition in swap-out code on SMP, such that
instruction is available to the instruction stream (SWI
instruction) but not the data stream.

CPU0		CPU1
clears pte
		executes instruction from page,
		already has I-TLB but no D-TLB entry,
		takes SWI exception
		tries to load instruction, data abort
tlb flush

Therefore, disable this feature on SMP targets.

Change-Id: I4cc4e6924cfcffad391fe2e68d5aa62eee613b0e
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
(cherry picked from commit 82024ccacd693b12dfeeef70e956b7f5d324de80)
2013-02-20 01:32:01 -08:00
Jeff Ohlstein
1e89bc167b arm: Turn off generic lockbreak when using ticket spinlocks
CONFIG_GENERIC_LOCKBREAK can still cause livelocks in some situations,
even when using ticket spinlocks.

Change-Id: I9db23589ffe1d054e9a359804a6c4858baeb6602
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
(cherry picked from commit 8a9e3936053600b647921b6196e667772f815857)
2013-02-20 01:32:00 -08:00
Brent DeGraaf
0286aa474e arm: Implement ticket spin-locks
Introduce optional ticket locks to help ensure fairness in
contended locks, as well as preventing livelock.

CRs-fixed: 302764
Signed-off-by: Brent DeGraaf <bdegraaf@codeaurora.org>

Conflicts:

	arch/arm/include/asm/spinlock.h
(cherry picked from commit 8e7b85734e72e3f9e8383017097a9c2faacfac14)

Conflicts:

	arch/arm/Kconfig

Change-Id: I0f37346fd621ae5d8df62b3393c4f7c9d6aa7af6
2013-02-20 01:31:59 -08:00
Laura Abbott
2972c10df5 arm: Add HOLES_IN_ZONE option
Previous, commit 14e0729841
(add pfn_valid_within helper for sub-MAX_ORDER hole detection)
added support for the HOLES_IN_ZONE option. A corresponding
Kconfig was added to ia64 but not arm. Add support for this
option.

Change-Id: Ia37263f0f448cdbceb37ac2525cca906ba53f0f8
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
(cherry picked from commit 224d00ca68501bea52600e53c12a37f7ef96172d)
2013-02-20 01:31:59 -08:00
Bryan Huntsman
e900f7edd3 ARM: allow memory hotplug/hotremove
Add ARM to the supported list of architectures for MEMORY_HOTPLUG.  For
ARM, the selection of MEMORY_HOTPLUG/REMOVE is specific to the sub-arch
and has to be explicitly enabled by the sub-arch.

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
(cherry picked from commit 45f580d9c36b93204882dffc6fb9f4a254c3d34a)
2013-02-20 01:31:58 -08:00
Larry Bassel
f1ed1b1cec arm: add support for DONT_MAP_HOLE_AFTER_MEMBANK0
Some platforms have memory at the top of the
first memory bank which the kernel cannot
access. Mapping this is unnecessary and wastes
precious virtual space.

Change-Id: I20be40a17c5d80d889b0903f11fa0fe1b3190e7a
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit fe101112b8354688c509ce7474ea88ff6ed86bef)

Conflicts:

	arch/arm/mach-msm/include/mach/memory.h
2013-02-20 01:31:58 -08:00
Zach Pfeffer
3ee0a6af9a cpufreq: Add option to turn cpufreq on.
Signed-off-by: Zach Pfeffer <zpfeffer@quicinc.com>
(cherry picked from commit 403116c6ae351d252da87aed11af03e6d649dac1)
2013-02-20 01:31:57 -08:00
Larry Bassel
aa956bcf4c msm: fix circular dependency warning when ENABLE_DMM is set
When ENABLE_DMM was set, it caused a warning about
a circular dependency with MEMORY_HOTPLUG to be emitted.

Fix this by making all DMM config options depend on ENABLE_DMM (only)
and not having ENABLE_DMM depend on anything.

Change-Id: I1c0faf92163d49dca38fb2895be68eac21e7d38a
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit e509155d9bf38f5225f2ded0485efddaf671d4e1)

Conflicts:

	arch/arm/Kconfig
2013-02-20 01:31:57 -08:00
Larry Bassel
0b7fcaa422 arm: add CONFIG_FIX_MOVABLE_ZONE
This config option signifies that the start and size
of the movable zone has been calculated and it
must be placed precisely there.

Change-Id: Ibecda03ca69282c4efc84c642885dd47d1080ca2
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 6eae21afbeffe9d820bd5de47884db1e3d940b4d)

Conflicts:

	arch/arm/Kconfig
2013-02-20 01:31:56 -08:00
Larry Bassel
a88d98f898 arm: Add support for CONFIG_ENABLE_DMM
Add a new config ENABLE_DMM that will turn on/off the DMM feature.
DMM stands for "dynamic memory management" (the ability to power
off some memory when the system is idle) and the reason this
is needed is that many customers do not want this functionality
and we want to provide a consistent and simple way of turning
this off, rather than the ad-hoc methods some have been using.

DMM currently is enabled by default on 8960.

The following configs are currently used only by DMM
and will be disabled if ENABLE_DMM is not true.

CONFIG_MEMORY_HOTPLUG
CONFIG_HOTREMOVE
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE
CONFIG_MIGRATION
CONFIG_ARCH_MEMORY_PROBE
CONFIG_ARCH_MEMORY_REMOVE

CRs-Fixed: 344176
Change-Id: I1f1fa8a8882136a38f0abd01b0f5cb59c9a25152
Signed-off-by: Jack Cheung <jackc@codeaurora.org>
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit b8d6102e021946973b20f4c2646e24c256eaab32)

Conflicts:

	arch/arm/Kconfig
	arch/arm/mach-msm/Kconfig
	arch/arm/mach-msm/board-8930.c
	arch/arm/mach-msm/board-8960.c
	arch/arm/mach-msm/memory_topology.c
2013-02-20 01:31:55 -08:00
Karthik Parsha
6f6be7d526 msm: 7x30: Enable SPARSEMEM, HOTPLUG, HOTREMOVE.
Enable Sparsemem, Hotplug, Hotremove and Migration
for 7x30.

Change-Id: I55b96a6513b1da61263ac2f7708bbb894a156c73
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
(cherry picked from commit c1fbe4a987b6fccffe11d86ee00b25348be426f7)

Conflicts:

	arch/arm/Kconfig
	arch/arm/mach-msm/Kconfig
2013-02-20 01:31:55 -08:00
Larry Bassel
8503bf395a Add Kconfig options for memory probe and remove
These are needed to support physical hotplug and hotremove on
ARM platforms which contain memory that may be powered on and off
(instead of physically inserting and removing the memory).

Change-Id: Id0e5442924612370cbc4067a964f82e7a8305b88
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit d77db7e30a3b3e3d7eac98bcfd09919da9959827)

Conflicts:

	arch/arm/Kconfig
2013-02-20 01:31:54 -08:00
Junjie Wu
29f3c3c155 mm: add HAVE_MEMBLOCK_NODE_MAP support
ARCH_POPULATES_NODE_MAP in 3.0 is replaced by HAVE_MEMBLOCK_NODE_MAP in
3.4.  add_active_range() is replaced with memblock_set_node().  They do
basically the same thing, but embedding nid field into memblock_region
is much cleaner than a separate early_node_map.

HAVE_MEMBLOCK_NODE_MAP is not selected by default.

See commit 4a2164a7db for more info.

Change-Id: Icb44a8cea365b2d32df80628a57535a3d46fbd55
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
(cherry picked from commit 9a2068712f9d7c648aaf19ab720b713d7df6afa9)

Conflicts:

	arch/arm/Kconfig
2013-02-20 01:31:54 -08:00
Larry Bassel
45a3628c59 arm: add support for ARCH_POPULATES_NODE_MAP
ARCH_POPULATES_NODE_MAP is used by most of the other
architectures and allows finer-grained control of
how and where zones are placed.

Signed-off-by: Larry Bassel <lbassel@codeaurora.org>

Conflicts:

	arch/arm/mm/init.c
(cherry picked from commit d4e809ea8cca0ae779706dd17a2d36af26efadca)

Conflicts:

	arch/arm/Kconfig

Change-Id: I3dfc842731d3cb2c224ef6a2c4b72074b14f0384
2013-02-20 01:31:53 -08:00
Rebecca Schultz
af5692826b PM: earlysuspend: Removing dependence on console.
Rather than signaling a full update of the display from userspace via a
console switch, this patch introduces 2 files int /sys/power,
wait_for_fb_sleep and wait_for_fb_wake.  Reading these files will block
until the requested state has been entered.  When a read from
wait_for_fb_sleep returns userspace should stop drawing.  When
wait_for_fb_wake returns, it should do a full update.  If either are called
when the fb driver is already in the requested state, they will return
immediately.

Signed-off-by: Rebecca Schultz <rschultz@google.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 4b0ea27fc8202b21ce338c82b55eee9c281bd7da)
2013-02-20 01:31:53 -08:00
Arve Hjønnevåg
08e9da6c0e PM: earlysuspend: Add console switch when user requested sleep state changes.
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit c8bb31538d668c9d451e029d45edcd7c35892624)
2013-02-20 01:31:52 -08:00
Arve Hjønnevåg
073967b96f PM: Add early suspend api. 2013-02-20 01:31:50 -08:00
Arve Hjønnevåg
de6c8784e4 PM: Implement early suspend api
(cherry picked from commit c1783f55b10d7dfb4ada9a7149821b644255d8df)
2013-02-08 15:14:36 -08:00
Arve Hjønnevåg
201a5f42b3 PM / Sleep: Add wake lock api wrapper on top of wakeup sources
Change-Id: Icaad02fe1e8856fdc2e4215f380594a5dde8e002
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit e9911f4efd)

Conflicts:

	kernel/power/Kconfig
2013-02-08 15:14:36 -08:00
Arve Hjønnevåg
0a12f0c6d5 PM: Implement wakelock api.
PM: wakelock: Replace expire work with a timer

The expire work function did not work in the normal case.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit fe6cd633efb6d6070507deee0116be43cf4bc76b)
2013-02-08 15:14:35 -08:00
James Bottomley
918034c20e slub: fix panic with DISCONTIGMEM
commit 4a5fa3590f upstream.

Slub makes assumptions about page_to_nid() which are violated by
DISCONTIGMEM and !NUMA.  This violation results in a panic because
page_to_nid() can be non-zero for pages in the discontiguous ranges and
this leads to a null return by get_node().  The assertion by the
maintainer is that DISCONTIGMEM should only be allowed when NUMA is also
defined.  However, at least six architectures: alpha, ia64, m32r, m68k,
mips, parisc violate this.  The panic is a regression against slab, so
just mark slub broken in the problem configuration to prevent users
reporting these panics.

Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

(cherry picked from commit 7c650d5dfafac48213c0a652b7b1a18a3c391538)
2013-02-08 15:14:35 -08:00
Matt Wagantall
4a578b5030 tracing/filter: Correct potential uninitialized variable
'ret' in __ftrace_function_set_filter() may be used uninitialized
if 're_count' is zero. Fix this to avoid a compiler warning.

Change-Id: I0a257159141d86d92573c28d233a3653e89c48ea
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
(cherry picked from commit 212806984abf1c19d56f5c0c0e72e38a318851e1)
2013-02-08 15:14:34 -08:00
Colin Cross
7b5889513d HACK: time: Disable alarmtimer
kernel/time/alarmtimer.c conflicts with drivers/rtc/alarm.c,
disable it for now.

Change-Id: I6cdb3b885828d45836a54971adf16143039b0a0e
Signed-off-by: Colin Cross <ccross@android.com>
(cherry picked from commit abbb445f65bbb139202fde5a66f9a249977058c9)
2013-02-08 15:14:34 -08:00
Rohit Vaswani
452a93234e kernel: sched: MSM changes to core.c
This is a squash of 2 older commits on kernel/sched.c

	commit 099aa69b9cfb6f4c5b56dd1d1d06ce9ef92cf2d5
	Author: Steve Muckle <smuckle@codeaurora.org>
	Date:   Tue Feb 28 14:07:39 2012 -0800

	    kernel: reduce sleep duration in wait_task_inactive

	    Sleeping for an entire tick adds unnecessary latency to
	    hotplugging a cpu (cpu_up).

	Change-Id: Iab323a79f4048bc9101ecfd368e0f275827ed4ab
	Signed-off-by: Steve Muckle <smuckle@codeaurora.org>

	commit 52984e96358c55f89947c6de6e63d70261479f67
	Author: Jeff Ohlstein <johlstei@codeaurora.org>
	Date:   Wed Jun 23 12:59:04 2010 -0700

	    sched: Extend completion api to allow io_wait time tracking

	    Adds a function wait_for_completion_io which behaves like
	    wait_for_completion, except it calls io_schedule instead of
	    schedule. This indicates that the process waiting on the
	    completion is waiting on an io event, and keeps statistics
	    accordingly.

	Change-Id: I2514d62ff7f26441782a4cbebc4a18c07bb5ad74
	Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2013-02-08 15:14:33 -08:00
Srivatsa Vaddagiri
948432de62 sched: fix rq->lock recursion
Enabling SCHED_HRTICK currently results in rq->lock recursion and a hard
hang at bootup.  Essentially try_to_wakeup() grabs rq->lock and tries
arming a hrtimer via hrtimer_restart(), which deep down tries waking up
ksoftirqd, which leads to a recursive call to try_to_wakeup() and thus
attempt to take rq->lock recursively!!

This is fixed by having scheduler queue hrtimer via
__hrtimer_start_range_ns() which avoids waking up ksoftirqd.

Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Change-Id: I11a13be1d9db3a749614ccf3d4f5fb7bf6f18fa1
(cherry picked from commit 4ca1d04ea0bdc225cc7db302172f3375a63f44de)
2013-02-08 15:14:33 -08:00
Steve Muckle
90b392ea77 init: apply SCHED_FIFO to kthreadd
Hotplug (cpu_up) latency currently suffers because the system
must wait for kthreadd to spawn certain kthreads (such as the
migration and workqueue kthreads) and for them to run for
the first time. Setting SCHED_FIFO will cause kthreadd to run
immediately. The newly created kthreads will inherit the scheduler
policy and run immediately also.

The scheduling policy of newly created kthreads is already set
back to SCHED_NORMAL in kthread_create_on_node, so nothing needs
to be done to restore normal scheduling behavior for the kthreads
once spawned.

Change-Id: I236ceb29845cf58ea1ea886fc3210ccaab2dd792
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 82440737eef236077e5781061b4c8de2c0b013fb)
2013-02-08 15:14:32 -08:00
Pushkar Joshi
5539a49c6b coresight: Have trace_marker only log the actual data
The stm_log call in tracing_mark_write was logging the complete
internal buffer data structure instead of only the data part.
Changing the call to only log the data.

Change-Id: I33e800cd9b1dc1d27d519c74db0cf5bb6ef6e3f5
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
(cherry picked from commit 949ddf3099ab51ea34bc16b44c0aec7fafd4105d)
2013-02-08 15:14:32 -08:00
Pushkar Joshi
e9a4bb27f2 coresight: have trace_printk only log the actual data to STM
The trace_printk, when configured to process printk strings before
storing them in the internal ring buffer, currently also logs the
complete internal buffer data structure to the STM. Instead it
should only log the string output obtained after processing the
printk format and arguments. Changing the stm_log call to only
log this relevant data.

Change-Id: Ia33109f95fb84fa1606247a861deeaedd2f95d3f
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
(cherry picked from commit aaa6da531fe2cbf685791d217f3ed6bd08392a43)
2013-02-08 15:14:31 -08:00
Pratik Patel
0ddf02dbb7 coresight: enable stm logging for ftrace events and printk
Dup ftrace event traffic (including writes to trace_marker file from
userspace) to STM. Also dup printk traffic to STM. This allows Linux
tracing and log data to be correlated with other data transported over
STM.

Change-Id: Ieb0b856447f7667eb0005a6a884211dc46f50217
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
(cherry picked from commit 8e1e6b65fe92a0fa7bdb787fc7d9c5c0eae3d654)

Conflicts:

	include/linux/coresight-stm.h
	kernel/printk.c
2013-02-08 15:14:31 -08:00
Matt Wagantall
b336dafa11 trace: cpu_freq_switch: Add profiler for CPU frequency switch times
It is sometimes useful to profile how long CPU frequency switches
take, and traces have already been added for this purpose. Make
use of these and the trace_stat framework to generate statistical
histograms of frequency switch times in the following format:

 # cat /sys/kernel/debug/tracing/trace_stat/cpu_freq_switch
  CPU START_KHZ  END_KHZ COUNT AVG_US MIN_US MAX_US
    |         |        |     |      |      |      |
    0    384000  1512000     3   2787   1648   3418
    0    486000   384000     1   1129   1129   1129
    0   1458000   384000     1   3174   3174   3174
    0   1512000   384000     1   3265   3265   3265
    0   1512000   486000     1   3235   3235   3235
    0   1512000  1458000     1    213    213    213
    0   1512000  1512000     1      0      0      0

Profiling is disabled by default (since it does incur some
overhead). It can be enabled or re-disabled echoing 1 or 0
to /sys/kernel/debug/tracing/cpu_freq_switch_profile_enabled

Change-Id: I3ef7f9d681b7bd13bcaa031003b10312afe1aefe
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
(cherry picked from commit a629fb0b67b57cc6759da51b9c12750758736c80)
2013-02-08 15:14:30 -08:00
Badhri Jagan Sridharan
25753c5aee trace: Modify timer_start and irq_handler_entry trace events.
The timer_start event now shows whether the timer is
deferrable in case of a low-res timer. The debug_activate
function now includes deferrable flag while calling
trace_timer_start event. irq_handler_entry
event includes the ISR function in the trace event.

Change-Id: Ia2eeb4fa0fae34b301964144dad8bcef7632487c
Signed-off-by: Badhri Jagan Sridharan <badhris@codeaurora.org>
(cherry picked from commit a2cd6eaf5deaa40098eb6b692797519bc173381e)
2013-02-08 15:14:30 -08:00
Amar Singhal
6ff0621e3b tick-sched: change the cpu that updates rq_stats
It can happen that the scheduler tick stops on cpu 0 but keeps
running on some other cpu. Make the cpu in-charge of updating
the jiffies also update the rq_stats.

Change-Id: Idb1a8132bd96500c68c516b4a99663965cec28e1
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
(cherry picked from commit f10f2a8bad44078c11378d9a0da025bc4a8e0f15)
2013-02-08 15:14:29 -08:00
Jeff Ohlstein
1c0a4128e4 tick-sched: recalculate sleep length each time it is requested
Recalculating the sleep length each time its called allows us to account
for the fact that the amount of time we can sleep for might change after
tick_nohz_stop_sched_tick is called in idle. The prime example of this
is an idle notifier that cancels timers as we are entering idle.

Change-Id: I92871efc7befb3fee2a816da16145ba9da334a9e
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
(cherry picked from commit 9feb87d70208e2236d24ef0ac2fa4d0e28e7d335)
2013-02-08 15:14:28 -08:00
Amar Singhal
b551c512c1 rq_stats: Doing rq_stats calculation in the scheduler tick.
With this change, we do the average run queue statistics calculation
in the scheduler tick itself. This helps avoid any extra timers to
do the same. Also doing this calculation in the scheduler tick avoids
any bias if the calculation is done in a workqueue

Change-Id: I854d90acc05cc7a7226487be5555976826d8c837
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
(cherry picked from commit f49d99bc4168c7937655bb09989cc72525163b40)
2013-02-08 15:14:28 -08:00
Rick Adams
e8605d39a3 msm: 8x55: put reason for boot in procfs from SMEM
During board initialization read the shared memory item
SMEM_POWER_ON_STATUS_INFO and place it in the procfs at
/proc/sys/kernel/boot_reason

The data item is an integer with a bit being set to identify the reason
the device was powered on. The values of this data item is defined in
the document Document/arm/msm/boot.txt, the following is the data in the
documentation file.

power_on_status values set by the PMIC for power on event:
----------------------------------------------------------
0x01 -- keyboard power on
0x02 -- RTC alarm
0x04 -- cable power on
0x08 -- SMPL
0x10 -- Watch Dog timeout
0x20 -- USB charger
0x40 -- Wall charger
0xFF -- error reading power_on_status value

This is change is a response to a customer request described in
JIRA KERNEL-518

Change-Id: I59e665f92e6e29f7dfef4380314f676a2d92c94b
Signed-off-by: Rick Adams <rgadams@codeaurora.org>
(cherry picked from commit 9512d7e26abc9d23a1771533c5300605d70dfaa7)

Conflicts:

	arch/arm/include/asm/processor.h
	arch/arm/mach-msm/board-msm7x30.c
	kernel/sysctl.c
2013-02-08 15:14:28 -08:00
Steve Muckle
0eeabce591 sched: add sysctl for controlling task migrations on wake
The PF_WAKE_UP_IDLE per-task flag made it impossible to enable
the old behavior of SD_SHARE_PKG_RESOURCES, where every task
migrates to an idle CPU on wakeup.

The sched_wake_to_idle sysctl value, when made nonzero, will cause
all tasks to migrate to an idle CPU if one is available when the
task is woken up. This is regardless of how PF_WAKE_UP_IDLE is
configured for tasks in the system. Similar to PF_WAKE_UP_IDLE,
the SD_SHARE_PKG_RESOURCES scheduler domain flag must be enabled
for the sysctl value to have an effect.

Change-Id: I23bed846d26502c7aed600bfcf1c13053a7e5f61
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 9d5b38dc0025d19df5b756b16024b4269e73f282)

Conflicts:

	kernel/sched/fair.c
2013-02-08 15:14:27 -08:00