PM / wakeup: Use irqsave/irqrestore for events_lock

Jon Medhurst (Tixy) recently noticed a problem with the
events_lock usage. One of the Android patches that uses
wakeup_sources calls wakeup_source_add() with irqs disabled.
However, the event_lock usage in wakeup_source_add() uses
spin_lock_irq()/spin_unlock_irq(), which reenables interrupts.
This results in lockdep warnings.

The fix is to use spin_lock_irqsave()/spin_lock_irqrestore()
instead for the events_lock.

References: https://bugs.launchpad.net/linaro-landing-team-arm/+bug/1037565
Reported-and-debugged-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
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>
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: 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>
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>