USB: mdm_bridge: Fix a possible freed memory access

When tethered rmnet/dun interface probe is failed, the bridge channel
platform device is removed in error path.  The gadget driver schedule
a work to open the bridge channel in probe.  Cancel this work in remove
before closing the channel.

Cancel any pending work while closing the bridge.  Otherwise there is
a possibility of rx work running in parallel with probe error path.  If
this happens, rx work access already freed memory.

CRs-Fixed: 442119
(cherry picked from commit 50f3815166483c654ebb325c49e50af4e31547da)

Change-Id: I78c2ee04cfd083248127cfd6b9f07994087729ca
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: ci13xxx_udc: Fix possible NULL pointer dereference

Don't access dev->platform_data before checking dev against NULL.

CRs-fixed: 440043
(cherry picked from commit bb4cd9eb06da6275256dee09a88c472b90d191a8)

Change-Id: I6270aef1cc364fac58be0d216e2255592306a28f
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: msm_otg: Increase data contact detection timeout

Battery charging specification allows data contact detection (DCD)
timeout to be any value between 300 and 900 msec.  As DCD is reliably
working, increase the timeout for detecting slow cable insertion cases.
DCD would fail with ACA-dock and ACA-A + HS/FS device.  Use 750 msec
as timeout.  The 150 msec (900 - 750) safe guard time compensates the
time taken from session valid to DCD enable.  Decrese the DCD polling
period from 100 msec to 50 msec to exit DCD state quickly.

The 150 msec safe guard time compensates the time taken from session valid
to starting charger detection procedure.

CRs-Fixed: 437484
(cherry picked from commit ebb4a2d613128a2db288402bc834622a36e71956)

Conflicts:

	drivers/usb/otg/msm_otg.c

Change-Id: I0e014d2ae0f9e00eaba179af2244924cf4561c90
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>

Conflicts:
	drivers/usb/otg/msm_otg.c
	include/linux/usb/msm_hsusb.h
USB: gadget: diag: Take spin lock while freeing requests

Freeing USB requests and retiring pending requests can happen in
parallel.  Take spin lock while freeing requests to prevent list
corruption.  Ensure all stale requests are freed before allocating
new requests upon next cable connection.

CRs-Fixed: 436769
(cherry picked from commit eb1ed0ec838f616677918974fa667ee0752e5bf3)

Change-Id: I162bfd72da7a205e80caf9ae53db12f0eb335388
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
msm:vidc: Initialize meta buffer header during secure session

Meta buffer header initialization is required if we process
extradata in secure playback.

Change-Id: Ic8a068e99351f2c970643200d03b1a580ead7480
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
usb: ks_bridge: Limit write size to 16KB

The user space application writes in 1MB chunks while loading MDM
images.  The current code allocate as many bytes as user space
passed to write system call.  These allocations are failing under
memory fragmentation scenario.  Hence limit write size to 16KB.

CRs-Fixed: 434638
(cherry picked from commit 7fcc7799af7ace4c4eda229b0eac6448f98d6637)

Conflicts:

	drivers/usb/misc/ks_bridge.c

Change-Id: I224cf201d724642f99e29874c4c5366ad773131e
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Merge "qseecom:Fix race condition while voting for clocks"
Merge "qseecom:  Add SFAB clock voting."
Merge "msm: camera: Update the bus vectors for 8x30 camera usecases."
tty: n_smux: Enable IPC logging for SMUX

Using the kernel log for SMUX logging requires users to enable
debug logging and then reproduce the issue.  Enabling all
logging often affects the timing and can make issues harder
to solve.

Add SMUX IPC Logging to enable internal logging that has a
minimum impact on performance and is always on to allow
debugging of an issue either from the command line or from
a memory dump.

CRs-Fixed: 384568
Change-Id: I6f1df407e07760206a7a548c9d3fce228e249155
Signed-off-by: Angshuman Sarkar <angshuman@codeaurora.org>

Conflicts:
	drivers/tty/n_smux.c
n_smux: add debugfs node for printing channel states

Add debugfs node that prints detailed state information
for all smux channels.

Change-Id: I727f1c53797ee317856056b8e4d9a8686940ce0f
Signed-off-by: Brent Hronik <bhronik@codeaurora.org>
Signed-off-by: Angshuman Sarkar <angshuman@codeaurora.org>
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
tty: n_smux: Add flow control state to overflow message

To aid in debugging, print the state of receive flow control if an
overflow condition occurs.

Change-Id: Ic425d8c3f58e22a99b746bc184a8bb62677a944e
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
tty: n_smux: Add function to determine if remote side is active

For subsystem restart unit tests, we need to know when the remote system
is back up to avoid having to add fixed delays.

Add private function to allow checking to see if the remote side is
active.

Change-Id: Ide2f5e4aba01479c2dc1e8c3b4332da7da6ad0c5
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
tty: n_smux: Log error messages to internal log

If an error occurs, log to both the kernel log and the internal SMUX log
to aid debugging.

Change-Id: I35f7a8e44401b6c16c0d05fd9ef3368158075b77
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
msm: rotator: clear rotator bus scale handler

rotator bus client will be not registered again without handler reset.

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

Conflicts:
	drivers/char/msm_rotator.c
msm: board-8930: Vote for higher bandwidth on 8930AB

The 8930AB clock plan supports DDR@600MHz. Update the graphics
bandwidth vote to use this higher frequency on 8930AB.

Change-Id: I8891ecdb202b335f8fe43a663616a4745167d252
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
(cherry picked from commit 4f3182e8bf55675d0a82c5bc87fcedb2f277e1d9)

Conflicts:
	arch/arm/mach-msm/board-8930-gpu.c
msm: smd: Add Interrupt ID to SMD DebugFS Interrupt Stats

Add support to display SMD,SMSM interrupt IDs
of each subsystem to interrupts stats debugfs entry

Change-Id: I1e8e045735a50da87f56d77785819f6e3ca1d460
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>