msm: kgsl: Always Signal event time timeline for every event type

Fence sync seems to react badly when it gets a unexpected timestamp
on a timeline.  When a event expires always send the expected timestamp
even if the event expired because the context was destroyed.

Change-Id: Id1bc18220223c665012df1db21eea78af78d9288
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
mm: Don't use CMA page for file cache

Despite the best efforts of redirection, the file system may still
allocate CMA pages with references held for long periods of time.
If a CMA page ends up being allocated, free it and get a non-CMA page.

Change-Id: I2001151a2936a6d0780d223dda85a87c04ddb8c6
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: kgsl: Configure FT behaviour from sysfs instead of debugfs

FT behaviour is changed to be configured from sysfs
instead of debugfs. Sysfs control gives us the advantage
of configuring FT at bootup and also across bootups.
Persistant configuration across bootups helps
testing by configuring FT once and testing the FT
config across bootups.

Conflicts:

	drivers/gpu/msm/adreno.h
	drivers/gpu/msm/adreno_debugfs.c

Change-Id: Ia3378f214371a6a4b9f205f9f884976f58585971
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Allocate space in ringbuffer for EOF commands

When userspace passes end of frame (EOF) flag, ringbuffer is
inserted with EOF marker commands. Allocate ringbuffer space
for EOF marker commands.

CRs-Fixed: 469807
Change-Id: I7de8d1b81d358a8d8753ac84fbdceddad27bb17d
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
input: atmel_mxt_ts: disable/enable IRQ on suspend/resume.

Disable IRQ in suspend and enable IRQ in resume function
to remove the appearance of old touch data after suspend
and to fix the sticky touch problem.

CRs-Fixed: 526552
Change-Id: Ia6e7823a4a5615b2bc5209e8b3425b52827161de
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Slim_msm: Wait for reconfig sequence to complete

Wait for current reconfiguration to complete during
reconfigure_now sequnce. Earlier we are not waiting
for reconfiguration done interrupt after sending the
reconfiguration message to the slimus hardware. This
may lead to hardware synchronization issues in lower
slimbus clock frequencies.

In this patch we are waiting for the reconfiguration
done interrupt from slimbus hardware.

CRs-Fixed: 490022
Change-Id: If0126dac9a1ad2d931e9a0e345d19559fe36f67a
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
usb: gadget: Register RMNET SMD control channel only on protocol connect

The RMNET USB function driver uses SMD channel for transmitting control
messages to the modem processor. Move the registration of the platform
driver which handle the SMD channel to the stage in which the RMNET
function driver is actually got activated by the host which selected
the configuration which contain the RMNET function driver.

This fix is required to prevent cases in which other protocols, as
MBIM for example, which exists in other USB configuration, may need
the same SMD channel which is occupied by the RMNET, since the RMNET
grab the channel on initialization of the function driver rather than
upon activating it.

CRs-Fixed: 435979
Change-Id: I40667c83ca6ff6402a8d6f69a62f1dc42bd265d0
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
msm: hdmi: NUL-terminate spd data

NUL-terminate SPD Vendor name and SPD
Product description data stored in the
control structure of hdmi driver. This
avoids overflows in print messages and info
frames.

Change-Id: Ib3fcf35c6e82af18089ebea213e20b0bc0182661
CRs-Fixed: 520148
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
usb: smd: Call smd_close API from workqueue context

smd_close API is blocking, hence, cannot be called from ATOMIC
context. Hence, move it from interrupt context to workqueue context.

CRs-Fixed: 468606
Change-Id: Iddda44f50c47582734118ee354a83078ea4cf098
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
msm: wlan: Add db.txt for regulatory support.

db.txt is required for the kernel to process regulatory
hints sent by driver.If db.txt is empty then driver callback
(wiphy->reg_notifier) will not be called so updating db.txt
from upstream kernel. With this change any driver using
regulatory_hint API need to register wiphy->reg_notifier
callback which will be called by cfg layer.This file would
be updated monthly from upstream respository.

Git-commit: bb99560ff69c44c30e47416501639e37014689c3
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git
Author: John W. Linville <linville@tuxdriver.com>
Date:   Wed Feb 13 14:36:58 2013 -0500
wireless-regdb: update regulatory.bin based on preceding changes.
CRs-Fixed: 472846
Change-Id: Ic2467894e6af3c5df9f6236e5c28c17636dd08f6
Signed-off-by: Agarwal Ashish <ashishka@codeaurora.org>
msm: hdmi-cec: bounds check cec frame size

Ensure that the frame size for the HDMI-CEC message
frame size doesn't exceed the maximum size when
reading message from userspace through sysfs interface.
This avoids potential overflow in cec send msg routine.

Change-Id: I09eb8f7a6dee64be2b504c6448b49e1da902aa47
CRs-Fixed: 520140
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
mmc: core: expose HPI capability to SWITCH commands

Some of the time consuming operations such as BKOPS, SANITIZE, CACHE
flush/off use the SWITCH command (CMD6) but as these operations don't
have card specification defined timeout for completion, we may see
timeout errors if card doesn't complete the operation within the SW
defined timeout. If SW defined timeout is hit, above operations are
considered to be failed and no real recovery mechanism is implemented
after timeout.

Most of the above operations (BKOPS/SANITIZE/CACHE flush/off) can be
interrupted by sending the HPI (High Priority Interrupt) command to card
if they taking longer than expected. This change adds the base support
which will these operations to be HPIed after timeout.

Change-Id: Ibd9061525756aaae656b1ceeeaed62e04fb80cce
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
msm: Enable CONFIG_CFG80211_INTERNAL_REGDB for regulatory support.

Enable CONFIG_CFG80211_INTERNAL_REGDB  flag to support regulatory
update which helps to keep channel data consistent between
kernel and driver.

CRs-Fixed: 472846
Change-Id: Iaefe0df3d19c49c6f72b7961178267d5f7cbcea2
Signed-off-by: Ashishka <ashishka@codeaurora.org>
msm: scm: Add scm_call_noalloc and helper macros

Currently, scm_call internally calls kmalloc() to allocate a command
buffer structure. This prevents scm_call from working before kmalloc
structures are initialized or during atomic contexts. Allow clients
to pass in a pre-allocated buffer for scm_call to be used for internal
structures.

Change-Id: Id09500c8c696298228aefdcc2a61953e654677c9
CRs-Fixed: 498392
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
arm: Add ARCH_RANDOM Kconfig

Some boards may support architecture generated random numbers. Add
the appropriate Kconfig.

Change-Id: I0077a982c9bb6d3a35435cc27fe40b7e0596ca84
CRs-Fixed: 498392
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: implement ARCH_RANDOM

Currently, the software random number generator is not intialized
until relatively late in the boot process. Software that relies on
random numbers early will not be reliable. Entropy sources are
available early but not early enough for some use cases which means
that moving the software random number generation earlier is not an
option. As an alternate solution, implement the functions associated
with CONFIG_ARCH_RANDOM. These functions currently make a call into
trustzone to get reliable random numbers. The functions are disabled
once the regular random number generator is sufficiently reliable.

Change-Id: If40cfcb96b091fa26a28047c10a902287b26f6c1
CRs-Fixed: 498392
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/Makefile
init: Move stack canary initialization after setup_arch

Stack canary intialization involves getting a random number.
Getting this random number may involve accessing caches or other
architectural specific features which are not available until
after the architecture is setup. Move the stack canary initialization
later to accomodate this.

Change-Id: I00b564a2c3172229a44339c061fa380c17fe7d8e
CRs-Fixed: 498392
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: kgsl: fix NULL check in kgsl_mem_entry_set_pend()

Checking NULL before derefencing usually works better.

Change-Id: I2e2936eb9532dae4b0ef471b5cb2dd1c3a8f0975
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: Avoid dereferencing NULL pointers

It is possible to drop to the bottom of adreno_ringbuffer_issuecmds
with either context or drawctxt set to NULL. Avoid dereferencing these
variables in the trace call at the bottom of the function.

Change-Id: Ic0dedbadbc7e2c0c4ef85e0d7103e04485ed3e69
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: board-8930-gpiomux: Change gpio config mode

Modify functional mode of suspended GPIO configuration
of GSBI9 to GPIO mode instead of FUNC2 mode. Observed
current leakage issue during bootup when the functional
mode of the GPIO is FUNC2. Hence, it is changed to
GPIO mode in this patch.

Change-Id: I35341c0530b571db955ec9b8c63ffd060f0ffd02
CRs-Fixed: 534685
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>