arm/dt: 8610: Add coreisght support for bus devices

This patch enables bus profiling for NoCs and BIMC by enabling
registration with coresight.

Change-Id: I251635af2648a634e48ccbae8191ee89d3c9d73b
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
msm: mdss: Reduce assertive display log messages

Silence valid cases of assertive display being checked to run on secondary,
dual pipe or command mode displays.

Change-Id: I7a770ccc4cd69f1296c2d91e3abfb685fd093b5a
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: mdss: Return src format changes during overlay set

Src format changes in overlay due to BWC need to be reflected in
userspace to facilitate proper allocation of input buffer.

Change-Id: I49a5aee97deb26f14b365a093095c47e6dd00fc5
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: wfd: Add an dummy encoder subdevice for debugging

Created a dummy encoder subdevice that just copies the input buffer into
the output buffer.  This is useful when we'd like to examine the MDP
output, which is normally very difficult as the buffers associated with
the MDP output aren't exposed to userspace.  Since the dummy enc-subdev,
copies the input buffer into the output buffer, which is exposed to
userspace, we can easily dump the MDP data.

Change-Id: If855b5cd78ae76a781e5709d2bc80167bfadfbf8
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: wfd: Stop mapping buffers into kernel memory

Aside for debugging purposes, there's no need to map input/output
buffers into kernel.  Unnecessarily mapping it causes low memory issues
on various targets as the buffers are as big as 2MB each.

As kernel mappings are useful for debugging, map it only when
CONFIG_MSM_WFD_DEBUG has been enabled.

Change-Id: I2c3d48397a0ebdd5c8dc559c306c54bda0b7d076
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
cpufreq: ondemand: Fix locking in store_powersave_bias

store_powersave_bias() assumes that dbs_info->cur_policy will
not change while it is executing. If it does, memory corruption
can potentially result. Fix this by acquiring the dbs_lock.

Most noticeably, this resolves timer-related list corruptions
encountered when queue_delayed_work_on() is called from within
store_powersave_bias() while a CPU is being hotplugged in and
out.

CRs-Fixed: 494407
Change-Id: I0fd5cbef6834545274cad9481e574ec50b37b871
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: thermal: Refactor core control mitigation only for smp

Refactor core control mitigation only for smp target otherwise it
leads to compilation issue for non smp since cpu_up and cpu_down
functions are not defined.

Change-Id: I73d3792fd9c4ce6d16132b55eb2446dd4bcdfbce
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
msm: thermal: Replace __cpuinit with __ref to support non smp

__cpuinit is causing issues on non smp targets and it also leads to
compilation issues if __cpuinit is completely removed on smp targets
as modpost will complain for calling removable sections from non
removable sections. Replace __cpuinit data with __ref which will
silence the modpost and works fine for non smp targets as well.

Change-Id: Ifa413f6708935b1dcae9438bf39a194372eb0c61
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
msm: pcie: fix PCIe RAM issue on APQ8064v1

PCIe packet corruption has been observed on APQ8064 CDP, where
bits are flipped when sending packets over a PCIe GigE interface.
The RAM used for transfers was determined to be the source of
the problem. A software solution here is to limit the TLP size from
the default 4KB to 2KB based on the PCIe core version.

Change-Id: Iafda58963643424f7c0d647c487ffe6316037e66
Signed-off-by: Yan He <yanhe@codeaurora.org>
signal: always clear sa_restorer on execve

When the new signal handlers are set up, the location of sa_restorer is
not cleared, leaking a parent process's address space location to
children.  This allows for a potential bypass of the parent's ASLR by
examining the sa_restorer value returned when calling sigaction().

Based on what should be considered "secret" about addresses, it only
matters across the exec not the fork (since the VMAs haven't changed
until the exec).  But since exec sets SIG_DFL and keeps sa_restorer,
this is where it should be fixed.

Given the few uses of sa_restorer, a "set" function was not written
since this would be the only use.  Instead, we use
__ARCH_HAS_SA_RESTORER, as already done in other places.

Example of the leak before applying this patch:

  $ cat /proc/$$/maps
  ...
  7fb9f3083000-7fb9f3238000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
  ...
  $ ./leak
  ...
  7f278bc74000-7f278be29000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
  ...
  1 0 (nil) 0x7fb9f30b94a0
  2 4000000 (nil) 0x7f278bcaa4a0
  3 4000000 (nil) 0x7f278bcaa4a0
  4 0 (nil) 0x7fb9f30b94a0
  ...

[akpm@linux-foundation.org: use SA_RESTORER for backportability]
Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Emese Revfy <re.emese@gmail.com>
Cc: Emese Revfy <re.emese@gmail.com>
Cc: PaX Team <pageexec@freemail.hu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: Julien Tinnes <jln@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-commit:2ca39528c01a933f6689cd6505ce65bd6d68a530
Git-Repo:https://github.com/torvalds/linux
Git-link:https://github.com/torvalds/linux/commit/2ca39528c01a933f6689cd6505ce65bd6d68a530
Change-Id: I7ae396ee90c2339c86f7b773d15f5571f8fd54c5
Signed-off-by: Goberu Gopal <ggober@codeaurora.org>
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
msm: Kconfig: Select CPU_FREQ_MSM for 9625

Basic thermal mitigation involves frequency mitigation, hence to
enable kernel thermal mitigation select MSM_CPU_FREQ.

Change-Id: I2b7e1831e09203a4f710fa97fc5c8f05e2891894
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
usb: ehci-msm: Specify DMA coherent mask

EHCI msm driver uses DMA coherent memory which requires setting
dma masks correctly.

Change-Id: I4b4983f451ba2eb07277ac315df69b82ca2588bd
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
leds: leds-qpnp: Utilize SMBB Boost Regulator for flash LED

Enable SMBB boost regulator when flash LED is turned on in flash
mode and disable it when flash LED is turned off. This avoids
losing USB when flash is turned on.

Change-Id: I31f22dc0f127bd4765466621e3c0882e15838d22
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
arm/dt: msm8974: Add SMBB boost regulator support for flash

Add SMBB boost regulator in flash led node to allow flash LED
to use that regulator.

CRs-Fixed: 473004
Change-Id: I734b9f1ab8ccf33ccc9589fb4ae9ffb50135fb9d
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
msm: bam_dmux: trigger modem subsystem restart in case of timeout

If bam_dmux times out waiting for a power collapse protocol response from
the modem, bam_dmux assumes the modem has crashed and will disable itself
until the subsystem restart callback is triggered.

Change the behavior in bam_dmux to request that the modem subsystem
restarts regardless of its current state so that the restart callback is
always triggered.

CRs-Fixed: 495690
Change-Id: I076ab16dd727694feb68b9e9052b1b6a60a2b0ca
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
msm: vidc: Add error handling for session init failure

When driver tries to open more instances than FW
supports, FW returns session_init failure. This
failure needs to be handled properly by the driver.

CRs-Fixed: 487665
Change-Id: If15d00d046a0b8b8a41c1d2941e53a742ab7ef0f
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
defconfig: msm8226: enable the optimize for size option

Enable the optimize for size option in both the perf and debug
defconfigs since it reduces the image size.

Change-Id: I8ec8db89125438aaa8965261b4f82b19145f93bf
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
slim_msm: Support TX message queues

TX message queues are setup using BAM descriptors and event to
notify when the descriptor is done. This type of access ensures
lesser interrupts for slimbus controller, and offloads CPU from
copying message buffer into registers.
At this time, TX message queues are enabled on non-ported generic
device per HW recommendation.

Change-Id: I26423ef4d9fb3d54594d64555417f9a0c1dac37d
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
msm: vidc: Set V4L2_BUF_FLAG_KEYFRAME for IDR frames also

All IDR frames are also KEYFRAMEs, as such set the KEYFRAME flag
whenever we encounter an IDR frame.

Change-Id: Ia36171ba89c792bcdfcf532181d7e577ebdb5fbb
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
crypto: msm: Process keydata for HW/PIPE key use case

When client sets HW_KEY flag, driver should ignore key data
and length when client issues set_key request.
When client sets PIPE_KEY flag, driver should ignore key data.

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