Revert "mm: make is_vmalloc_addr work properly."

This reverts commit d560dd9a8fd200d119be3bb9d99f22b0f06eddb4

Change-Id: I610975d802b11c6c382c2c29f8e2394ce8acce2d
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: set vsync clock rate

Vsync clock rate is not set when vsync clock is enabled.
This cause command mode TE logic not works.

Change-Id: Ibf7dd07e53b2cd76ef30f13133368000c79ae149
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: Fix race condition for vsync irq enable/disable

Disable and enable of vsync happens in separate thread, which
may lead to a race condition where enable/disable may
happen at the same time and resulting irq in disable state.
Add lock to properly synchronize the enabling/disabling
of vsync interrupts to fix race condition.

Change-Id: Ib52bea5ca7a3612c866a4a962f09725a77e40563
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
USB: u_serial: Don't free usb_requests in gs_close and reuse them

Commit: 950a3a3 "USB: Gadget: u_serial: Freeing usb requests as a
part of gs_close" results in freeing requests and flushing the EP
on every port close even if USB connection is present. These requests
are allocated again on port open. Also, EP flush call may result in
unclocked access of USB hardware if USB BUS state was suspended at
the time of port_close. This patch fixes that and also addresses the
original issue of gs_open allocating usb requests on every port_open
by adding a condition to allocate USB requests in port open only if
they are not already allocated.

CRs-fixed: 591617
Change-Id: If2ab31fa1d36ea6119dc0ced13ade5ed93d85d86
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: smd_tty: add new SMD TTY port

Add new port for exporting DATA4 (ATCoP) to userspace.

CRs-Fixed: 519977
Change-Id: I63f79788ff06a00c3aead4a725039ae14feb020f
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: smd_tty: add device tree support to smd_tty drivers

SMD TTY is configured using local tables that do not
allow customization on a per-target basis.

Add device tree support to configure SMD TTY devices.

Change-Id: Ie02dd63a0bec8edff77c8cbeeb72ae7331a0c67a
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: smd_tty: replace wake lock with wakeup source

Wake locks have been deprecated.

Remove deprecated wake lock calls and replace with wakeup sources and
power-management calls.

Change-Id: Ibb3d84ae20ed0af43254e46b344be8d86e97c717
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm:camera: Limit prints in isp

Change every pr_err in msm_vfe_process_error_status to
pr_err_ratelimited to avoid watchdog reset

Change-Id: I248ac7f2d5c64a2743ba223eda77a63888ed1e0f
CRs-fixed: 584604
Signed-off-by: Yiduo Wang <yiduow@codeaurora.org>
(cherry picked from commit 52ed86e0e72116dc5e59ee38485d1d0a26b5855b)
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
sched: set sched_mc_power_savings to 2, which is the highest power saving possible value for this tunable. Basically according to http://elinux.org/images/1/1d/Comparing_Power_Saving_Techniques_For_Multicore_ARM_Platforms.pdf this tunable provides serious power saving improvements close to the power savings of hotpluging cores. Since in this Kernel we're using always a minimum of 2 cpus online at any time during screen off we might actually benefit from this because this feature packs tasks together and try to bind them to cpu0, which in theory will let cpu1 idle longer, thus improving battery life.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: Allow lowmem to be non contiguous and mixed.

Any image that is expected to have a lifetime of
the entire system can give the virtual address
space back for use in vmalloc.

Change-Id: I81ce848cd37e8573d706fa5d1aa52147b3c8da12
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: Increase the kernel virtual area to include lowmem

Even though lowmem is accounted for in vmalloc space, allocation
comes only from the region bounded by VMALLOC_START and VMALLOC_END.
The kernel virtual area can now allocate from any unmapped region
starting from PAGE_OFFSET.

Change-Id: I291b9eb443d3f7445fd979bd7b09e9241ff22ba3
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mm: Update is_vmalloc_addr to account for vmalloc savings

is_vmalloc_addr current assumes that all vmalloc addresses
exist between VMALLOC_START and VMALLOC_END. This may not be
the case when interleaving vmalloc and lowmem. Update the
is_vmalloc_addr to properly check for this.

Change-Id: I5def3d6ae1a4de59ea36f095b8c73649a37b1f36
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mm: make is_vmalloc_addr work properly.

There was a typo in the config guard for CONFIG_ENABLE_VMALLOC_SAVING
which meant that the code was never actually being compiled. As a
result, it was never noticed that the code had major flaws. Fix
the code to actually work as intended.

Change-Id: Ief3c00d16cf54e3b945ffb1bfde6b1fea2fa142e
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mm, vmalloc: use well-defined find_last_bit() func

Our intention in here is to find last_bit within the region to flush.
There is well-defined function, find_last_bit() for this purpose and its
performance may be slightly better than current implementation.  So change
it.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mm, vmalloc: remove useless variable in vmap_block

vbq in vmap_block isn't used. So remove it.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "mm: make is_vmalloc_addr work properly."

This reverts commit d560dd9a8fd200d119be3bb9d99f22b0f06eddb4

Change-Id: I610975d802b11c6c382c2c29f8e2394ce8acce2d
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mm: make is_vmalloc_addr lockless

is_vmalloc_addr currently takes the vmap_area_lock and walks
the list of vmalloc areas to determine if an address is actually
a vmalloc address. Unfortunately, the current locking structure
with vmap_area_lock does not disable irqs which means that it may
be possible to recusively take the vmap_area_lock if an irq occurs
while walking the tree list. Considering the list of possible
vmalloc vs. not vmalloc ranges is not going to change after bootup,
skip the tree walking and just keep a bitmap of which virtual
addresses are set aside for vmalloc and which are not.

Change-Id: I0c159e09dc17b5c6641d08dcf630e6116b991cd5
CRs-Fixed: 591797
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>