USB: rndis: Free the rndis response queue during REMOTE_NDIS_RESET_MSG

When rndis data transfer is in progress, some Windows7 Host PC is not
sending the GET_ENCAPSULATED_RESPONSE command for receiving the response
for the previous SEND_ENCAPSULATED_COMMAND processed.

The rndis function driver appends each response for the
SEND_ENCAPSULATED_COMMAND in a queue. As the above process got corrupted,
the Host sends a REMOTE_NDIS_RESET_MSG command to do a soft-reset.
As the rndis response queue is not freed, the previous response is sent
as a part of this REMOTE_NDIS_RESET_MSG's reset response and the Host
blocks any more Rndis transfers.

Hence free the rndis response queue as a part of this soft-reset so that
the current response for REMOTE_NDIS_RESET_MSG is sent properly during the
response command.

CRs-Fixed: 449584
Change-Id: If7165a2b9a5775410ed900ca6ad7c83e5f4b6fb2
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
ASoC: msm: qdsp6v2: Fix memory leaks/access issues

Change fixes memory leak,array out of bound access
and NULL pointer access issues in audio driver.

Change-Id: Idba2d92bfddb779d2eb0969061207a5a3a38f2eb
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: pil-q6v5-lpass: Assert LPASS_RESTART when shutting down LPASS

With LPASS clock control recently moved to the LPASS Q6, it's now
possible to do a full reset of the LPASS subsystem during
pil_lpass_shutdown(). When the reset is cleared again in pil_lpass_reset(),
the subsystem will have been completely reset to a clean state. This
increases the likelihood of the LPASS fully recovering after a subsystem
restart.

CRs-Fixed: 455368
Change-Id: I1da22c9aca00b1dffc1be3785a6beef3ed3359f7
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
ASoC: msm8974: Fix NULL pointer access issue

Change fixes NULL pointer access issue if memory
allocation fails.

Change-Id: I1cc1b44ab42b9fdca66452aeae073fabfd9132e6
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
diag: Add concurrency protection to writes on smd data channels

Currently, diag does not protect against multiple threads writing
on a diag smd data channel at the same time. Make changes to protect
against concurrent writes on the same smd data channel.

Change-Id: I80982175821d60ffbc6bc4d6058c322dd894ebd3
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
msm: 8610: fix boot dependencies

The early init sequence in msm8610_add_drivers() depends on an
initialized SMD, which is currently missing.

Add the SMD dependency, and SMD's dependency on modem_notifier.

Change-Id: If5e3c616e7df3ed8fe29ae97537af2f43f2af499
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
msm: smp2p: Convert smp2p irq register base from virtual to physical

Virtual base address of smp2p irq register is hardcoded in device
tree which causes issues with LPAE support, and irq register is
referenced by name, which adds overhead.

Change to physical address in device tree and ioremap to virtual address.
Reference irq register by index as opposed to by name.

CRs-Fixed: 461400
Change-Id: I0e673409dbfe4ca1d8c3cb1f1d8cafb61e60f8de
Signed-off-by: Brent Hronik <bhronik@codeaurora.org>
msm: clock-8226: Set an initial rate on the MMSSNOC AXI clock

It's possible that a driver may try to enable a branch clock
downstream to the MMSSNOC AXI RCG before the bus driver is
able to set a rate on this clock. Set an initial rate on this
clock.

Change-Id: Icf7eda69623eba57728cd32193db6604f8302092
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
ASoC: apq8064 : Fix for voice over USB in Fusion target

- currently APQ assumes 8k and mono as USB parameters for
  voice over USB but MDM configures with 48k and stereo
  as USB parameters which results a mismatch between APQ
  and MDM configurations
- Set the APQ parameters in sync with MDM

Change-Id: Ibbdf6bb620b4fd2c25ba6879477488c85c5defc9
Signed-off-by: VidyaKumar Athota <vathota@codeaurora.org>
CRs-Fixed: 415079
arm/dt : msm8610 : Update MPM mapping

Update mpm mapping for GIC and GPIO for 8610.

Change-Id: I73054d9d22408329384c83ce27327896fb75fa43
Signed-off-by: Priyanka Mathur <pmathur@codeaurora.org>
diag: Fix incorrect response for Log On Demand request

Apps processor handles Log on Demand requests when there is no
Modem or when used with an older Modem. The response that the Apps
processor sends for Log On Demand was incorrect - drifted bt one
byte. This change fixes that issue.

Change-Id: I973e004ad5c056629b4ee993d2ded4c860d16976
CRs-Fixed: 464647
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
arm/dt: zinc: Add rtb device

RTB is a logging infrastructure used to trace certain events.
Add the device to support logging for the zinc target.

Change-Id: I611558b30206575cce6ca5a0ceb4b2c06496b1d7
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
arm/dt: zinc: Add ion heaps

Ion heaps are needed for various devices to get
memory. Add definitions for Ion heaps.

Change-Id: I75fcb4e6c61e1ccd0624dea9bac43f3923f2f348
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
gpu: ion: Correctly print out physical addresses

Physical addresses may not always be able to be printed
with %lx. Use %pa to print out physical addresses.

Change-Id: If7e91277b04495bbb13112259428f449043fc63f
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: Use phys_addr_t for the memory hole

On systems with 64-bit physical addresses, unsigned long
is not big enough to store the memory hole information.
Use phys_addr_t to store this information.

Change-Id: I5d5f2fff9864a0da4f8f14085d9d61a1419fc550
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ARM: LPAE: Fix mapping in alloc_init_section for unaligned addresses

With LPAE enabled, alloc_init_section() does not map the entire
address space for unaligned addresses.

The issue also reproduced with CMA + LPAE. CMA tries to map 16MB
with page granularity mappings during boot. alloc_init_pte()
is called and out of 16MB, only 2MB gets mapped and rest remains
unaccessible.

Because of this OMAP5 boot is broken with CMA + LPAE enabled.
Fix the issue by ensuring that the entire addresses are
mapped.

Change-Id: I035cc491c4bccd810ecd53c60cbff0494899fcfa
Signed-off-by: R Sricharan <r.sricharan@ti.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoffer Dall <chris@cloudcar.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Laura Abbott <lauraa@codeaurora.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Patch-mainline: linux-arm-kernel @ 03/18/2013, 22:05
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
defconfig: msmzinc: Enable support for CMA

Drivers depend on the Contiguous Memory Allocator (CMA)
to get large chunks of memory. Enable this option.

Change-Id: I29f5526674ca8a0df14582aab32f22a96757283b
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: kgsl: Locate index of recovery during initialization

When a hang happens locate the index in ringbuffer from where replay
of recovery needs to be re-tried during initialization of recovery.
If the hang detection is false then hang reported by postmortem and
snapshot may be different, but recovery will always start from the
index obtained during initialization. Also, this allows us to capture
data into the snapshot that is in line with the point from where
recovery occurred.

Change-Id: Ie3877f0c81dad2ede888db7cb7d3ff13e2761763
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Recovery policy change

Recovery algorithm is changed to
step 1: retry the same commands that hung the GPU
step 2: if step 1 fails, nop just the IB that hung the GPU
	and retry
step 3: if step 2 fails, skip commands in current context
        till end of frame and retry
step 4: if step 3 fails mark context as bad and execute
        the remaining commands from good contexts.

Previously we used to return -EDEADLK when recovery succeeds,
this is the same error code if the context is not recoverable.
With new policy if recovery succeeds we return -EAGAIN so that
userspace treats recovered context differently from the ones
that are not recoverable. If recovery fails we mark the context
as bad and return -EDEADLK.

Change-Id: I9fa3c40801964186866b6002e62f19cf6aa41361
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Renaming recovery to fault tolerance

Renaming recovery to fault tolerance and modifying
the functions and log messages accordingly.

Change-Id: I5f249806026ac514c4aff7da45c3a4e8cc2f8c34
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>