diag: Do not write to USB when usb is disconnected

Diag driver tries to write to the USB from different workqueues.
The connect and the disconnect events happen in a different
workqueue. This can lead to a race conditon in setting the SMD
in_busy variables resulting in continuous reads, thereby queueing
up a lot USB writes. This patch protects the SMD in_busy
variables and reduces the latency of USB connect and disconnect
events.

Change-Id: Ia09a67c963749237c5e7471a5a9d3e2736c09c06
CRs-Fixed: 564562
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
coresight: modify function names and messages

Modify function names and messages to be consistent with other
modules. Modify function names starting with control_* to
event_*, abort_control_tracing to event_trace_user_fault and
abort_tracing_undef_instr to event_trace_undef_instr.

Change-Id: Ic6101dc8024b8d10713c162ea93e268ba59eaf8a
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
coresight: make coresight event module configurable

The coresight event module helps abort tracing on user fault
and undefined instruction exceptions. Add module parameter to
control it dynamically.

Change-Id: Iecaa144b99e3786c8c8f570f989f747be12c4fdc
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
coresight: abort tracing for unhandled aborts

Add trace event to abort tracing for unhandled aborts such as
data abort and prefetch abort. A common event 'trace_unhandled_abort'
is shared for all unhandled aborts.

Change-Id: I6da9b30c74be48252402188a6f9a7703d21d6276
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
defconfig: 8226: statically compile coresight event module

Statically compile the coresight event module to eliminate the
need to manually insert it and also for easier post-process parsing
of the collected trace.

Change-Id: Ibc824cf86275c7ab6bb205524fdcc308d532cc91
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
defconfig: 8974: statically compile coresight event module

Statically compile the coresight event module to eliminate the
need to manually insert it and also for easier post-process parsing
of the collected trace.

Change-Id: I5d772e33ff6ad3ec5ea44f9c88905eeab7c01fc8
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
defconfig: 8610: statically compile coresight event module

Statically compile the coresight event module to eliminate the
need to manually insert it and also for easier post-process parsing
of the collected trace.

Change-Id: Ied3402e00a7017563c18cb3432520601dc2d23e6
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
defconfig: 9625: Statically compile coresight event module

Statically compile the coresight event module to eliminate the
need to manually insert it and also for easier post-process parsing
of the collected trace.

Change-Id: Ief3d49ca80a5b8c9fb95b4fbc665bddbc8e6cf0e
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
devfreq: governor_cpubw_hwmon: Fix use of decay_rate

The decay rate tunable is used to compute the current averaged bandwidth
use, but the calculated value is never used. Fix this by using the
calculated averaged bandwidth instead of the instantaneous measured
bandwidth when computing the AB and IB votes.

Change-Id: Ic0ba3ce0d98f0ec185349fe6d86c4af26f222ff2
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
ASOC: msm: Enable volume mixer for hfp

Enable volume mixer for HFP in afe loopback

CRs-Fixed: 596437
Change-Id: I6ba180b4c700f24e610fbac4abcbbb0d1d57ccda
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
msm: camera2: cpp: Add support to enable turbo mode dynamically

The input stream can have varying properties. Based on the input
the clock can be set to turbo mode. This change adds support
for necessary IOCTL.

Change-Id: If5e0b9392b03cf037009442eb9935a96823cb1e5
Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>
msm:cpp: Validate data lenght in Set Clock command

The lenght of the data packet recived in case of
VIDIOC_MSM_CPP_SET_CLOCK command must be validated.
It have to be equal or smaller than the size of the
variable used to hold the data. If this condition
is not met stack-based buffer overflow will occur.

Change-Id: I68002e088aaca1ca740985d9e26e9161f130b499
Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>
msm: cpp: Add dynamic clock setup

The CPP load depends on the frame resolution, which is
processed. CPP clock can vary depending on the load. Thus
the system can be relaxed when smaller resolutions are
processed.

Change-Id: I03dd8e8e6c5e76c6eecccea15f1308f096e3fb7c
Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>
ASoC: msm: qdsp6v2: fix possible integer overflow

Check integer overflow before multiplying struct size. If that happens
should return immediately. In addition if param length is greater than
MAX size from spec, better return error.

Change-Id: Ib96cb419ade042d21a1213f6d8c2ff339f5d1c56
CRs-fixed: 605273
Signed-off-by: Fred Oh <fred@codeaurora.org>
msm: camera: Fix bug in csid or csiphy IO struct

The struct mapped to IO call is wrong. Map proper struct so that
v4l2 ioctl handler and perform proper copy_to_user / copy_from_user.

Change-Id: Ia7afadf24dbf4b2129ad1898a702eb69826bd6db
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
msm: mdss: Add error message when histogram bin collection is incorrect

In the cases where histogram bin collection does not return the expected
number of bins, we return an error, however we do not print any error
message saying which DSPP had failed bin collection. In order to know
which pipe the histogram failed on, we must add an extra log.

Change-Id: I1fb39e146cd3367d3b97f10174573a5207284652
Signed-off-by: Benet Clark <benetc@codeaurora.org>
crypto: msm: fix Off-by-one error in computation of length for strlcpy()

size + strlen("qcom-") is equal to the length of string not including the
null character. However,we are comparing it to the length of the buffer,
so we need to include the null character, and make a change to make sure
(size + strlen("qcom-")) is smaller than CRYPTO_MAX_ALG_NAME.

Change-Id: I882e2c3e761a4bd4344ce8820b26cf890f29bab3
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
qseecom: add support to clear key for per file encryption

Make a KMS change to support just clear pipe key without deleting it
from ssd storage. Key id definitions for FDE and PDE are also updated.

Change-Id: I7c4804902a7a734087374c81ff0fd95655d84429
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
mmc: core: Fix disabling of cache for Hynix cards

Commit 6932a01cd (mmc: card: quirk: disable cache for Hynix card)
claims to disable cache because of data corruption issues when cache
it is enabled. In reality, the patch allows enabling of cache during
card initialization but disallow flushing of cache during suspend or
file system sync operations. This is more dangerous than without
the commit. Move the fixups for disabling cache to mmc_fixups so as
to enable the quirk during initialization itself. Also, remove obvious
warnings everytime card is initialized during runtime resume.

Change-Id: Ibd120f7b4a4db9b92ce1d9785afd74ae4ea6ee86
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
msm: mdss: Prevent excessive logging during rotation set failure

Changing the error log to debug log in case SMP reserve fails
for rotation. The use case falls back to GPU. Same is being
done in  case of mdp interface set path.

Change-Id: I00a9e05b3a04a87e354fd0e60ad900f4f71cdfc1
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>