sysctl: Don't scan for the leaks on headers

These header allocations have life cycle till the device goes
shutdown. So, considering them as leak is false positive. Remove
them by marking kmemleak_not_leak

CRs-Fixed: 466552
Change-Id: Id1571b78365e533ddfe866d45cef8f89b0b62bc7
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
spi_qsd: set device's runtime PM status to 'suspended'

Device's runtime PM status is not in suspended state during
system suspend.

CRs-Fixed: 512718
Change-Id: I5c0cb39c0b91782d8686c1b3da81125169ccf9be
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
mmc: core: Fix MMC clock scaling in case of tuning failure

When the clock scaling state is changed from MMC_LOAD_LOW to
MMC_LOAD_HIGH, the clocks are first scaled up and then tuning
is performed. But in case of tuning failure, the current code
does nothing but still retain the previous clock scale stats
(state and curr_freq within struct clk_scaling). Hence, correct
it to scale down the clocks in case of tuning failure so that
clock scaling stats reflect the correct status. This also helps
proceed with data transfers at lower clock rate in such cases.

Change-Id: I7e9379d1e3ddc863132af31019604c22a42f8d59
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
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>
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>
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>
wlan: cld: Add NL80211 test mode support to msm8960 defconfig

The FTM daemon uses libtcmd to send NL80211 test mode commands
to the CLD wlan driver for factory mode testing. This requires
the kernel to be compiled with the NL80211 TESTMODE support.
So enable it for the msm8960_defconfig for the APQ8064 target.

Change-Id: Id8b9794b7f4f7c1bd695a5703c0c256f3513479b
Signed-off-by: maheshkumar <MAHESH@codeaurora.org>