qseecom: Add NULL pointer check in qseecom_ioctl

NULL pointer check is added to the qseecom driver in qseecom_ioctl,
which is required to validate the data pointer before executing any
other code from ioctl's.

Change-Id: I6fecf13769b4d7e94eebd4dc075a5ece79b18e1b
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
qseecom: Rename & unifiy some enum definitions.

Move the key management enum values into unified enum
Rename RPMB related enum definitions as per existing pattern.

Change-Id: I542f934ffc399563a587d5016e974a7ce585f0dc
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
qseecom: Fix QSEECOM_IOCTL_UNLOAD_EXTERNAL_ELF_REQ kernel crash

Fixes the kernel crash occuring with IOCTL_UNLOAD_EXTERNAL_ELF_REQ
ioctl by adding unavailable client type to qseecom_client_handle_type
enum, which is required in the driver during qseecom_release().

Change-Id: I73b817255149ffc4a808852feb2954a0ba3c317f
CRs-fixed: 508253
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
msm: cpufreq: Don't try to call acpuclk_get_rate()

acpuclk_get_rate() is broken, so don't even try to call it as it will
invoke clk_get_rate() anyway.
cpufreq: ondemand: Remove unnecessary synchronization attempt

Commit 1ce28d6b (ondemand: updated tune for hardware coordination)
brings in an attempt to synchronize expiry of per-cpu ondemand timer
at same time across all online cpus. This is meant to help systems
where "multiple cores share P-state via Hardware Coordination".

Synchronization is achieved by having timers expire when jiffy value
would be a perfect multiple of sampling window size. While such
synchronozation attemps are unnecessary on systems where cores don't
share P-states, it can hurt on power as cpus can now work off shorter
sampling windows (when percentage utilization over short window can be
observed to be high, causing frequency to be boosted).

Remove this unnecessary attempt to synchronize expiry of ondemand
timer across online cpus. A more acceptable solution could be to have
low-level architecture specific cpufreq driver indicate the need for
synchronization.

Change-Id: I6cb1cf3472ca106f029dc01248e0df7cfbb495b8
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
devfreq: governor_cpubw_hwmon: Remove sample_ms and fix round up of freq

devfreq already provides a sysfs interface for changing polling/sampling
period. So, there is no need for the governor to separately expose
sampling_ms. Also, sampling_ms had to be explicitly updated whenever
polling_ms was updated for the governor to function correctly. Make the
interface simpler by combining sample_ms with polling_interval control
provided by devfreq.

The rounding of freq to multiples of bw_step is unnecessary since the
devfreq device already does the rounding to the next valid level. Rounding
of AB to multiples of bw_step is still necessary since it's a vote that's
summed up and doesn't have a direct 1-to-1 mapping to frequencies.

Also update default bw_step to 190 MB/s instead of 200 MB/s to account for
the fact that MB/s to MHz conversion needs to take into account the
difference in the meaning of M (2^20 vs 10^6) between MB and MHz. Similarly
also update io_percent to 16.

Change-Id: I5fea989c647955103de3813be8eb9ec612f131bc
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
msm: audio: qdsp6v2: disable read interrupts for smd channels

SMD channels are configured to send interrupts when the remote end
reads from the channels. Disable this behavior to reduce number
of interrupts.

Change-Id: Idc6e57a68741dd6e52f0f1be57b8c85c586df59f
Signed-off-by: Panwar Vivek <vpanwa@codeaurora.org>
msm: reap unused audio files

Removing this file as it is not used in this branch.

Signed-off-by: anish kumar <kanish@codeaurora.org>
Change-Id: Ia7bd5c606c90a26f3180194d1a8d1810fcab6228
USB: dwc3: gadget: Add support for sending zero length packets

Currently driver is not honouring req->zero flag even though
function driver sets this flag. If device has to send IN data back
to host and length is multiple of endpoint maximum packet size, it
should send additional zero length packet at the end to terminate
transfer.

CRs-Fixed: 592504
Change-Id: I5a8aecc504098ed386a9a9d19f4f5b78c911a376
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
USB: ccid_bridge: Add support for USB smart card class

This module implements a bridge driver which allows user space
to communicate with USB smart card devices.  This module provides
/dev/ccid_bridge device file which allows read/write/ioctl methods.
The ioctls facilitate control and interrupt transfers.  The bulk
transfers are implemented via read and write.  The interrupt
endpoint is optional and not all devices may support it.

Change-Id: I67ac7c7d15fb65c8f6a2cc9f9c81343da074aab7
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
usb: core: Limit HCD old enumeration scheme request to root ports

HCD_OLD_ENUM HCD flag is introduced to use old (or short) enumeration
scheme for the devices attached on the corresponding USB bus. The old
enumeration scheme is used by the MSM HSIC controller to avoid multiple
reset during enumeration. This is useful when a known device is attached
to the USB bus, which is the case with MSM HSIC. When a HSIC HUB is
connected, any device can be connected on the HSIC USB bus. The new
enumeration scheme supports wide variety of USB devices. Hence limit
the old enumeration scheme request of a HCD to only root ports.

Change-Id: I6035c2a766787819eb8d0e1fa774e0c79d6e958b
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: dwc3: Fix compilation error when debugfs is disabled

The code does not compile with debugfs disabled. Fix this.

Change-Id: I19b784495b57e7fc0c57b455dd80a63b79177569
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
usb: f_qc_rndis: set context for encapsulated response

Setting the req->context field for encapsulated responses
as well as for encapsulated commands. This prevents a
corner case where the request is initially used for
a response, prior to using it for a command.

Change-Id: I466bf9c02669161df3565d3f6f9a064aabffa822
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
USB: gadget: u_bam: Add module parameter for max packets pending with bam

Add module parameter for configuring maximum number of packets to be
pushed to bam without ack from bam dmux. Also add counters for number
of times rx flow control enabled and disabled, which will be helpful
for debugging.

Change-Id: Iefad2c923534b92ca729def85a36ef787b790690
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
mmc: sdhci: fix incorrect command used in tuning

For SD hosts using retuning mode 1, when retuning timer expired, it will
need to do retuning in sdhci_request before processing the actual
request. But the retuning command is fixed: cmd19 for SD card and cmd21
for eMMC card, so we can't use the original request's command to do the
tuning.

And since the tuning command depends on the card type attached to the
host, we will need to know the card type to use the correct tuning
command.

Change-Id: Ibde71d8a8b4e0ff75456923c7c3d8579c04109b4
Signed-off-by: Aaron Lu <aaron.lu@amd.com>
Reviewed-by: Philip Rakity <prakity@marvell.com>
Cc: stable <stable@vger.kernel.org> [3.3+]
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
mmc: sdhci: fix NULL dereference in sdhci_request() tuning

Commit 473b095a72a9 ("mmc: sdhci: fix incorrect command used in tuning")
introduced a NULL dereference at resume-time if an SD 3.0 host controller
raises the SDHCI_NEEDS_TUNING flag while no card is inserted.  Seen on an
OLPC XO-4 with sdhci-pxav3, but presumably affects other controllers too.

Change-Id: I14a9e2a4566ed9f6d4186d6f63ed2e192485973d
Signed-off-by: Chris Ball <cjb@laptop.org>
Cc: stable <stable@vger.kernel.org> [3.3+]
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
mmc: sdhci: retune on cmd or data CRC error

Initiate a DLL (delay locked loop) retune for the next command,
if the current command fails with a CRC error.
This may help to choose a different phase (delay) if the same
has changed over the elapsed period of time.

CRs-Fixed: 587985
Change-Id: I21f6a5dadb096dd38d41fcf2251fa50b03c8bbb4
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
mmc: core: increase data-timeout value for Hynix cards

Add a quirk to increase the data-timeout value for Hynix eMMC
cards only. This value is fixed to a maximum of 4 seconds.

Change-Id: I4bca6cbc877b323b29a3f7f5923d0708c48adf2c
CRs-fixed: 587284
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
mmc: sdhci: do not use maximum timeout for all cards

Remove maximum timeout for all cards, since this causes
a long resume time for SD cards. Now only Hynix cards would
have this maximum timeout and this would be decided at the core
layer.

Change-Id: I758f9e5ecf407aba371928a86c313cf69e3cda63
CRs-fixed: 587284
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
mmc: core: do not reinsert prepeared FUA and FLUSH requests in stop flow

When mmc context has unblocked from waiting current request because of
urgent request notification coming from block layer, there is prepeared
request.  In the case, when the request is REQ_FUA or REQ_FLUSH, the
flow should not reinsert it back to i/o scheduler (since according to
block layer logic flush requests with data should never enter elevator).
Instead this request starts immediately.

Change-Id: Ia78b56c6135dd1a8d75a98fd5b771a5035e5c360
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>