OMAP4: DPLL cascading: Removed race condition while entering in the DPLL cascading

Checking if omap is in DPLL cascading has to be under a lock. Without the lock it
can lead to a situation when one thread is waiting for omap_dvfs_lock thinking
that is not in DPLL cascading while another thread, that has locked dvfs
lock, put omap in dpll cascading. So when dvfs_lock will be unlocked the first
thread will run thinking that omap is not in DPLL cascading but it has
been put in DPLL cascading already.

Example:

Assume the device is not in dpll cascading state,
that is omap4_is_in_dpll_cascading = 0.

+--------------------------------+--------------------------------------------+
|           thread 1             |                thread 2                    |
+--------------------------------+--------------------------------------------+
|                                | ->omap4_dpll_cascading_blocker_release() { |
|                                | ...                                        |
|                                | mutex_lock(dvfs_lock)                      |
|                                | ... ->                                     |
| -> omap_device_scale() {       |                                            |
| ...                            |                                            |
| if (omap4_is_in_dpll_cascading |                                            |
|                       == 0)    |                                            |
| mutex_lock(dvfs_lock) ->       |                                            |
|                                | -> ...                                     |
|                                | omap4_is_in_dpll_cascading = 1             |
|                                | ... //enter in dpll cascading              |
|                                | mutex_unlock(dvfs_lock)                    |
|                                | ... ->                                     |
| -> mutex_lock(dvfs_lock)       |                                            |
| ... // do bad things           |                                            |
+--------------------------------+--------------------------------------------+

Change-Id: I2d7769a4b7347197c0c9c149873207a322fd4d5c
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
MMC: Make sure PBIAS config matches VMMC supply.

Depending on the system, VMMC may end up being 3 or 1.8v.  It is
important that the PBIAS cell be configured to match the supply.
Fortunately, the PBIAS cell contains a handy detector which can
determine what the supply is set to after PWRDNZ has been released.
Use this detector to make sure that the cell is properly configured
and does not damage itself.

Change-Id: Id59ab8e4042efe0778a80f1476bcf8aa746e6cd6
Signed-off-by: John Grossman <johngro@google.com>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
Blaze Defconfig: Enable CONFIG_MODVERSIONS

CONFIG_MODVERSIONS allows modules to be used
with a different kernel than what it was built
against. When CONFIG_MODVERSIONS is enabled,
the kernel will add a special piece of versioning
info to every exported symbol. This versioning info
is calculated by a CRC algorithm which recursively
looks at the symbols associated structs, unions,
enums, and typedefs. When an external module is built,
it will store the corresponding symbol and version info.
When the module is inserted a check is performed
to ensure that the version for each symbol matches.

This ensures that the interface between kernel
and modules is not broken, and allows more flexibility
than an explicit kernel version check.

Change-Id: Idd358dcaa86f1c77544944899d1c3d355d6c15e6
Signed-off-by: Tate Hornbeck <tate.hornbeck@ti.com>
Revert "configs: blaze/panda: zero out remoteproc dynamic carveout (dsp)"

This reverts commit 9e69eab645d01b7b6c8d6d9eda64eaa210236536.

DSP currently requires 4MB of memory to be set-aside to meet its
firmware requirements. This memory can either be dynamically
reserved or statically reserved during board initialization.
The above commit zeroed out the dynamic configuration sizes as
the static reservation was used previously. DSP does not have
a mandatory requirement to use static reservation, hence the
above commit is being reverted in preparation for switching to
a dynamic reservation.

Change-Id: I8bf374b7865025f2e6b3aff7c5e3308a136a87ea
Signed-off-by: Jesse Villarreal <jesse.villarreal@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
blaze_defconfig: Enable SCHED_TRACER

The Galaxy Nexus JB production devices support the systracer.py
script which can be used to enable tracepoints in Android. This
needs the SCHED_TRACER config flag to be enable.

(Cribbed from the tuna defconfig in public kernel)
b129322 omap4: tuna: enable SCHED_TRACER in defconfig

Change-Id: I1a20095f7fe2ad3c047ff7067cd021032381141e
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
blaze_defconfig: enable USB networking

USB network adapters are widely used for many cases.
Enable USB networking so rebuild of kernel will not be
required for USB network adapters usage.

Change-Id: Ic45ff71922538be6b0404c3674ac9002a838ae3a
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
blaze_defconfig: Enable LG LD089WU1 panel

Enable LG LD089WU1 panel with WUXGA resolution in kernel configuration file

Change-Id: I0a88e395d495d85997c1dc60153ab73eea7e17ed
Signed-off-by: Victor Kleinik <x0150886@ti.com>
blaze_defconfig: build Bluetooth as modules

Build the Bluetooth sub-system and the drivers as modules. This is to enable
building the Bluetooth sub-system and drivers via the compat-wireless approach
for enabling BlueTI.

Change-Id: I9465b5fc8ff651c167e48920726592a5080926e6
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
blaze_defconfig: build gps driver as modules

TI's GPS solution for Android expects gps driver to be built as a module.

Change-Id: If7d989c74363ab719f08c308e7c746fd4cf8d324
Signed-off-by: Bindu <bkurian@ti.com>
blaze_defconfig: Add KPROBES and RELAY dynamic instrumentation

On top of SCHED_TRACER support these flags are required for
tooling purposes and should have no runtime impact until
enabled.

Change-Id: I64985cfc339c41d5bbb65f4773aea889ee49e4ee
Signed-off-by: Tony Lofthouse <a0741364@ti.com>