qseecom:Fix race condition while voting for clocks

In the current functionality, if DFAB clock is already on and a
request is made to turn on SFPB clock, the DFAB clock is turned
off and SFPB clock is turned on and vice-versa.

The above situation can lead to unexpected errors. The current fix
makes sure that clocks that are on are not voted to be off without
explicit request.

Change-Id: I6c3230e23b105c049cdb0aace579b8a176328c84
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
qseecom:  Add SFAB clock voting

Add SFAB voting in  QSEECOM_IOCTL_PERF_ENABLE_REQ.
The SFAB clock needs to be bumped up to its optimal
value when opearting in high bandwidth mode (for max
crypto performance)

Change-Id: I4c8fcd6a70f3e649ab5d83f7a26d940f93fb9a35
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>

Conflicts:

	drivers/misc/qseecom.c

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
qseecom: Remove extra call to disable clock.

Currently the qseecom driver calls qsee_disable_clock_vote() in
the release function. This reduces the reference count during
disabling of the clock and results in turning off the bus clocks
inconsistently.
This change fixes the inconsistency.

Change-Id: I33aa90744a65a3e1a9aba0c368de99ef61a35073
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
msm: dma: Moving queue_work() function within spinlock

Currently we are adding a dma command to the staged list with in a
spinlock and then adding to workqueue using queue_work after unlocking
the spinlock. With this there is chance of executing DMA commands in out
of order in below concurrency case.

Tread1                                Thread2
__msm_dmov_enqueue_cmd_ext
   spin_lock_irqsave(..)
   list_add_tail(..)
   spin_unlock_irqrestore(..)
       --PREEMPT--
                                      __msm_dmov_enqueue_cmd_ext
                                         spin_lock_irqsave(..)
                                         list_add_tail(..)
                                         spin_unlock_irqrestore(..)
                                         queue_work()
                                         ..
   queue_work()
So adding queue_work with in spin_lock will make sure that the
work added in the work_queue is processed in the same order as they
are added in staged_commands.

CRs-Fixed: 423190
Change-Id: I2ffd1327fb5f0cd1f06db7de9c026d1c4997fe4d
Acked-by: Gopi Krishna Nedanuri <gnedanur@qti.qualcomm.com>
Signed-off-by: Utsab Bose <ubose@codeaurora.org>
input: mpu3050: add enable/disable sysfs attribute

allow sensor HAL control the power state of gyro sensor, so that sensor is
disabled when not used.

Change-Id: Ib9f8e9761ea518534ffcd06f30de4b8f1f198687
Signed-off-by: Orkhan Karimov <okarimov@codeaurora.org>
input: sensor: remove open/close function from lis3dh driver

This is to make lis3dh accelerometer disabled by default, even if it
is open-ed by user space. Device will have to be explicitely enabled
via sysfs attribute.

Change-Id: I0fb022fac7f05aa7606717c58425fe3ed1c458b0
Signed-off-by: Wentao Xu <wentaox@codeaurora.org>
Merge "qseecom: Remove extra call to disable clock."
Merge "input: mpu3050: add enable/disable sysfs attribute"
Merge "input: sensor: remove open/close function from lis3dh driver"
Merge "msm: dma: Moving queue_work() function within spinlock"
printk: Defer CPU_ONLINE console flushing

The flushing of the console in the CPU_ONLINE callback on a hotplug
is rather slow, taking up to 11 ms to complete. Defer this to lower
hotplug latency.

Change-Id: If96089fe2c6cd6024d1a9e2bac35296aea75cf9e
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
Merge "qseecom:Fix race condition while voting for clocks"
Merge "msm: Fix correct topology for qseecom bus scaling."
Merge "qseecom:  Add SFAB clock voting"
vidc: skip meta buffer header initialization in secure session

Accessing meta buffer allocated from secure heap causes EBI errors due to
permissions. Meta buffer header initialization not required in secure
session, skip to initialize.

Change-Id: I191dcc73ad84be98d832b69ebde60c0e13c89350
CRs-Fixed: 418217
Signed-off-by: Riaz Ur Rahaman <riazr@codeaurora.org>
Merge "vidc: skip meta buffer header initialization in secure session"
msm_fb: display: replace msleep with wait4vsync

vsync is controlled by frame work which means vsync irq
off may happen at any instance. This patch use a reference
count to control vsync irq enable/disable so that
wait4vsync can replace msleep safely during suspend.

Change-Id: Ief84b1b421436e1f750288eb9a9760a9cb96c555
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c

Signed-off-by: Vivek Panwar <vpanwa@codeaurora.org>
Merge "printk: Defer CPU_ONLINE console flushing"
Merge "msm_fb: display: replace msleep with wait4vsync"
board-8960-gpiomux: Correct Primary UART GPIOs suspend configuration

Currently Primary UART GPIos (93, 94, 95, 96) are having suspend
configuration where functional mode is set as 2 (UART Mode). These
GPIOs are required to be in GPIO mode when those are not used for
UART functionality. Hence correct these GPIOs suspend configuration
by changing functional mode from 2 (UART Mode ) to 0 ( GPIO Mode ).

CRs-Fixed: 467671
Change-Id: I98b101a665a0d6398007be7f0b13007cc71cffc3
Signed-off-by: Mayank Rana <mrana@codeaurora.org>