mmc: core: Fix some driver hangs when dealing with broken devices

There are infinite loops in the mmc code that can be caused by bad
hardware.  The code will loop forever if the device never comes back
from program mode, R1_STATE_PRG, and it is not ready for data,
R1_READY_FOR_DATA.

A long timeout is added to prevent the code from looping forever.
The timeout will occur if the device never comes back from program
state or the device never becomes ready for data.

It's not clear whether the timeout will do more than log a pr_err()
and then start a fresh hang all over again.  We may need to extend
this patch later to perform some kind of reset of the device (is
that possible?) or rejection of new I/O to the device.

Change-Id: I1f3e5fddffb5134743fbfbcdef5e97803fd25fc6
Signed-off-by: Trey Ramsay <tramsay@linux.vnet.ibm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
msm: camera: fix the out of order of frames issue

observed that if the frame processing in the userspace
is delayed, the incoming frames from the hardware are being sent
to user before the diverted frame returns.so dropping the
the delayed postprocessing frame to prevent out of order

Change-Id: I43b0f9ea7a7683a419ce142b7d4fdf9e13d11d95
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>

Conflicts:
	drivers/media/video/msm/msm_mctl_buf.c
media: dvb: Fix calculation of next ready packet in dvb-ringbuffer

The calculation of number of bytes between the last reported
packet to the user and the current read pointer did not properly
take into account wrap-around case in the packet buffer.
Debug printouts for values returned by dvb-ringbuffer were
added for better traceability.

CRs-Fixed: 470982
Change-Id: I2765f5b1e0fbb7baed6725f2617702dd7ed87556
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>

Conflicts:
	drivers/media/dvb/mpq/demux/mpq_dmx_plugin_common.c
msm: Avoid NULL derefernce and array overflow

Add checks for NULL pointer dereference,array boundaries.

Change-Id: I0039f0f85b4782ea6215ee9241b0d5161336704f
Signed-off-by: Monika Alekhya <malekh@codeaurora.org>
msm: vidc: Remove delayed unmap flag in ion_map_iommu()

This change fixes the iommu map failure in movie studio
application by removing the delayed unmap flag in
ion_map_iommu(). The delayed unmap will cause the
iommu buffer to be unmapped only when all the clients
unmap the buffer.

Change-Id: I9e226fd56fecfa292e4d77aa94b2883bcfbf6ec2
CRs-fixed: 464374
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>

Conflicts:
	drivers/video/msm/vidc/common/init/vidc_init.c
Merge "media: dvb: Fix calculation of next ready packet in dvb-ringbuffer"
msm_fb: display: fix the suspend/resume hang caused by wait4vsync stuck

wait_for_completion in wait4vsync stucks after multiple suspend/resume
tests. The cause is that when show_event timeout happens, or vsync isr
is disabled for long time, wait_vsync_cnt resets to zero, and in vsync
isr complete_all has no chance to be called which caused mdp hang. So
complete_all needs to be called whenever show_event has timeouts.

Change-Id: I124899ff95fd5550d2759d215f16fa9cb8c0c211
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_video.c
msm: kgsl: initialize kgsl_sync_timeline_ops properly

CRs-fixed: 471346
Change-Id: Ib8dccb60ead6fcecc0f9beaf271ba28199d404a2
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Jeff Boody <jboody@quicinc.com>
ASoC: msm: FENS Support for VOIP calls

Add support FENS for Voip calls. Support is added by adding new
Mixer control

CRs-Fixed: 460878
Change-Id: I4c05155ac1de7b8da5b5e1ae24776c3e98b353f2
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>
rmnet_smux: device state check condition removed

If SSR happens in high watermark hit case, then the high-watermark-hit
condition is not reset correctly which causes TX data stall after
recovered from SSR.

In the SSR case, SMUX sends disconnect event to clients. For this event,
the RMNET client changes the device state to INACTIVE which prevents
call to msm_smux_close() from smux_rmnet_remove().

Remove the device state check condtion to iopen and close the RMNET
logical channel during RMNET device probe and remove.

CRs-fixed: 465510
Change-Id: I4dded65d41af4415f2427da388a59de4a1980a29
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Merge commit 'AU_LINUX_ANDROID_JB_2.5.04.02.02.40.234'

Change-Id: I55473df06735fd44e011f7b1b55263d7c47d3cc9
Signed-off-by: Neha Pandey <nehap@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/ipc_socket.c
	arch/arm/mach-msm/msm_ipc_router_security.c
	arch/arm/mach-msm/msm_ipc_router_security.h
	drivers/power/pm8921-bms.c
Merge "Merge commit 'AU_LINUX_ANDROID_JB_2.5.04.02.02.40.234'"
Conflicts:
	drivers/power/pm8921-bms.c
Merge commit 'b07393e7f8869be287d7c98a1da638a97d2d2185' into HEAD
Merge "Merge commit 'b07393e7f8869be287d7c98a1da638a97d2d2185' into HEAD"