Revert "audit: Silence excessive logging"

This reverts commit e702eae9b602b993fbd5ffe0d2653895b252e5c2.
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>
msm: kgsl: Fix range checking for profile wrapping

There is a chance that the profile code will not wrap correctly.
This can cause the in stream profiling to cause buffer pre-run
or undershoot (accessing data before the buffer). Fix logic to
cause the correct wrapping.

Change-Id: I9aa68228ff5be1bd26ee1cf1a486859346a8027f
CRs-Fixed: 585754
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
msm: kgsl: Don't open kgsl device in erroneous case

If kgsl_get_process_private() returns NULL, it goes to
err_stop with result = -ENOMEM. If open_count is 0,
adreno_stop() overwrites the result variable with 0.
This leads to kgsl_open() to be successful while it
shouldn't.

Change-Id: Ic12d92a099280e4d958fa192fa5128211120d361
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
PM / devfreq: Add a new target flag for the performance governor

The new flag for the devfreq profile->target() function is used
by the performance governor to notify the driver that the device
should wakeup on the max frequency.

Change-Id: I91c2d649177bdd1841a087a2125d1cdbc979f5c1
Signed-off-by: Vladimir Razgulin <vrazguli@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>
net/wireless: Fix kernel crash while doing iwlist scan

Remove the code that extracts the information of the rates without
the check for the corresponding bands. Also , this part of the code
is redundant as the following code checks for the same, which also
prevents a possible crash.

Change-Id: I1b4d243cd65f8890f4f7ab4cddf72aad261d7bb0
Signed-off-by: Ming-yi Lin <mylin@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
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>
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: ehci-msm-hsic: avoid double free of platform data

When device tree is enabled, the platform data structure is allocated
via devm_kzalloc and assigned it to pdev->dev.platform_data. This
memory is freed twice during platform device unregistration in
devres_release_all() and platform_device_release() functions. Assign
pdev->dev.platform_data to NULL in device driver remove method to
avoid this double free.

Change-Id: I713e0fa97e00124166a727718c0a31ab5e2c2d3b
Signed-off-by: Pavankumar Kondeti <pkondeti@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>