fat: limit the number of error prints

Use fat_fs_error_ratelimit instead of fat_fs_error so as to
avoid large number of prints.

Change-Id: I2e21e6bd0c8e7e79d3ced9c213668c405fd6260d
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Manish Kumar <manishku@codeaurora.org>
Merge 82c1ac58a1f53a187ed575b37110ad1d8d83dfeb on remote branch

Change-Id: If354500d6e0d5c55d79aea70b712baaa2791e5e5
fat: limit the number of error prints

Use fat_fs_error_ratelimit instead of fat_fs_error so as to
avoid large number of prints.

Change-Id: I2e21e6bd0c8e7e79d3ced9c213668c405fd6260d
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
ARM: dts: msm: List all possible BW levels in cpubw for 8974

With the cpubw_hwmon devfreq governor available in Krait based CPUs, it's
important to list all the possible BW levels to get all the benefit from
the cpubw_hwmon governor. Also fix the use of a non-existent BW level in
msm-cpufreq device.

Change-Id: I9a2725f459914296765ed70cabe470e643b02381
Signed-off-by: Panwar Vivek <vpanwa@codeaurora.org>
ARM: dts: Disable RPM notifications for L2 GDHS collapse on Krait targets

Entering vdd minimization is unsupported during L2 GDHS collapse.
Prevent this from happening by not notifying the RPM during the L2
GDHS SPM sequence.

CRs-Fixed: 609356
Change-Id: Iefcb3597df5af104f823fdfb1ad1879f5d1d057e
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: lpm_levels: Perform system_unprepare only system low power mode

system_unprepare() needs to execute operations related to system
unprepare only when the CPU subsystem was scheduled for a system low
power mode by the last core that went down. On the last core down, its
possible that residency conditions for system low power mode weren't met
and the system was never programmed to enter a low power mode. In these
scenarios, the system_unprepare() needn't execute any of the unprepare
functionalities.

CRs-fixed: 596831
Change-Id: I36b00f254354920775ba8e797bb08932e2495b24
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
msm: remote_spinlock: Add support for remote_spin_lock_rlock_id()

remote_spin_lock_rlock_id() and remote_spin_unlock_rlock() are
added to acquire/release a raw remote lock (without a local
spinlock). This is useful when ownership of a lock must transfer
between different execution environments, such as when a lock is
used to guarantee atomicity of a set of actions spread across
different execution environments.

Specifically, these APIs are added to support a new lock which
must be acquired in Linux but released by TrustZone software.

Because no local spinlock is acquired, each thread must use a
different ID so that only one thread can proceed through the
lock at a time.

Support for these new APIs is presently implemented only for
SFPB locks.

Change-Id: Ifc5b1f552090051d2e975107e56e21e22df08924
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: pm: Notify secure code of L2 power mode from last core only

Notify secure code L2 low power mode only if the current core is the
last core down. In certain scenarios, its possible that Linux and
secure code have different views of what a last core and could result in
secure code not invalidating a cache when the L2 was placed in a
non-retention mode.

Consider a two core scenario where Core 1 is power collapsed and Core 0
is the last core down setting L2 to be invalidated. Before Core 0 makes
the scm call, its possible that is interrupted to process a secure
interrupt. If the Core 1 wakes up in this time and decides to vote a
different L2 mode, this mode wouldn't be consistent with what Core 0
passes down to secure code when resuming from interrupt handling. In
these cases, the secure code could end up incorrectly invalidating the L2
on warmboot.

Also, the secure code and Linux should have a consistent view of what
last core down is to flush and invalidate L2. To ensure this, acquire a
remote (hardware) spinlock to serialize the last portion of the
power-collapse sequence. The remote spinlock will be released by the
secure code after it acquires its own lock to serialize the power
collapse sequence.

Change-Id: Ib5e2f360fddce558d22ce094dd7755c395c45a8c
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Merge AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.092 on remote branch

Change-Id: Ic76c49fd8238a9cbb5166dd64ccda1efe29b3a62
Merge "ARM: dts: msm: List all possible BW levels in cpubw for 8974" into LNX.LA.3.5.1_RB1.1
cpufreq: cpu-boost: Fix queue_delayed_work_on() race with hotplug

Calling queue_delayed_work_on() on a CPU that's in the process of getting
hotplugged out can result in that CPU infinitely looping in
msm_pm_wait_cpu_shutdown(). If queue_delayed_work_on() is called after the
CPU is hotplugged out, it could wake up the CPU without going through the
hotplug path and cause instability. To avoid this, make sure the CPU is and
stays online while queuing a work on it.

Change-Id: I1b4aae3db803e476b1a7676d08f495c1f38bb154
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
cpufreq: cpu-boost: Fix deadlock in wake_up of sync threads

If wake_up() is called on the current task on a CPU, the call will wait
until the current task is switched out before it wakes it up again and
returns.

The sync notifier for a CPU always runs on that CPU.

These two together can result in a deadlock if the sync notifier on CPU A
tries to wake up the sync thread of CPU A as it goes to sleep (is the
current task). A previous commit fixed this by adding a check to the sync
notifier to not wake up the sync thread of CPU A if it's the current task.

But this is still not sufficient to prevent deadlocks.

Sync thread of CPU A could be the current task on CPU B and sync thread of
CPU B could be the current task on CPU A.  At this point, if sync notifier
of CPU A and B try to wake up the sync threads of CPU A and B, it will
result in CPU A waiting for the current task in CPU B to get switched out
and CPU B waiting for the current task in CPU A to get switched out.  This
will result in a deadlock.

Prevent this scenario from happening by pinning the sync threads of each
CPU to run on that CPU. By doing this, we guarantee that sync notifiers
will only try to wake up sync threads running on that CPU. The fix added by
"cpufreq: cpu-boost: Resolve deadlock when waking up sync thread" ensures a
deadlock doesn't happen when a sync notifier tries to wake up a sync thread
running on that CPU.

Change-Id: I864e545529722a23886dd5a82f66089155d2d193
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
msm: rpm-regulator-smd: fix request suppression policy

The rpm-regulator-smd driver sends requests for a given regulator to
the RPM only if the regulator has been enabled by a Linux consumer.
If the regulator is disabled from Linux's point of view, then voltage
and current requests are buffered until the regulator is enabled again.
This buffering can lead to regulators being left at unnecessarily high
voltages when they are no longer needed.

Modify the request suppression policy so that current and voltage updates
are suppressed only before the first enable/disable request is sent for a
regulator or while the regulator is disabled if it has been marked as
apps-only. The first request sent for a given regulator must provide a
value for the enable/disable parameter otherwise the RPM will treat it as
an implicit disable request. This would break use-cases that require
certain regulators to be left on until sufficient software control is
initialized. Add a new device tree property, qcom,apps-only, which can be
used to specify that a given regulator supplies hardware that is fully
controlled by the applications processor.

CRs-Fixed: 533263
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Change-Id: I2a8820662e1471e5ff44f7d681d5d768da74980f
Merge "Merge AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.092 on remote branch" into LNX.LA.3.5.1_RB1.1
Merge changes I864e5455,I1b4aae3d,Ib5e2f360,Ifc5b1f55,I36b00f25,Iefcb3597 into LNX.LA.3.5.1_RB1.1

* changes:
  cpufreq: cpu-boost: Fix deadlock in wake_up of sync threads
  cpufreq: cpu-boost: Fix queue_delayed_work_on() race with hotplug
  msm: pm: Notify secure code of L2 power mode from last core only
  msm: remote_spinlock: Add support for remote_spin_lock_rlock_id()
  msm: lpm_levels: Perform system_unprepare only system low power mode
  ARM: dts: Disable RPM notifications for L2 GDHS collapse on Krait targets
Merge "msm: rpm-regulator-smd: fix request suppression policy" into LNX.LA.3.5.1_RB1.1
ASoC: msm: qdsp6v2: fix slow_talk not disabled issue

If slow talk is disabled from the settings menu after voice
call is ended, the command is not sent to dsp since the voc state
is not in VOC_RUN and on next call CVS still has slow talk property
enabled. Fix by disabling slow talk when voice call is ended.

CRs-Fixed: 607911
Change-Id: I2c312e41b14fca021f8d41380c3b5c8493710255
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
msm: mdss: hdmi: parse for resolutions in EDID block 0

If EDID block 1 is not available or video data block is not
available, allow parsing of resolutions from block 0.

CRs-Fixed: 596518
Change-Id: I8574de3f80c817ac764d467e622ded7430c0df86
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Merge "ASoC: msm: qdsp6v2: fix slow_talk not disabled issue"
Merge "msm: mdss: hdmi: parse for resolutions in EDID block 0"