Adding a new ioctl to support sanitize operation in eMMC
cards version 4.5.
The sanitize ioctl support helps performing this operation
via user application.
Change-Id: I79aa4163e7753a75bed5a26a9a92de902b4b9c21
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
(cherry picked from commit 73937f5face75e05ec2a72966d04f4e20aa18379)
Conflicts:
block/blk-core.c
block/elevator.c
include/linux/blk_types.h
include/linux/blkdev.h
include/linux/fs.h
This commit adds a bitmap_find_next_zero_area_off() function which
works like bitmap_find_next_zero_area() function expect it allows an
offset to be specified when alignment is checked. This lets caller
request a bit such that its number plus the offset is aligned
according to the mask.
Change-Id: Ib0593cf578ed69ba4c51b1e102a1f8ea1aeb93e8
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 5f2929128ae4db1a6577748c72437f102ed400a5)
Parts of it come from:
commit 7d7c53a7d691a6effc30e51b6a9855affad414f2
Author: Michal Nazarewicz <mina86@mina86.com>
AuthorDate: Wed Dec 15 21:34:23 2010 +0100
Commit: Larry Bassel <lbassel@codeaurora.org>
CommitDate: Tue Apr 26 15:22:13 2011 -0700
Change-Id: Ia6d45c3166de50258c5e7703b71003065d570221
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Add caller information to memory allocation calls and
create /sys/kernel/debug/mempool/map to show the current set of
allocations across all memory pools.
Change-Id: I0f3613158595a3a12837c46dfe500e2e3fea57b9
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit 9081938c99b91c714316d6fa3a6618ab27789dc7)
Conflicts:
arch/arm/mach-msm/memory.c
allocate_contiguous_memory_nomap returns an unsigned long yet it
was returning errno codes for various failures. Replace all negative
errno codes with 0, which is what all the callers expect on error anyway.
Change-Id: I3f847f70e0d7fa947a3442f43a980b3ffb1bfd96
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit f319151ecf9bdb51295ddbf6ac8385f63fd4ae70)
Remove the function prototype for the function
alloc_from_memory_pool() (this function was never implemented).
The function mem_type_to_memory_pool() was not intended to be
exported, so remove the export and function prototypes.
Change-Id: Iac47d5c8a8aaf21554c2a7a56f42d6f7de689d3e
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit fe7d2ee21af00476fe9e578fcfea1c34a70bd30f)
Add a generic library (which uses genalloc) that manages
pools of contiguous memory.
APIs are provided to allocate (and if desired map) and free
memory, as well to initialize a memory pool.
Change-Id: I75deda08eb852a323b4d1a32c3b7980e7aa143a8
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 54bff5255ff4adf204d2b4a9805cdb998167fb9e)
vt_waitactive now needs a 1 based console number
Change-Id: I07ab9a3773c93d67c09d928c8d5494ce823ffa2e
(cherry picked from commit b28a6a111c2c4779f92f310cfefe10606df4999f)
Avoids a problem where the device sometimes hangs for 20 seconds
before the screen is turned on.
Change-Id: Ib24dad1f0f56d280a80be820200ee9e9aea7a911
(cherry picked from commit 044fb1a352b4d367048b24c8c39abc2e572dc0e7)
Conflicts:
kernel/power/process.c
Use DEBUG_WAKEUP flag to show wakelocks that abort suspend, in
addition to showing wakelocks held during system resume.
DEBUG_WAKEUP is enabled by default.
Change-Id: If6fa68e8afbc482a5300ffab2964694b02b34f41
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit ca64b0cd3a12d7704f4e98f4f5d51f41eb5047a2)
If the wakelock driver aborts suspend due to an already-held
wakelock, don't report the next wakelock held as the "wake up
wakelock".
Change-Id: I582ffbb87a3c361739a77d839a0c62921cff11a6
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit ed27e538aa97278e26a6c00f14f6e2e076a1a2ae)
When DEBUG_SUSPEND is enabled print active wakelocks when we check
if there are any active wakelocks.
In print_active_locks(), print expired wakelocks if DEBUG_EXPIRE is enabled
Change-Id: Ib1cb795555e71ff23143a2bac7c8a58cbce16547
Signed-off-by: Mike Chan <mike@android.com>
(cherry picked from commit af62b25adba1fe01c91aa88c95d1584371ab2bf9)
Since the workqueue code deletes the work before executing it,
checking for no work item being currently queued to the workqueue
is not sufficient to guarantee that all the works have finished
execution.
Use a counter to guarantee that all the pending suspend_sys_sync()
works have finished execution before returning from
suspend_sys_sync_wait().
CRs-Fixed: 293595
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Conflicts:
kernel/power/wakelock.c
(cherry picked from commit 529461b70c7dc20b0371e54a63844edae905d7a2)
Conflicts:
kernel/power/wakelock.c
Change-Id: I501743b6b76e492e1598df83ebc1178835ae8405
Wakeup the userspace poll on change of display status. The
userspace then may take action to change the
power/performance characteristics of the device.
Change-Id: I9bd11f3d895d3d83230104f5d8dcd1deeaa754cd
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
(cherry picked from commit 2fb0354486e2d7b8d73622cbdbb941748a921240)
This fixes the issue where LCD takes a long time to come back up
since the execution of backlight on and late_resume works by the
suspend worker thread is delayed due to one (or more) of the
sys_sync calls in early_suspend and suspend paths taking a long
time (sometimes 15sec or more) for the below reported scenario(s):
Scenario 1 (copy with usb connected):
1. plug usb
2. adb shell
3. busybox cp /sdcard/file1 /sdcard/file2 (copy >= 100MB file1
in sdcard/emmc to file2 in sdcard/emmc)
4. press end key to suspend
5. press end key again and it takes a long time for LCD to come
back up
Scenario 2 (background copy):
1. plug usb
2. adb shell
3. busybox cp /sdcard/file1 /sdcard/file2 & (copy >= 100MB file1
in sdcard/emmc to file2 in sdcard/emmc)
4. disconnect usb
5. press end key to suspend
6. press end key again and it takes a long time for LCD to come
back up
A more common form of Scenario 2 is for the user to just use the
copy function on the UI to copy large file(s).
We address this by moving sys_sync calls to a separate workqueue
and having a timeout polling based mechanism to bail out of suspend
in case of user invoking a wakeup event (like end key press) while
we are waiting for the sys_sync completion at the synchronization
point in suspend worker thread context.
CRs-Fixed: 283994
Change-Id: I6b54af8432e58fd5442817b7388ce2e0b83354b6
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
(cherry picked from commit 8564b5ebeafa2be276e0004d7d32bd101642fb3d)
Conflicts:
kernel/power/process.c
when enabled, prints out the function of each handler as they are called
Change-Id: I5ed251867e0e3aa3cd05f030ff3579808cedd0c2
Signed-off-by: Erik Gilling <konkers@android.com>
(cherry picked from commit fec502d9a18bbe8045c67bd4f9d3a1ade4e78555)
If EARLYSUSPEND is enabled then writes to /sys/power/state no longer
blocks, and the kernel will try to enter the requested state every
time no wakelocks are held. Write "on" to resume normal operation.
Change-Id: Icbe3c6fe6f5e0f4a3f948f1495546690ac9fd6e6
(cherry picked from commit 219955f707852f68f5118a515fc43ad067728ab9)
Sysfs_notify takes a mutex and therefore cannot be called from atomic
context like interrupt handler in this case. Use a workqueue to schedule
the work instead.
Change-Id: I0a5230fe379aa51f1065df4af9b27f471aa22440
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
(cherry picked from commit 97d68a8b69e87480c436dd8365b438c3d18fed47)
Conflicts:
kernel/power/main.c
Provide userspace with a pollable sysfs entry that it can poll
on waiting for touch event notifiction. Once it
is woken up, the userspace can take action to change the
power/performance characteristics of the device for the duration
of the event.
Change-Id: Iab84f729f2ea3a5352c4e5173f78544023a276c1
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
(cherry picked from commit ac2a6d6453c50db7ba7c0b3aa328a3ba48a84abf)
This adds /sys/power/wake_lock and /sys/power/wake_unlock.
Writing a string to wake_lock creates a wake lock the
first time is sees a string and locks it. Optionally, the
string can be followed by a timeout.
To unlock the wake lock, write the same string to wake_unlock.
Change-Id: I66c6e3fe6487d17f9c2fafde1174042e57d15cd7
(cherry picked from commit 025ff0ad2f)
Conflicts:
kernel/power/Makefile
kernel/power/power.h
Add support for the A15 generic timer and clocksource.
As the timer generates interrupts on a different PPI depending
on the execution mode (normal or secure), it is possible to
register two different PPIs.
Change-Id: Ibaddc7f174bc168cef579b66ab06b966878ae155
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Sathish Ambley <sambley@codeaurora.org>
(cherry picked from commit f5b3b2b2a44e813fbbe1799965a8879429f59329)
Conflicts:
arch/arm/kernel/Makefile
Added indirect L2 rw support to cpaccess kernel module. Input format
change to include a parameter to specify register access type. Validation
if register type is one of supported types.
Change-Id: I5bd52c89d87a4fb4da4248526e56079bb604f910
Signed-off-by: Suren Eda Naarayana Kulothungan <sedanaar@codeaurora.org>
(cherry picked from commit 4c317fbf87a93d8e34e33063b6164e5d5c32cdd0)
This patch adds support to recognise cortex A5 cputype for oprofile,
which in turn enables the armv7 generic events to be picked.
Change-Id: I025f4b361b4e85bbeea4eefc71572f4ae5b602e4
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
(cherry picked from commit 1540f31eb76f2e775d1a04edb6d9f8397d4f6637)
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
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>
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)
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
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
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)
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
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)
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)
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
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
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
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)
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)
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
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)
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)
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