Revert "msm: bam_dmux: fix compilation issue"

This reverts commit f6c546a9cc09a58ab9ffa988c37d7d8e4b5f21b2.
Revert "msm: bam_dmux: optimize UL inactivity timeout"

This reverts commit c28a1b666662025060297665f5fae4892bba6182.
Revert "Delay UL powerdown if BAM is in polling mode"

This reverts commit e6c72d47695e45aacbc56c0c9700654a623e9d80.
Revert "msm: bam_dmux: UL inactivity timeout is too high"

This reverts commit a8d152c93076fce221506bf4e8690e574edad6e2.
mmc: core: enable async suspend

Enables the asynchronous suspend of card and class device.
This would enable both these devices to suspend in separate
respective threads, thus allowing other devices to suspend
concurrently.

CRs-fixed: 634333
Change-Id: Ic73022ef777b4fae4b1065f92cfa19da51a99634
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mmc: sdhci-msm: enable async suspend

This is aimed to reduce the suspend time of sdhci-msm device.
The suspend of this device would be carried out in a separate
thread and other devices may suspend concurrently. This is
required since the mmc sub-system contributes to the major
chunk of suspend latency.

CRs-fixed: 634333
Change-Id: I7bdead2deacd96aec5201d82b143b07c470b3892
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
TTY: msm_smd_tty: Fix simultaneous open/close race condition

smd_tty_close currently has a variable that depends on a race
condition with tty_port_open. This causes a null-pointer dereference
when the same port is simultaneously being opened/closed.

Use data from a static array instead of the variable to eliminate
the race condition.

CRs-Fixed: 624398
Change-Id: Ie55d37feaadd3a15f64e18501cd3af19145dbc8e
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ARM: smp: BUG() if smp_send_reschedule() is called for an offline cpu

Sending an IPI_RESCHEDULE to an offline CPU is incorrect and potentially
bad for both power and stability. On some sub-architectures such as MSM,
if a power-collapsed CPU is unexpectedly woken up by an IPI, it will be
begin executing without the preparations that would normally happen as
part of CPU_UP_PREPARE. If clocks, voltage regulators, or other hardware
configuration are not performed, the booting CPU may cause general
instability or (at best) poor power performance since the CPU would be
powered up but not utilized.

One common cause for such issues is misuse of add_timer_on() or APIs
such as queue_work_on() which call it. If proper precautions are not
taken to block hotplug while these APIs are called then a race may
result in IPIs being sent to CPUs that are already offline.

This same argument could be applied to other IPIs (with the exception
of IPI_WAKEUP), but the others are already restricted to only online
CPUs by existing mechanisms, so an explicit assertion is not useful.

Change-Id: I437db112e7e2fa7c0635e4e97e265692621944f1
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
usb: gadget: Fix response available notify count usage

The outstanding responses are purged and notify count is reset
during bus suspend. But the notify interrupt endpoint is not flushed.
If a request is pending with the controller, It gets finished during
resume and the notify count is decremented in the completion handler.
As the notify count is reset during the suspend its become negative now.
As the counter is not zero, interrupt notifications are queued even
though there are no responses. This is leading to watchdog bark due to
an error print messages.

Flush the notify endpoint before resetting the notify counter during
suspend. As we are modifying notify counter under spin lock, atomic
variable is not required. Ensure that notify counter never
becomes negative.

CRs-Fixed: 607029
Change-Id: I78cb7a585c1c2b527ca6b46bc99e7db8067ee21a
Signed-off-by: ChandanaKishori Chiluveru <cchilu@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "cpufreq: break earlier if target_freq is equal to current freq. Also fetch a fix from @imoseyon to update other cpuX nodes when cpu0 gets updated (max/min/gov)."

This reverts commit 4417fda8cd01b5c469f5d6c912cf485684d800a6.
cpufreq: bail early if target_freq == current.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cma: Drop the right mutex

The lock that was locked was cma->lock not cma_mutex. Drop
the right one when breaking out of the loop.

Change-Id: I0a1831b23613c5220795fe2a63f9db7439268c3f
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
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
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ASoC: msm: qdsp6v2: Fix deadlock due to mutex unlock

Mutex is not unlocked in one of the failure case
in sound model buffer allocation function. This
causes deadlock if the failure condition occurs.
This change handles the mutex unlock correctly in
failure case.

Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: ocmem: Serialize allocation requests only when necessary

Certain clients of ocmem always have exclusive regions set aside in
the OCMEM memory map. Allocation requests for such clients do not
have to wait for any pending evictions in progress to be completed
nor will trigger any new evictions and can be safely scheduled right
away.

Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: ocmem: Do not use data mover for clearing ocmem memory

In the non secure environment the data mover is used to clear
the ocmem memory. The ocmem driver no longer uses the data
mover for this operation.

Signed-off-by: Neeti Desai <neetid@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ARM: dts: msm: Remove dual configuration for CPU on msm8974

Remove the dual configuration for CPU master on msm8974. The original
intent of this feature was to overcome some bus limitations in certain
usecases. However new desgin impovements have made this feature requirement
obsolete.

Change-Id: Ia0e61a59252c3f90fd32054fe1a5a9297afbc89c
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
slim-ngd: NULL pointer check for client buffer

There is the chance of passing NULL pointer by the client
during the Slimbus/Codec transactions. Hence add NULL
pointer check for client buffer aswell.

CRs-Fixed: 608324
Change-Id: I161e8f04401afebb64ed72d5f392a67feb6ec13a
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: peripheral-loader: Change IOMAP_SIZE from SZ_4M to SZ_1M

The ioremap call made for zeroing out trailing memory is currently
requesting for a 4M memory region. This is resulting in vmalloc
allocation failures on some platforms.
Instead, request for 1M memory locations and zero out the area
in smaller chunks to make this failure less probable.

Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
slim_ngd: Add NULL pointer check apart from error check

Check against NULL pointer after allocating
the memory for msm_slim_ctrl structure pointer
dynamically to avoid unexpected crashes.

Earlier this pointer is checked only for error
codes. In this patch NULL pointer check is also
added.

Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>