msm_serial_hs: Fix race condition with BAM rx pipe

Crash observed due to the race condition with bam
rx pipe during sps_disconnect and sps_transfer_one
operations executed at the same time on two CPUs.

Because of this race condition rx bam descriptor
pointer becomes NULL and accessing of this pointer
leads to crash.

This patch waits for sps_transfer_one function to
complete, if it is in progress, before calling
sps_disconnect function from the set_termios.

CRs-Fixed: 534029
Change-Id: I7581062a17a3dc7ede8eb58e4d25e3b517812ab2
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
msm: mdss: initialize pipe to NULL

Initialize the pipe pointer to NULL.
So that even if the selection of pipe from pipe-pool
fails, the function returns NULL instead of an
uninitialized value.

Change-Id: Ib04c0a983cba6ffe9532862bcaf516877e49746a
CRs-Fixed: 524466
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
ARM: dts: msm: Add CX regulator Phandle to MDP node

The Phandle might change for different
versions of the msm8974 chip. Add the Phandle
of CX regulator to only v2 version.

Change-Id: Ifce120fcb349360e36c4ea74bcaf5ea14e1dece5
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
msm: qdsp5: Update code to avoid access userspace data

Copy userspace data to kernel and then access the data
to avoid invalid pointer access issue.
Also, prevent use of uninitialized variables by checking
sscanf return value.

CRs-Fixed: 547923
Change-Id: Ic5426ca7a48f178fe1a47c5296ec93e8ce0bc793
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
power: qpnp-charger: update VBAT_WEAK register in qpnp charger probe

Currently weak battery voltage threshold(VBAT_WEAK) is getting
set in bootloaders and QPNP charger driver is not modifying
VBAT_WEAK during the probe. So set the VBAT_WEAK register
explicitly in the qpnp charger probe function, if a value
is specified for it in the charger device tree node.

CRs-Fixed: 520770
Change-Id: I054e9c2bf14a666f896faf3b4c8d2a6e2201b5fb
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
power: qpnp-charger: update QPNP_CHG_VINMIN_MASK of CHGR_VIN_MIN register

Currently QPNP_CHG_VINMIN_MASK is set to 0x1F instead 0x3F but
CHGR_VIN_MIN register supports 6bits value. So update the
QPNP_CHG_VINMIN_MASK from 0x1F to 0x3F.

CRs-Fixed: 547570
Change-Id: I42d8e7811ace0be5e78302846feff2851d6ded77
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
broadcast: move broadcast drivers to a new folder

Move TSPP driver and CI-Bridge driver from drivers/misc to
the same folder where TSPP2 driver is, for better consistency.
All broadcast-related drivers should reside in the same folder.

Change-Id: I2c808346f2d29b194ca8aab1c4b93d9403dc22c1
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>
bif: bif-core: do not read past the end of NVM when parsing BIF objects

Add a length check in the non-volatile memory (NVM) BIF object
parsing function so that it does not attempt to read past the
end of the NVM address space of the BIF slave.

Change-Id: Iafd40e61e7ca0bfa2e2be95c294a0e17d5cf515c
Signed-off-by: David Collins <collinsd@codeaurora.org>
qseecom: Verify shared buffer size

Valiade ION allocated shared buffer mapped in kernel space
is of same size as allocated in user space.

Change-Id: I4df11a9ce824756b7544377e0d944948838dfd54
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
qseecom:  Validate inputs from user space

Validate send_cmd, send_modfd_cmd and send_mdfd_resp
input parameters: cmd and response pointers and buffer
lengths and offsets  issued to modify data.

Change-Id: I381836d08aaa48357486fbdc6a122eb5b42bfa0b
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
ALSA: pcm: check for integer overflow during multiplication

Channel info data structure is parsed from userspace and if
user does not set the no. of channels correctly, it could lead
to security vulnerability if we don't check for overflow when the
no. of channels is multiplied with pcm bit width. Add a condition
to check for overflow during multiplication.

CRs-fixed: 537818
Change-Id: Ib9631b6e45d77b39be2c27343d4aee3e9244d8cc
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
msm: mdss: Prevent ALS data configuration when AD is disabled

If assertive display is disabled, backlight data structure is reset
to NULL, which in some conditons gets dereferenced or casuses
crash.

Change-Id: I535eac6d2f0aef222fc2846f80d72db1f3e3480d
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
msm: socinfo: Add MIDR value for MSM8962 in is_krait_v3

MSM8962 has a Krait pass 3 with MIDR 0x510F07F0. Add this
value to cpu_is_krait_v3() to support existing calls to
this API.

Change-Id: I491a586bec16b6460c9154bfe618380187dc0160
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
input: touchscreen: add multiple config data support for GT9xx

Goodix GT9xx touchscreen driver supports up to six groups of config
data and uses hardware GPIO configuration to select which one will
be used. This change allows these six config groups to be loaded
from devicetree.

Change-Id: I9dfd698e7084164688dd964ed914d5eecc75ecd3
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
defconfig: msm: 8610: Enable imx134 for 8610

Enable imx134 sensor driver compile for 8610.

Change-Id: Iccedadef1f8b782182f2c3cd697209d08ca28656
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
ARM: dts: msm: Increase max krait voltage for msm8974 Pro

Voltage plan has been updated with a higher maximal voltage.  Modify
corresponding voltages limits in DT to allow new voltage.

Change-Id: I85ff9037a9089589979cf157f3e852657444aeb1
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
ARM: dts: msm: Update PVS table for msm8974 Pro

Hardware voltage plan has been updated for msm8974 Pro.  Update PVS
tables to match latest voltage plan.

Change-Id: If38af0d53e3a9353b59de3fd44d65b9fe4b22db9
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
msm: emac: Add MDC/MDIO gpio resource handling

Update code to ensure exclusive access to MDC/MDIO gpio resources
when the ethernet interface is up.

Change-Id: I72af79ea3703e2dbd5b011a4c33632fd837a6c57
Signed-off-by: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
msm: emac: Multiple PHY support on MDIO bus

As multiple PHYs can be connected over MDIO bus, update driver
to use proper PHY address while accessing the MDIO bus.

Change-Id: I7375845d435336a18e475998e0a2db98dd04affc
Signed-off-by: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
msm: emac: Properly disable MDIO autopoll

Update driver to wait till mdio autopoll by HW is properly
disabled before initiating any mdio transaction to avoid any
race condition.

Change-Id: Ieb98277cbab14196cc599f69453e64728b53bf2f
Signed-off-by: Niranjana Vishwanathapura <nvishwan@codeaurora.org>