msm: vidc: fix failure to set LTR with index value

When MARKLTR/USELTR was set with a index value the value never
propagated to firmware resulting in failure to set the property.

Change-Id: I37536e1662c2d1092477fddde6838d4239805ac5
Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
ARM: dts: msm: Add support for 1.1GHz for 8610

A new speed bin has been added to identify 1.1GHz.

Change-Id: I06e5bc7e000dfc16117ae188a76a3c54a3390cc8
Signed-off-by: Taniya Das <tdas@codeaurora.org>
sched: Remove redundant update_runtime notifier

migration_call() will do all the things that update_runtime() does.
So let's remove it.

Furthermore, there is potential risk that the current code will catch
BUG_ON at line 689 of rt.c when do cpu hotplug while there are realtime
threads running because of enabling runtime twice while the rt_runtime
may already changed.

Change-Id: If2d953316d93c6b7e32f94bd49f2c10e64de6ed8
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1365685499-26515-1-git-send-email-zhangwm@marvell.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Git-commit: c5405a495e88d93cf9b4f4cc91507c7f4afcb901
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[mattw@codeaurora.org: resolved trivial header file context conflict]
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: mdss: Check null-pointer dereferencing and buffer overflows

Add checks before possible null-pointer dereferencing. Add checks to
prevent buffer out-of-bounds access.

Change-Id: I17419c82654c4ad2d18c7f88e34447cf333450bb
Signed-off-by: Mathew Karimpanal <kjmathew@codeaurora.org>
Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
USB: ci13xxx_udc:  Add support for UI interrupts counting

Add counting of UI or USB transfers completion interrupts
so that it can be used to determine USB transfers or
BUS usage. This is a simple approach which gives
reasonable accuracy to avoid counting actual bytes
that got transferred over USB.

Change-Id: I1ee3c6997e40ee5db1da26af1e68fced06ea2de4
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
 msm: camera2: cpp: Fix to correct pointer in copy_to_user call

 Deferencing user pointer in kernel code is incorrect. This code
 can cause kernel panic for some rare cases. Use kernel pointer
 while calling copy_to_user() API.

Change-Id: Ib50b1dac1a12ef9929933c9d6c5780e4b6a7700a
Signed-off-by: Krupal Divvela <kdivvela@codeaurora.org>
sched: Fix hotplug vs. set_cpus_allowed_ptr()

Lai found that:

  WARNING: CPU: 1 PID: 13 at arch/x86/kernel/smp.c:124 native_smp_send_reschedule+0x2d/0x4b()
  ...
  migration_cpu_stop+0x1d/0x22

was caused by set_cpus_allowed_ptr() assuming that cpu_active_mask is
always a sub-set of cpu_online_mask.

This isn't true since 5fbd036b552f ("sched: Cleanup cpu_active madness").

So set active and online at the same time to avoid this particular
problem.

CRs-Fixed: 680496
Change-Id: I89ac9b6829acf200072975bc7d028a469167f083
Fixes: 5fbd036b552f ("sched: Cleanup cpu_active madness")
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael wang <wangyun@linux.vnet.ibm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Link: http://lkml.kernel.org/r/53758B12.8060609@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Git-commit: 24d52daafcd53f109893ec2faf668c8eeef4a382
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: mdss: Wait for vsync before iommu attach during cont splash

During first borderfill commit in splash cleanup, wait for vsync
before iommu attach to prevent IOMMU page faults during bootup.

Change-Id: I68b7162d090513b082cbd4c0013731cedc0ebdbe
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: kgsl: Do not return invalid power stats when the device is off

adreno_power_stats() was returning unitialized data when the device
state was not active. Leave early from the function if the device
is not active and return 0s instead.

Change-Id: Ic0dedbadf6201cadb4472327c4ce7f9d9d32b82d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
mmc: core: Fix null pointer dereference due to race conditions

Fix race condition between mmcqd thread and the mmc_queue_suspend
updating a shared variable mq->flags, which can lead to potential
null pointer dereference as following-

Unable to handle kernel NULL pointer dereference at
virtual address 00000020
pgd = c0004000
[00000020] *pgd=00000000
mmcqd/0:  186] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
CPU: 0    Tainted: G        W     (3.4.0-1251694-eng #1)
PC is at mmc_blk_err_check+0x20c/0x3b8
LR is at mmc_start_req+0x198/0x718

cpu0		|	cpu1
x |= 1		|	x |= 2

final value of x can be x = 1 or x = 2

Change-Id: Ie0fff6d6dba5aebb3584cba9fb98de24515c4cd8
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
mmc: block: Fix an invalid use of req->cmd_flag in DISCARD operation

When handling a DISCARD operation, the MMC request data structure may be
freed in memory. Therefore, it can't be used to retrieve the cmd_flags
for checking if MMC_REQ_NOREINSERT_MASK is set:
(!(mq->mqrq_cur->req->cmd_flags & MMC_REQ_NOREINSERT_MASK)))).

To prevent the issue we should use the local variable of cmd_flags.

Change-Id: I3b25a0e734325355c50d4d5f5b38e9631ae41dd9
CRs-Fixed: 683957
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
msm: mdss: Add support for dynamic mode switch

Add support for switching between dsi command mode and
video mode and vice versa at runtime. If the panel is
configured in video mode, it would be power efficient to
be able to dynamically switch to command mode on need
basis. This change adds the support by providing an IOCTL
to switch between video mode and command mode at runtime.

Change-Id: I23f0cadc0f76e0b4406c8156c3cca40782686bf0
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
ARM: dts: msm: enable dynamic switch feature

Enable dynamic switch feature flag for nt35590 video
mode panel. Add the list of commands that needs to be
sent to the panel to dynamically switch from video
mode to command mode and vice versa.

Change-Id: I0e01f41683a5ab97316ce84017cbf363a0bb2cbf
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
msm: mdss: Avoid mutex lockup in dynamic switching

Calling blank/unblank after locking the backlight mutex will result
in mutex lockup as blank/unblank would again try to aquire the same
lock. Avoid this situation in Dynamic Switching

Change-Id: I7b5e72b964b9994d98b6a3d0771239a5423c5001
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
msm: mdss: Add support for dynamic mode switch on mdp3

Add support to dynamically switch between dsi video
mode and command mode for MDP3 driver. For a panel which
is configured in video mode and can support command mode,
it would be power efficient to dynamically switch to
command mode on need basis.

Change-Id: Ifa479915babb073aabfc4be4247f1325fffe1f5e
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
ARM: dts: msm: Add wait in dynamic switch command for nt35590 panel

Add one vsync wait in dynamic switch command for nt35590 720p panel.
This makes sure after enabling the panel GRAM there is one frame
transferred before switching to command mode.

Change-Id: I8784f981a44e8ba0a9fd06f75ced69a400d4a49c
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
msm: msm_bus: Prevent BKE swtich from overwriting other fields

Incorrect bit mask could lead to other register fields getting
overwritten when doing a BKE bit switch.

Change-Id: I2cd7717eca48166dcc8cdb7ad855cc87e04c233b
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
NFC: NFCC wake up check by register read.

After setting NFCC into wake mode, we then read back
the status of the wake flag from the corresponding
register of nfcc.Only when the flag is read back as
0 then it confirms that nfcc is woken up.Then the
further read of the version register can be done.

Change-Id: I43eadf5940fd5bba99f11cc68743d6485f77aced
CRs-Fixed: 628122
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
NFC: NFC reset wait causes bark due to excessive logging

It takes almost 15 msec for reset notification to be received from
NFCC and due to this NFC kernel device was waiting for 10uSec loop
which was causing bark due to excessive logging.
GPIO was also not needed to be controlled twice. Add some logging
for the NFC device for debugging.

Change-Id: I4335cbff61f16a2d93fccea8c7e39f0b430e0009
CRs-Fixed: 653737
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
msm: vidc: avoid setting smoothstreaming for Q6

Smoothstreaming is not a tested functionality on Q6.
This change will return error to all clients trying
to configure Q6 in smoothstreaming mode.

Change-Id: If520d136cd29b3b37759d0fb179538e31b9b71d9
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>