msm: hotplug: wait for hotplug completion event from secondary core

Primary core has to wait for hotplug completion event from secondary
core to avoid race between ongoing hotplug and already queued online
event. This also prevent CPU_DEAD notifiers from executing before the
SPM has completed the collapse of the CPU. CPU DEAD notifiers executing
early have been attributed to MDD hardware block for the CPU being
turned off prematurely, resulting in crashes.
The patch also adds support for probing with device tree for 8974
targets.

Change-Id: Ibd35a7c56f42f156a643ca6d531509f019b2a3be
CRs-fixed: 438314
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
msm: SSR: Fix problems with concurrent SSRs

If one SSR call comes in and queues a work and the work item
starts running and then another SSR call comes in we will end up
with a running work item and a pending work item. The pending
work item will not run until the running work item completes.
With the current code the work item will run to completion and
then the pending work item will run and restart the subsystem
again.

This is wrong since we want to 'short-circuit' the code in this
case and do nothing if multiple SSR calls come in while the
subsystem is in the 'crashed' state.  Add state tracking logic so
that we know what part of the restart process a particular
subsystem is in and use it to fix this problem.

Conflicts:

	arch/arm/mach-msm/subsystem_restart.c

Change-Id: Iac8713951af1f290af1df7e94468d1843fc7980b
CRs-Fixed: 397848
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: pm-8x60: Remove timeout waiting for cpu to power collapse

The delays in the CPU_DYING notication path could result in the core
initiating the hotplug to send out CPU_DEAD notifications after
msm_pm_wait_cpu_shutdown() times out. This could result in a unknown
resets when regulator/clocks are disabled in the CPU_DEAD path. To
prevent unknown resets, wait infinitely to enter power collapse but
throw a warning after the 1ms mark.

The platform_cpu_kill() path is also executed in the reboot path when a
core tries to stop secondary cores. In these cases, platform_cpu_kill
shouldn't wait infinitely for the secondary cores to power collapse. To
circumvent this scenario, track dying cpus as a part of the hotplug
notification and skip waiting for the core to power collpase during
reboot path.

CRs-fixed: 582925
Change-Id: I144e95a6d019e897381d2bca62ab50ecefd56b5b
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
cpufreq: ondemand:kernel NULL pointer dereference at dbs_check_cpu

Function dbs_check_cpu  calls __cpufreq_driver_getavg
With  policy as IN/OUT parameter.
There is possiblity of policy becoming NULL in
 __cpufreq_driver_getavg. Same policy is getting
accessed in the for loop which leads to NULL pointer dereference.
So NULL check is required for the policy

CRs-fixed: 582925
Change-Id: Ib8d8de8d66500430a5aa4c275937640e4f934aa8
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
fbcmap: prevent memory overflow

Add bounds check before copying data to prevent
buffer overflow.

Change-Id: I47b9685b1ab13c4863fb6db62bbb9497a00b36da
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Revert "[ARM] msm: iommu_domains: replace vmalloc with kmalloc"

When overmapping is used, system can request higher order page allocaitons.
this can lead to page allocation failure if kmalloc is used

CRs-Fixed: 571753

This reverts commit 191a48ee7bda08bf88a61b48fd0433627c5918dc.

Change-Id: I4d44bf88d84d96d315f89a1304a2d25b75be79d8
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
wcnss: Fix config option for WCNSS_MEM_PRE_ALLOC

Change-Id: I373826371a1babc7a971b51abf366d01d4201223
Merge with MK4 kernel source

Change-Id: I67b494555fe4868e0aff1565c7db2f0d435738dd
Disable some driver debug noise

Change-Id: If72280db30d2a969558080449585476ceb22482f
Update defconfigs

Change-Id: I2cb4af2f3f9bed679c6938fb0780e7c8d33681cb