msm: vidc: ensure safe deletions of session instances

Session instance should acquire lock before
cleaning up the session.

Change-Id: I0e496579794291a8115286c9550c5028c7391d55
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
crypto: msm: Remove check for minor and step version

The only version that needs verifiation is major version to ensure
HW CE 5.0 is being used.  Minor and step versions checks are not
needed to gate driver loading.

Change-Id: I2052f511f3f2286da78a9c8d4ccf9803fbd6f204
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
ASoC: wcd9xxx: Fix codec type detection failure error handling

Changes fixes the error handling exit point when the codec
type is not found.

Change-Id: I2923dc16880fe312741188b360620ea924fe4ca3
CRs-fixed: 517978
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: vidc: Increase maximum buffer count limit

Some clients want to allocate more buffers on decoder
input port than required (mainly for performance reasons).
Video decoder should honor the client request as long as
V4L2 framework permits.

Change-Id: I1c5c90f18b723504d4287ee3fca3c427392c1129
CRs-fixed: 509088
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
msm: mdss: validate fb backlight inputs

Ensure backlight level is less than the max backlight
brightness and the backlight scaling factor is at most
1.

Change-Id: I424ed22af48ecae46371291fe88a114cf3fc7c31
CRs-Fixed: 516699
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
media: dvb: Protect against wrong meta-data size from SDMX

If secure demux reports wrong meta-data size, demux
might try and read data from meta-data FIFO beyond the
actual available number of meta-data bytes.

CRs-Fixed: 521561
Change-Id: Ifae6922f73128e90a663bace80d23cdb3bcff07b
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
platform: qpnp-power-on: Simulate press event

Status of the keys connected to the KPDPWR and RESIN lines
are identified by reading corresponding bits in RT status
register. If the state has been changed by the time interrupt
is delivered then the press event will be missed.

Maintain a state variable to find unbalanced release events
and simulate a press event.

Change-Id: I809c8166796e2436dbd203e4aa0c304d3d612226
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
msm: mpm-of: Bug fixes.

When traversing the hlist, the driver incorrectly checks for NULL of
list node instead of the loop cursor to return an mpm pin mapping. Fix
by checking the NULL value of the loop cursor before return the MPM pin
mapping.

Also, when the pin corresponds to a bypassed interrupt, there could
potentially be a out of bounds access on the msm_mpm_irqs_m2a array. Fix
by adding a check for Bypass interrupt value before updating the array
with a linux irq mapping.

Change-Id: Ie6bc201a443d1d038f3680af1cc64f5b32fb47a4
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
msm: camera: Prevent double free of memory if post event fails

In camera_v4l2_s_fmt_vid_cap_mplane(), if msm_post_event() fails, then
sp->vb2_q.drv_priv pointer will get kzfree()'d for a second time within
camera_v4l2_vb2_q_release(). So prevent this double free by setting
sp->vb2_q.drv_priv to NULL after it is kzfree()'d the first time.

CRs-fixed: 507075
Change-Id: I07532b98be795601aa543898f7ae6bc714d8a643
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
msm: kgsl: Add per-context performance counter sampling feature

Add global monitoring ability for GPU performance counters on every command
buffer submission.  This feature is used by user-space via debugfs files.

Change-Id: I428276e5d991ba8bb8b7bdf1fe59432086f05e5b
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
tty: serial: Use "no_log" readl/writel variants in hsl_read/write

hsl_read and hsl_write both directly call ioread32/iowrite32, which
leads to either a __raw_readl or __raw_writel call. These
readl/writel call are logged to the register trace buffer (RTB) by
default and generate a very large amount of output. This patch
directly calls __raw_readl_no_log and __raw_writel_no_log in
hsl_read and hsl_write to avoid logging these events to the RTB.

Change-Id: I9b3253996188f0642a4f6dedf449ec23fa1de05a
Signed-off-by: David Garibaldi <dgaribal@codeaurora.org>
USB: ehci-msm-hsic: Allow enabling only SUSPEND SOF workaround

There can be SOFs underway after suspending the port
(setting susp bit) which leads to phy lockup or unexpected
device disconnections on some platforms. Fix for this is to halt
the controller before setting port suspend bit to avoid such issues.
There are similar SOF related PHY issues for RESET and RESUME.
There already exists a platform_data or DT parameter:
'phy_sof_workaround' which enables all these SOF related workarounds.
But, some hardwares have RESET and RESUME SOF issues fixed but only
SUSPEND SOF issues is present. For these add pdata and DT parameter
to enable only SUSPEND SOF workaround.

CRs-fixed: 510136
Change-Id: I57d7fb11616e96b606f9f0c80bf3222fca27bb5d
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
ARM: dts: msm: Enable workaround for SUSP SOF HSIC issue on 8974

8974 HSIC has SUSPEND SOF hardware issue where HSIC may report
device disconnect after SUSPEND. Other SOF related issues on
HSIC for RESET and RESUME are fixed. Enable only the SUSP SOF
workaround.

CRs-fixed: 510136
Change-Id: I2f83c57a5845c811a233790e676a4b39cae87773
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
msm: kgsl: Wake up gpu on kgsl_ioctl_timestamp_event only if necessary

Any call of kgsl_ioctl_timestamp_event wakes up gpu. In some cases
(like retired timestamp) it's not necessary. Wake up gpu only if it's
necessary.

Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
Change-Id: I845faf6e9c6e4c9882a68489b64223919be3d21c
msm: clock-local2: Increase settling delays for CLKFLAG_RETAIN_*

8974v2.2, Pro, and future devices add small hardware delays between
powering on individual memory banks in an effort to minimize voltage
droops. Consequently, the memories will take slightly longer to enable
(200ns to 400ns, depending on the chip) than on earlier hardware.

Replace the current delay (achieved with dummy register accesses)
with an explicit 1us delay to support the newer chips.

Change-Id: Ib69812a50edf3f700e802057034f85a1bbcef43f
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
mdss: display: add mdp core clock to dsi clock control

Since mdss interrupts are generated in mdp core clock domain,
mdp clock need to be enabled to have dsi interrupt be delivered
during dsi dcs command send and receive. Request of bus bandwidth
also needed to allow dsi controller to fetch dcs commands over
AXI bus.

CRs-fixed: 516172
Change-Id: I6e10cc5a193c9eb06803637e0432ec72f069377b
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
mm-audio: aud_acdb_util: Fix ADM custom topology

When AANC was added an enum was changed that affected ADM
custom topology and TX audproc vol cal. If ADM custom
topology was used the memmap handle for TX audproc volume
would be overwritten. This fixes that logic.

Change-Id: I8c0a13d0a3c0359537508b7ca9a34faf8cd267b4
CRs-fixed: 515406
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
msm8974: mhl: enable tmds stream on powered dongle

Enable TMDS stream and MHL-HPD only when MHL TX is connected
to a powered dongle. This information is read from the sink/dongle's
device capability bytes. The MHL Tx prevents outgoing TMDS stream
on an unpowered dongle which saves power drainage.
On connection to an unpowered dongle during the initial discovery
rgnd discovery reports "MHL", subsequently, "uUSB" is reported. Set
HPD/TMDS low at this point without handing over the control to
USB driver. This enables detection of interrupts in MHL driver
but prevents TMDS signals from being sent to the sink.

Change-Id: I5f13880caff7fe852952b55763d53224e3146ebd
CRs-Fixed: 494771
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
wcnss: Add PLL status register to register dump list

When a WDI timeout or Watchdog bite happens at WCNSS, log certain WCNSS
register before SSR. Dumping these registers before performing the reset
helps to debug the root cause of the timeout or bite. Add PLL status to
the register dump, recently we have seen WCNSS reset failures becuase
of PLL lock issues.

Change-Id: I7557a46260e6dbd888b4bb1191442fda0bc3c986
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
wcnss:  Add WMAC registers to register dump list

When a WDI timeout or Watchdog bite happens at WCNSS, certain WCNSS
registers are logged for debug purpose. Add WLAN domain registers
TXP PHY aborts and MCU WLAN bridge error timeout registers to this
list. This is helpful for debugging the A2XB split timeout issues.

Change-Id: I13dd21b35de784f2bab200c1ae0dd4f4c10ebad0
CRs-Fixed: 515142
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>