msm: camera: Add null checks for stats module

Add null checks in stats driver before accessing the
data structures to avoid null pointer crash.

Change-Id: I87639848e94e69e3fa020344f936e7cc182e2c66
Signed-off-by: Nishant Pandit <npandit@codeaurora.org>
ASoC: msm: Fix wrong wait_event_timeout timeout checks

wait_event_timeout returns zero when there is a timeout.
Change fixes the condition check to handle timeouts.

Change-Id: I01184cce0c98a82bb205023b07dd4dd2d91b42ad
CRs-Fixed: 487821
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
msm_fb: hdmi: Proper intialization of mhl resolutions

This change adds missing video format intialization

CRs-Fixed: 481049
Change-Id: Ic14eaba7fefcb8b7f9240cae8c179e3dbeef72a5
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: kgsl: Protect the mem_entry list during deletion

Use the spinlock to prevent corruption of the mem_entry list during
deletion. Otherwise the mem_entry list may be modified by another
thread at the same time resulting in memory corruption.

Change-Id: I5728a8b925753d5fda82413615e5ebaf0366dfd8
CRs-fixed: 489224
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
msm: kgsl: Submit a draw command on resume

For A305, submit an extra draw command while resuming the GPU from
SLUMBER state. This fixes corruption seen when the screen is
turned on.

Change-Id: Iafed90b617b0a700ac3f2afcb6d9ecadca590914
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
msm: vidc: Allow client to set turbo mode

- Allow client to set TURBO performance level
  to video driver.
- Update max performance level to TURBO perf level
  on supported targets.

Change-Id: I0b3b38140d777984ba5062ddd614c07a002389ba
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
ci13xxx_udc: Acquire spinlock before calling ep_nuke()

The commit b0ad433 (USB: ci13xxx_udc: Fix kernel panic during
composition switch) adds ep_nuke() function in gadget_stop_activity().

_ep_nuke() releases and re-acquires spinlock on every entry of the
function. Acquiring spinlock before calling _ep_nuke() is necessary,
else it may end up in unlocking the lock twice, as it is already
unlocked before calling _ep_nuke(), which may lead to crash.

Hence, acquire spinlocks before calling _ep_nuke() function.

CRs-Fixed: 486502
Change-Id: Ia80b9facb8e592f8fb41879dc08f9f1a04a20b48
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
media: dvb: Protect against removing all PIDs from an active filter

When TS filter is active (running), it is not allowed to remove
all PIDs associated with the filter; The filter state would be
invalid and as such may result in unexpected behavior while
performing runtime operations on the filter.

CRs-Fixed: 492444
Change-Id: I340b02bed218e89ffe89932e3b3e9ea93f429876
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
USB: ci13xxx_udc:  Retire pending requests while flushing an endpoint

Rmnet and dun function drivers are designed to start fresh upon MODEM
restart.  The current code is flushing endpoints without freeing
requests.  New requests are allocated again after MODEM is powered up.
All accumulated requests are freed only upon cable disconnect.  If
MODEM is restarted multiple times without disconnecting the cable, we
are running low memory issues.

A pending request can not be freed without dequeuing it.  Dequeuing
all requests in a loop is a heavy operation and involves changing
multiple function drivers.  All pending requests are retired upon
disabling an endpoint.  But an endpoint can not be disabled in
configured state.  Hence retire pending requests while flushing an
endpoint.

CRs-Fixed: 489047
Change-Id: I3440a204ad8c4beb043b1068cb1d3965be96e9b7
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Merge "msm_fb: hdmi: Proper intialization of mhl resolutions"
Merge "msm: kgsl: Submit a draw command on resume"
Merge "media: dvb: Protect against removing all PIDs from an active filter"
Merge "ci13xxx_udc: Acquire spinlock before calling ep_nuke()"
msm: 8064: Add connector resistance

The adjust vdd max algorithm in the charger driver needs connector
resistance to set the battery voltage appropriately.

Set the connector resistance value from the board file.

Change-Id: If934783e2910c8456090c8926e934138abb75222
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
Merge "msm: kgsl: Protect the mem_entry list during deletion"
gpu: ion: Do fallback when allocating large sizes

The preferred allocation of memory for kernel data structures in
ION is to use kmalloc. This is mainly for performance reasons. However,
we are not guaranteed to be able to allocate large sizes. So to keep
the code performing well and at the same time allow for larger allocations,
implement a fallback mechanism for allocation of memory for ION kernel data
structures.

CRs-Fixed: 488521
Change-Id: I8c6a13ad74cce69f590920d28c01a58f7a540fd2
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
[Resolved merge conflict]
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
u_ether: Handle memory allocation failure case on tx path

With multipacket feature enabled, if the memory allocation for
tx request buffer fails, accessing the req->buf leads to null pointer
dereference crash.

Hence, handle memory alloction failure case and return -ENOMEM.

CRs-Fixed: 490085
Change-Id: Ic5faac8ea7eb056755b03007c48ff085f10afa20
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
Merge "ASoC: msm: Fix wrong wait_event_timeout timeout checks"
Merge "msm: 8064: Add connector resistance"
Merge "gpu: ion: Do fallback when allocating large sizes"