OSDN Git Service

sagit-ice-cold/kernel_xiaomi_msm8998.git
8 years agodefconfig: arm64: Enable FP settings for msm8996
Sarangdhar Joshi [Sat, 19 Dec 2015 02:13:16 +0000 (18:13 -0800)]
defconfig: arm64: Enable FP settings for msm8996

Enable FP(Floating Point) and SIMD settings required
during execution of AArch32 processes.

CRs-Fixed: 952837
Change-Id: I71c9294a59053aad2abfd359f9d3035cf493307a
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
8 years agoarm64: fpsimd: Enable FP(floating-point) settings for msm8996
Se Wang (Patrick) Oh [Sat, 17 Oct 2015 07:57:45 +0000 (00:57 -0700)]
arm64: fpsimd: Enable FP(floating-point) settings for msm8996

Enable FP and SIMD settings for the MSM8996 during the execution
of the AArch32 processes and disable these settings when you switch
to the AArch64 processes.

This commit also adds CONFIG_ENABLE_FP_SIMD_SETTINGS to support
FP and SIMD settings.

CRs-Fixed: 952837
Change-Id: If9537ca7390d8f08a6b48fb8865d1b349a93bcee
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
8 years agoASoC: wcd-mbhc: initialize boolean flag anc_mic_found
Laxminath Kasam [Mon, 21 Dec 2015 10:41:58 +0000 (16:11 +0530)]
ASoC: wcd-mbhc: initialize boolean flag anc_mic_found

As anc_mic_found is not initialized, it is taking
input as true and report as ANC Headphone results
in wrong accessory detection. Initialize the flag
to false that fixes the issue.

Change-Id: I1c9912e2ab396a8a0a31065b826d6f92a0603215
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
8 years agocnss: Recover PCIe configuration space during normal WLAN recovery
Yue Ma [Fri, 11 Dec 2015 03:08:18 +0000 (19:08 -0800)]
cnss: Recover PCIe configuration space during normal WLAN recovery

During normal SSR there is a corner case that somehow WLAN driver fails to
read PCIe configuration space which can result corruption when it tries to
save it. Hence recover PCIe configuration space from shadow registers as
well in normal SSR. This is same as the recovery for real PCIe link down.

Change-Id: I2bae0f2e322829a9689d3a129145b54c079dccdf
CRs-fixed: 886245
Signed-off-by: Yue Ma <yuem@codeaurora.org>
8 years agomsm: ultrasound: USF stays awake after each event
Phani Kumar Uppalapati [Fri, 11 Dec 2015 00:51:31 +0000 (16:51 -0800)]
msm: ultrasound: USF stays awake after each event

Give upper layers enough time to turn on screen before
falling back into SUSPEND.

Change-Id: I162f25dffdbbeb783d0bca673d6e6db8de412aac
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
8 years agoRevert "ARM: dts: msm: remove sync-wait-broadcast from jdi panel"
Veera Sundaram Sankaran [Fri, 18 Dec 2015 23:31:52 +0000 (15:31 -0800)]
Revert "ARM: dts: msm: remove sync-wait-broadcast from jdi panel"

This reverts commit c9b3e1ebbeb726a911ac6cf67f9a6386f7fb79ae ("ARM: dts:
msm: remove sync-wait-broadcast from jdi panel"). Sync-wait-broadcast
flag was removed for JDI dual dsi cmd mode panel as there were fps issues
when used along with partial updates which is currently fixed. The flag
is required for mode switch as sending the switch commands individually
during cmd-to-video switch causes flicker issues. Revert this change
to add the flag back as it is needed for mode switch.

Change-Id: I5b86d293aea7905b115621df1eab3e6f8aece966
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
8 years agomsm: ep_pcie: add the support of MDM2AP GPIO
Yan He [Tue, 15 Dec 2015 19:24:46 +0000 (11:24 -0800)]
msm: ep_pcie: add the support of MDM2AP GPIO

Add the support of MDM2AP GPIO so that MDM can notify AP about
updated status.

Change-Id: Ia5a020898d4d04dcd4fec6b3928aba380663ac56
Signed-off-by: Yan He <yanhe@codeaurora.org>
8 years agomsm: ep_pcie: support both PARF based MSI and iATU based MSI
Yan He [Fri, 18 Dec 2015 19:14:56 +0000 (11:14 -0800)]
msm: ep_pcie: support both PARF based MSI and iATU based MSI

Add the support to generate both PCIe PARF based MSI generation
and iATU based address write MSI generation for unit test.

Change-Id: I8c5abf8dcae4ebf2c33fee182f6bc147979f74dd
Signed-off-by: Yan He <yanhe@codeaurora.org>
8 years agoslim: msm: Return success for ch-remove type of messages during SSR
Sagar Dharia [Thu, 17 Dec 2015 23:38:37 +0000 (16:38 -0700)]
slim: msm: Return success for ch-remove type of messages during SSR

During SSR, all channels are removed and ports are disconnected since
slimbus HW is not functional. Return success to clients for such
calls so that client can mark channel/port state constistent with HW

Change-Id: I9b18f8e7ffe233090c9612d0811a7d36645d0329
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
8 years agoARM: dts: msm: add HDMI support for msm8996 Fluid
Bruce Levy [Tue, 10 Nov 2015 22:07:15 +0000 (14:07 -0800)]
ARM: dts: msm: add HDMI support for msm8996 Fluid

Add appropriate entries to support HDMI
on msm8996 Fluid.

Change-Id: I2000744eb0cb3d6d5c402d17a05f55ff55c43707
Signed-off-by: Bruce Levy <blevy@codeaurora.org>
8 years agoi2c-msm-v2: decrease runtime pm time to 250msec
Gilad Avidov [Mon, 14 Dec 2015 16:59:18 +0000 (09:59 -0700)]
i2c-msm-v2: decrease runtime pm time to 250msec

Runtime-pm autosuspend delay is set to 1 second. This
long period is used to avoid thrashing due to long time
it takes for bus-pm voting. The period is reduced to a
quarter to optimize power. This number is tested for
trade-off between power and performance.

Change-Id: I973495e23852f1caefb981b1d8f26da5f09ca7bc
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
8 years agoASoC: wcd9335: Fix internal clock enable during SSR
Bhalchandra Gajare [Fri, 18 Dec 2015 03:59:53 +0000 (19:59 -0800)]
ASoC: wcd9335: Fix internal clock enable during SSR

After subsystem restart is completed, driver will try to restore the
internal clock state to state before subsystem restart. In some cases,
it is possible that the internal clock state is not restored properly.
This causes the internal clock to be off when it is expected to be
turned on. Fix this issue by making sure the clock states are restored
correctly post subsystem restart.

CRs-fixed: 948899
Change-Id: I0084287b2d3b62c7498bae423952e64dd0d6e0f4
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
8 years agomsm: ep_pcie: enable BME IRQ
Yan He [Fri, 18 Dec 2015 19:06:33 +0000 (11:06 -0800)]
msm: ep_pcie: enable BME IRQ

Configure PCIe debug register to enable IRQ for BME.

Change-Id: I497d86fcdbe862d770b9e7841dabd023cfe6d1f8
Signed-off-by: Yan He <yanhe@codeaurora.org>
8 years agomsm: ep_pcie: set up execution environment before link up
Yan He [Tue, 8 Dec 2015 02:20:35 +0000 (18:20 -0800)]
msm: ep_pcie: set up execution environment before link up

Set up the execution environment before PCIe link training to
provide better adaptability to various hosts.

Change-Id: I72721d3b88a7e5b1a0a1f408da2228391559468e
Signed-off-by: Yan He <yanhe@codeaurora.org>
8 years agomsm: ep_pcie: update MSI address for PCIe clients
Yan He [Sat, 5 Dec 2015 02:29:36 +0000 (18:29 -0800)]
msm: ep_pcie: update MSI address for PCIe clients

The PCIe clients will utilize the original MSI address instead of
mapped local address when active config is enabled. The change here
provides the original address to the clients.

Change-Id: I0d35fa9508d7c3ec2e97bd7d61754974e798bf8a
Signed-off-by: Yan He <yanhe@codeaurora.org>
8 years agoASoC: wsa881x-analog: fix shutdown of wsa during playback
Laxminath Kasam [Fri, 18 Dec 2015 08:27:27 +0000 (13:57 +0530)]
ASoC: wsa881x-analog: fix shutdown of wsa during playback

Enable count of WSA startup/shutdown is not handled.
Add counter to handle the startup and shutdown properly.

Change-Id: I8c46fdd900c51d3e8d766b824f17996919779ba9
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
8 years agoARM: dts: msm: Add WLAN antenna switch regulator for MSM8996
Yue Ma [Fri, 18 Dec 2015 01:45:33 +0000 (17:45 -0800)]
ARM: dts: msm: Add WLAN antenna switch regulator for MSM8996

Explicitly vote for the regulator for WLAN antenna switch in order to
enable WLAN antenna sharing capacity in MSM8996.

Change-Id: Ibe06f33477f05ec860829f6a2de6fc23558bf4b8
Signed-off-by: Yue Ma <yuem@codeaurora.org>
8 years agoARM: dts: msm: add PM8994 LDO 18 pin control regulator for msm8996
David Collins [Thu, 17 Dec 2015 22:19:05 +0000 (14:19 -0800)]
ARM: dts: msm: add PM8994 LDO 18 pin control regulator for msm8996

Add a PM8994 LDO 18 regulator device which can be used to manage
the HW_EN2 pin control enable configuration for LDO 18 at
runtime.  When this regulator is enabled, LDO 18 output is
enabled whenever HW_EN2 (i.e. PM8994 GPIO 11) is driven high.
When this regulator is disabled, the state of GPIO 11 is ignored.

This regulator can be used to support WLAN antenna sharing where
the WLAN chip is connected to GPIO 11 and drives it high whenever
RX or TX is active.

Also update the voltage constraint range to allow values from
2.7 V to 2.9 V.

Change-Id: I7afab38356e6619580539ed05b5130553491b100
Signed-off-by: David Collins <collinsd@codeaurora.org>
8 years agomsm: camera: CSI PHY setting update
Xu Han [Tue, 17 Nov 2015 01:12:02 +0000 (17:12 -0800)]
msm: camera: CSI PHY setting update

CSI PHY setting is updated for maximum timing margin to
support high data rate up to 2.5Gbps/lane.

Change-Id: I165a5bc4467da83dda26deb56af16cbe64902515
Signed-off-by: Xu Han <hanxu@codeaurora.org>
8 years agomsm: kgsl: Account for throttled clock cycles in DCVS
Oleg Perelet [Tue, 8 Dec 2015 17:43:45 +0000 (09:43 -0800)]
msm: kgsl: Account for throttled clock cycles in DCVS

Limits management can force clock throttling which results in incorrect
busy percentage calculation. We need to account for that in DCVS.

Change-Id: Iaa17a7f7d661ab9966597f7710374d5b2e00d514
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
8 years agoASoC: msm-lsm-client: free lsm client data in msm_lsm_close
Vidyakumar Athota [Wed, 16 Dec 2015 23:42:39 +0000 (15:42 -0800)]
ASoC: msm-lsm-client: free lsm client data in msm_lsm_close

Currently lsm client data is deallocated when q6lsm_open() fails
which can cause memory corruption if lsm client data is accessed
after freed. Fix this issue by deallocating the client data only
in msm_lsm_close().

Change-Id: If048c26a0ffd8a346a28622183cbf2ba1e7e5ff3
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
8 years agonetfilter: nf_conntrack_sip: Dynamically enable/disable SIP ALG
Ravinder Konka [Mon, 13 Oct 2014 06:36:59 +0000 (12:06 +0530)]
netfilter: nf_conntrack_sip: Dynamically enable/disable SIP ALG

When SIP ALG is disabled, SIP packet should not be parsed by
SIP ALG module. Make change to Check nf_ct_disable_sip_alg flag
before parsing the SIP packet to bypass SIP ALG processing
when SIP ALG is disabled.

Change-Id: I863c93f418b694bc0e9101c31d2da12e761091a6
Signed-off-by: Ravinder Konka <rkonka@codeaurora.org>
8 years agoARM: dts: msm: add dba property to adv panels
Sandeep Panda [Thu, 17 Dec 2015 05:48:11 +0000 (11:18 +0530)]
ARM: dts: msm: add dba property to adv panels

ADV7533 chip is used as DBA (Display Bridge Abstraction)
in MDSS driver. So adding the dba property to panel dt files.

Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
Change-Id: Ideda14930a9025b105880021440fd84baf3343c3

8 years agoARM: dts: msm: remove backlight control type from adv panel
Sandeep Panda [Thu, 19 Nov 2015 16:34:27 +0000 (22:04 +0530)]
ARM: dts: msm: remove backlight control type from adv panel

ADV7533 is a DSI to HDMI bridge chip, it does not need any backlight
control to be defined. So removing this property from panel dt files.

Change-Id: I3ca7290ce324d9385da8b13d9c141de0730d8535
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agoARM: dts: msm: Set camera config for 8996 mojave platform
Terence Ho [Thu, 10 Dec 2015 19:21:57 +0000 (14:21 -0500)]
ARM: dts: msm: Set camera config for 8996 mojave platform

Configure csi0 camera to use cci master 1 to reflect
hardware on 8996 mojave automotive plaftorm.

Change-Id: I38d2a8499e6f1916aad7dfbc36d03e36a8fbd47b
Signed-off-by: Terence Ho <terenceh@codeaurora.org>
8 years agoARM: dts: msm: disallow use of VDD_GFX CPR retention corner for msm8996
David Collins [Tue, 15 Dec 2015 18:57:39 +0000 (10:57 -0800)]
ARM: dts: msm: disallow use of VDD_GFX CPR retention corner for msm8996

Disallow use of the 400 mV VDD_GFX CPR retention corner since it
has been found that 400 mV is not a sufficiently high retention
voltage across all parts.  Additionally, no power benefits have
been found when using the retention state during graphics
hardware operation.  Also, there is a minor performance penalty
when the retention corner is allowed as software reconfigures
the VDD_GFX supply to the retention voltage during GPU power
collapse and resume before transitioning to an active voltage.

Change-Id: I374d7620373d7fea17818009bec3d171a6072cdc
Signed-off-by: David Collins <collinsd@codeaurora.org>
8 years agoclk: msm: Add support to control MEM_PERPIH_OFF bit of branch clock
Devesh Jhunjhunwala [Fri, 18 Dec 2015 00:57:48 +0000 (16:57 -0800)]
clk: msm: Add support to control MEM_PERPIH_OFF bit of branch clock

Update cbcr_set_flags method to add support for controlling the
MEM_PERPIH_OFF bit for branch clocks.

Change-Id: I87451b02cb9000dc850fdfaa52a5a9f9fd2893a1
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
8 years agosoc: qcom: glink: Signal the waiter for rx_intent ack under error
Karthikeyan Ramasubramanian [Sat, 12 Dec 2015 01:58:06 +0000 (18:58 -0700)]
soc: qcom: glink: Signal the waiter for rx_intent ack under error

During subsystem restart, if a transmit operation is waiting for a remote
receive intent acknowledgment, signal the waiter that the receive intent
request will not be acknowledged. Also check the transport and channel
state before waiting for the acknowledgment. This will prevent the
transmit operation from blocking indefinitely under error scenario.

CRs-Fixed: 952184
Change-Id: I29b8215841f7dcca52137f451665eaf339a6f78e
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
8 years agoASoC: wcd_cpe_core: Perform irq cleanup once the bus is up
Bhalchandra Gajare [Tue, 15 Dec 2015 23:28:24 +0000 (15:28 -0800)]
ASoC: wcd_cpe_core: Perform irq cleanup once the bus is up

During subsystem restart, it is possible that while the underlying bus
is down, the irq driver has already performed its cleanup. In such case,
when CPE driver requests to cleanup its own irq, the irq driver attempts
to hold an lock that is already freed. Fix this issue by performing the
CPE driver irq cleanup after bus is up rather than when bus is down.

CRs-fixed: 948899
Change-Id: I2772e89bbdc855baa9fcf7a34a9c16f2f5c05c32
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
8 years agonet: tcp: check for SOCK_DEAD again in tcp_nuke_addr
Lorenzo Colitti [Mon, 9 Nov 2015 13:36:10 +0000 (22:36 +0900)]
net: tcp: check for SOCK_DEAD again in tcp_nuke_addr

Liping Zhang spotted a race between tcp_nuke_addr and tcp_close
that can cause a crash. If a userspace process calls tcp_close
on a socket at the same time that tcp_nuke_addr is closing it,
and tcp_close wins the race to call lock_sock, it will call
sock_orphan before releasing the lock. sock_orphan sets the
SOCK_DEAD flag on the socket and proceeds to close it, eventually
calling inet_csk_destroy_sock. When tcp_nuke_addr gets the socket
lock, it calls tcp_done. But if tcp_done sees the SOCK_DEAD flag,
it calls inet_csk_destroy_sock as well, resulting in a double
free.

Fix this by checking for SOCK_DEAD again after lock_sock
succeeds. Eric had already pointed out that this could be a
problem in b/23663111, so there was already a TODO in the code
for this.

Change-Id: I0c87c3fd0598384d957b69734366bd4e2fd7e8d7
Git-commit: 61469ddc534f255c709349a1a611216ecd07e13d
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
8 years agoFix NULL pointer dereference in tcp_nuke_addr.
Lorenzo Colitti [Mon, 14 Sep 2015 15:14:23 +0000 (00:14 +0900)]
Fix NULL pointer dereference in tcp_nuke_addr.

tcp_nuke addr only grabs the bottom half socket lock, but not the
userspace socket lock. This allows a userspace program to call
close() while the socket is running, which causes a NULL pointer
dereference in inet_put_port.

Bug: 23663111
Bug: 24072792
Change-Id: Iecb63af68c2db4764c74785153d1c9054f76b94f
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Git-commit: 74d66ee756afcc3269e4c1341f793c52be629af9
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
8 years agomsm: camera: isp: fix error report id mask
Peter Liu [Wed, 9 Dec 2015 05:00:00 +0000 (21:00 -0800)]
msm: camera: isp: fix error report id mask

Stream id mask need more than 8 bit,
thus increase bit width for error reporting.

Change-Id: I308a9d3df6024768b07ec49562f3241707566e2a
Signed-off-by: Peter Liu <pingchie@codeaurora.org>
8 years agoASoC: msm: send gain info for all channels mask
vivek mehta [Wed, 16 Dec 2015 01:22:32 +0000 (17:22 -0800)]
ASoC: msm: send gain info for all channels mask

- currently gain is added for only number of channels and clip
  channel count is send to dsp.
- but it is possible that channel mask that driver has is different
  than what dsp discovers after decoding the codec config data
- volume will not be applied to channels that differ between driver
  and dsp and device volume will not apply on these channels
- change is to control multi-channel volume using master gain

Change-Id: Icd8ca4e935d9095dd9ef8b65eff34629326fb563
Signed-off-by: vivek mehta <mvivek@codeaurora.org>
8 years agoASoC: msm: qdsp6v2: Move asm list init before apr registration
Ben Romberger [Sat, 12 Dec 2015 04:24:57 +0000 (20:24 -0800)]
ASoC: msm: qdsp6v2: Move asm list init before apr registration

Move list init for no wait que before apr registration.
If apr registration fails asm free client will free
the no wait que.

Change-Id: I4707dbf4771a1ec313898adb2284c06ef1fb5b3a
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
8 years agomsm: camera: Fix to enable RDI2
Terence Ho [Thu, 10 Dec 2015 15:54:47 +0000 (10:54 -0500)]
msm: camera: Fix to enable RDI2

Fix incorrect comparison that prevented RDI2 from being enabled.

Change-Id: I4f18a290237f074b6a095d33dcd8429f90c8a1d5
Signed-off-by: Terence Ho <terenceh@codeaurora.org>
8 years agomsm: limits: Add support to handle data greater than PAGE_SIZE
Ram Chandrasekar [Tue, 27 Oct 2015 23:32:09 +0000 (17:32 -0600)]
msm: limits: Add support to handle data greater than PAGE_SIZE

Debug data read was not handling the buffer overflow case when
the data to write is greater than PAGE_SIZE. This resulted in
calling the hardware for new data multiple times.

Returning success when buffer overflowed will cause the sequence
traverse function to call again with a new buffer with increased
size. This process will go on until the buffer size is big enough
to hold the data. But limits data read function couldn't distinguish
if the call is a retry or a new call and will initiate a new data
fetch from hardware and re-populate with new data.

Modify debug read interface to immediately return success when
overflow happens. The debug read function now can distinguish between
a sequence retry call by retaining the data buffer in a static if
overflow happens. When called again, debug read now will avoid
calling the hardware for new data and instead will populate the new
sequence buffer with the previously fetched data.

Change-Id: Icc0eb035047ab734d2eb5366cade4ec187747379
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agomsm: lmh_lite: Remove primary interrupt handler
Ram Chandrasekar [Tue, 29 Sep 2015 18:19:01 +0000 (12:19 -0600)]
msm: lmh_lite: Remove primary interrupt handler

The primary interrupt handler disables the lmh interrupt. But
this is already taken care by IRQF_ONESHOT flag. Remove
the primary interrupt handler and disable the interrupt in the
interrupt thread function.

Change-Id: I6c607e0cdef09ffe4f758f9498ee6241d099ee26
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agomsm: limits: update the snprintf error handling
Ram Chandrasekar [Tue, 8 Sep 2015 21:38:48 +0000 (15:38 -0600)]
msm: limits: update the snprintf error handling

Update the snprintf() error handling in the
available_level_get() function to look for proper error
return value and take appropriate action.

Change-Id: Ifbe6450693a282105d9fddd02a756ae53d8cd892
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agomsm: lmh_lite: Fix configurability for LMH software polling
Ram Chandrasekar [Fri, 4 Sep 2015 21:30:05 +0000 (15:30 -0600)]
msm: lmh_lite: Fix configurability for LMH software polling

Update the lmh hardware driver to get the polling interval
value from the lmh interface driver, instead of using a local
static variable.

LMH interface driver already exposes debug interface to
configure the interval value.

Change-Id: Ie7d91519f197930ca513b30a671d8f6917d636b0
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agomsm: ipa3: Configure IPA RX HPS resources distribution
Ghanim Fodi [Sun, 13 Dec 2015 16:00:35 +0000 (18:00 +0200)]
msm: ipa3: Configure IPA RX HPS resources distribution

IPA RX HPS command queue resources need to be distributed
among the different resource groups (e.g. Uplink group).
The configuration is the maximum and minimum number of
resources that can be used by each group.

Change-Id: I02cf831b6ea6da812b67624fbb48bb829e4684d3
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
8 years agomsm: kgsl: Fix direct references to HZ
Suman Tatiraju [Tue, 15 Dec 2015 14:49:41 +0000 (07:49 -0700)]
msm: kgsl: Fix direct references to HZ

Make the various timeout values HZ agnostic by using the proper
macros and values instead.

Change-Id: I708cd491f593782f0172cd7d2cca058cd41044a5
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
8 years agodefconfig: msm: Enable APSS_CORE_EA config for ARM32 and ARM64 systems
Maulik Shah [Tue, 15 Dec 2015 09:11:37 +0000 (14:41 +0530)]
defconfig: msm: Enable APSS_CORE_EA config for ARM32 and ARM64 systems

Enable energy-awareness driver for msmtitanium.

Change-Id: I875fe8c4ae5d84a6ac8311bcc64eca509d689b16
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
8 years agodma-mapping: Check for valid IOVA address
Susheel Khiani [Tue, 15 Dec 2015 11:17:56 +0000 (16:47 +0530)]
dma-mapping: Check for valid IOVA address

We might fail in alloc_iova if we run out
of virtual addresses in pool. Currently,
if we fail in alloc_iova we are not checking
for return value and directly going ahead
and mapping invalid IOVA address. Fix this
by explicitly checking for return value
from alloc_iova.

Change-Id: I7681d13b75f47a86f0b0b6cbf4b8405a7528ff66
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
8 years agonet: wireless: decouple cnss crypto from cnss memory pre-alloc
Sarada Prasanna Garnayak [Thu, 10 Dec 2015 11:35:06 +0000 (17:05 +0530)]
net: wireless: decouple cnss crypto from cnss memory pre-alloc

The cnss crypto add support for wlan host driver for security
Protocol and cipher key generation where cnss memory pre-alloc
feature enable wlan driver to use pre allocated memory
for its internal usage and release it to back to pre-allocated pool.

Decouple cnss crypto from cnss memory pre-alloc and add kernel
config flag for this  crypto module compilation and update
the defocnfig of required targets.

CRs-Fixed: 949992
Change-Id: If34819fd76076ba522a9a42ac41fdae1f541f5c8
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
8 years agomm: zcache: clear zcache when low on file pages
Vinayak Menon [Tue, 1 Sep 2015 09:39:35 +0000 (15:09 +0530)]
mm: zcache: clear zcache when low on file pages

When files pages are very low, it is better to clear off
zcache pages, since the freed memory can be used to sustain
an application in foreground. Moreover when file pages
are too low, we don't gain much by holding a few zcache
pages.

Change-Id: I88dd295d24b7de18fb3bc0788e0baeb6bfdb2f6d
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: add zero page support
Vinayak Menon [Mon, 13 Jul 2015 08:44:06 +0000 (14:14 +0530)]
mm: zcache: add zero page support

zero pages need not be compressed and stored unnecessarily.
Rather insert a special handle to the radix tree to identify
a zero page.

Change-Id: Ic92321c4753401a90d69a6e8c61b5119168c9df7
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agoradix-tree: add radix_tree_gang_lookup_index
Vinayak Menon [Mon, 20 Jul 2015 05:23:19 +0000 (10:53 +0530)]
radix-tree: add radix_tree_gang_lookup_index

Add radix_tree_gang_lookup_index to get the radix tree
indices along with the pointers. This will be  helpful,
for e.g. if a radix_tree_delete has to be performed
depending on one of the result values.

Change-Id: Iab83d027968462aa30da5341fa3f60134b6c1137
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: do not wake up kswapd for zcache allocs
Vinayak Menon [Fri, 7 Aug 2015 07:27:14 +0000 (12:57 +0530)]
mm: zcache: do not wake up kswapd for zcache allocs

zcache allocations happen during reclaim of pages,
and waking up kswapd at this time hinders system
performance. During tests it was seen that without
this patch, there were a lot of kswapd wakeups and
was resulting in bad launches.

Change-Id: Ic0f0240b8fdad6b3fe142b2bdc0366cfd870635e
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: fix accouting of pool pages
Vinayak Menon [Fri, 7 Aug 2015 07:14:48 +0000 (12:44 +0530)]
mm: zcache: fix accouting of pool pages

zcache_pool_pages is supposed to store the total
pages in all the pools used by zcache. But at
present zcache_pool_pages is assigned pages of any
particular pool on a load, store or any operation
which modifies the pool size. And this is more
important for external clients which depend on zcache
pool size, like the lowmemorykiller.

Change-Id: Ifdaab8646c40f1fec71dfa5903658fbdc6b3cce5
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: shrink zcache on memory pressure
Vinayak Menon [Thu, 16 Jul 2015 11:46:46 +0000 (17:16 +0530)]
mm: zcache: shrink zcache on memory pressure

When file pages drops down, at a point zcache pages
can be more than the file pages, and even further when
we have to reclaim the maximum number of file pages
possible to launch an application, we need a way to
reclaim even the zcache pages at least to an extend
which makes it match with the number of file pages.
This can help in better foreground headroom.

Change-Id: I481bfb9961ed5cee47ebeae08eb910bb269b644c
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: disallow sleep in zcache store
Vinayak Menon [Thu, 25 Jun 2015 08:32:07 +0000 (14:02 +0530)]
mm: zcache: disallow sleep in zcache store

zcache store ops cannot sleep since it is called from
an atomic context. Pass the right flags to alloc functions.

Change-Id: I9c7956e895fb7909932315aa3d85845127aa02e1
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: add evict zpages supporting
Bob Liu [Tue, 6 Aug 2013 11:36:16 +0000 (19:36 +0800)]
mm: zcache: add evict zpages supporting

Implemented zbud_ops->evict, so that compressed zpages can be evicted from
zbud memory pool in the case that the compressed pool is full.

zbud already managered the compressed pool based on LRU. The evict was
implemented just by dropping the compressed file page data directly, if
the data is required again then no more disk reading can be saved.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Patch-mainline: linux-mm @ 2013-08-06 11:36:16
[vinmenon@codeaurora.org: trivial merge conflict fixes]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Change-Id: Ia66652475e490f0233547511e80abf7587054e65

8 years agomm: zcache: add core files
Bob Liu [Tue, 6 Aug 2013 11:36:14 +0000 (19:36 +0800)]
mm: zcache: add core files

zcache is a backend for cleancache that takes file pages that are in the
process of being reclaimed and attempts to compress them and store them
in a RAM-based memory pool. This can result in a significant I/O reduction
if system is full with file pages and, in the case where decompressing
from RAM is faster than reading from the disk, can also improve workload
performance.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Patch-mainline: linux-mm @ 2013-08-06 11:36:14
[vinmenon@codeaurora.org: trivial merge conflict fixes, checkpatch fixes]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Change-Id: Id05bcc1946eee22b94a83adeb0134a3f6e357ef8

8 years agoASoC: wcd_cpe_services: delete the redundant worker thread
Walter Yang [Tue, 8 Dec 2015 09:59:04 +0000 (17:59 +0800)]
ASoC: wcd_cpe_services: delete the redundant worker thread

Currently worker thread in cpe service is created twice.
The second thread handler overwrites the first one. The first
thread is not freed  when the service is cleaned up. The fix
prevents creation of the redundant thread.

CRs-Fixed: 949165
Change-Id: Idd76b76d4f7f25d2592ca7c336dbee77b6efc7eb
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
8 years agocan: Add RH850 CAN controller driver
Alex Yakavenka [Thu, 1 Oct 2015 23:29:17 +0000 (16:29 -0700)]
can: Add RH850 CAN controller driver

This driver creates network device of type CAN
and processes tx and rx frames that it sends and
receives over SPI.

Change-Id: I903927d5bb0025c2ad3e9f1dd7cb51de547fc360
Signed-off-by: Alex Yakavenka <ayakav@codeaurora.org>
8 years agotrace: ipc_logging: Increase maximum size of logging context name
Steven Cahail [Wed, 25 Nov 2015 04:14:24 +0000 (21:14 -0700)]
trace: ipc_logging: Increase maximum size of logging context name

The current maximum length of an IPC Logging log context name is 20
characters. Some clients are now using names longer than this.

Increase the maximum length to 32. This change increases the IPC Logging
version to 3.

Change-Id: I9daecb8a7c6c3aea427efd1c75e307456e9c6c21
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
8 years agomsm: sps: support using cached write pointer for BAM-to-Sys mode
Yan He [Sat, 12 Dec 2015 02:47:59 +0000 (18:47 -0800)]
msm: sps: support using cached write pointer for BAM-to-Sys mode

Support using the cached write pointer for a BAM-to-Sys mode BAM
pipe when check if the desc FIFO of that pipe is full.

Change-Id: Ie480ecca9eff76388c504665b496e01bbf3e009f
Signed-off-by: Yan He <yanhe@codeaurora.org>
8 years agosoundwire: Add slave synchronization configuration
Sudheer Papothi [Thu, 10 Dec 2015 21:12:59 +0000 (02:42 +0530)]
soundwire: Add slave synchronization configuration

Slave synchronization is needed to sync frame shape consisting
of different ports with different sample rates. Change sets
the slave synchronization based on the frame shape.

Change-Id: Iae726555b3c158394662c590d1ebc781ff7f54f5
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
8 years agoARM: dts: apq: enable dual dsi for agave board for APQ8096
Vinu Deokaran [Mon, 14 Dec 2015 17:11:48 +0000 (12:11 -0500)]
ARM: dts: apq: enable dual dsi for agave board for APQ8096

Enable dual DSI for Agave board to support three displays.

Change-Id: I80e0c90e3d039a1777598f4038d9a1d18f23ca1b
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
8 years agomsm: isp: Add output format support for camif
Abhishek Kondaveeti [Sun, 13 Dec 2015 13:17:22 +0000 (18:47 +0530)]
msm: isp: Add output format support for camif

Add output format support for camif raw path
in isp.

Change-Id: If8e633175a5488b8da740654c8204b0247d3c408
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
8 years agosoc: qcom: socinfo: Add check for subtype id
Zhenhua Huang [Mon, 7 Dec 2015 10:17:09 +0000 (18:17 +0800)]
soc: qcom: socinfo: Add check for subtype id

There's an overflow when subtype id is greater than 3 in current
design. Add a check to ensure returning correct value.

Change-Id: Ie8d234792f7370c95782a86e16affd383ed53c18
Signed-off-by: Zhenhua Huang <zhenhuah@codeaurora.org>
8 years agoARM: dts: msm: Add pinctrl for codec reset and interrupt on 8996
Sudheer Papothi [Mon, 8 Jun 2015 17:20:08 +0000 (22:50 +0530)]
ARM: dts: msm: Add pinctrl for codec reset and interrupt on 8996

Change reset and interrupt lines of codec from gpio to pinctrl
on 8996 target to control the drive strength of the pins.

Change-Id: Ie95b80699f1726c2b2e27c1b8e5f51f7ccdd5417
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
8 years agosoc: qcom: glink: Fix race condition between tx and close operation
Karthikeyan Ramasubramanian [Mon, 7 Dec 2015 23:05:53 +0000 (16:05 -0700)]
soc: qcom: glink: Fix race condition between tx and close operation

The channel is closed locally by the client either as part of SSR or normal
working scenario. The transmit operation does not check the transport or
channel states before queuing the packet for transmit operation. This
causes the transmit operation to access stale transport or channel context.

Check the transport and channel state before queuing the packet for
transmission.

CRs-Fixed: 947627
Change-Id: Ic6f8350b6b5e51b641794255f8520ff4616343bb
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
8 years agotrace: ipc_logging: Destroy debugfs directories with logging contexts
Steven Cahail [Sat, 12 Dec 2015 01:58:42 +0000 (18:58 -0700)]
trace: ipc_logging: Destroy debugfs directories with logging contexts

IPC Logging currently creates debugfs directories for each of its
logging contexts, but does not remove them when destroying the contexts.
If a user attempts to access a directory associated with a destroyed
context, a crash will result.

Destroy debugfs directories when the logging context is destroyed.

Change-Id: I5a3b1cbf2fb5d9d0ede3d9da0fccd605b9fdf619
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
8 years agoARM: dts: msm: enable bta check for nt35597 panel on msm8996
Dhaval Patel [Mon, 30 Nov 2015 18:39:45 +0000 (10:39 -0800)]
ARM: dts: msm: enable bta check for nt35597 panel on msm8996

Enable bta check for nt35597 dual dsi/single dsi(dsc) and
video/command mode panel on msm8996 target.

Change-Id: I0a4dd466719f973690f996e7a0cbe95de9b88ad7
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
8 years agoRevert "ARM: dts: msm: Enable dynamic refresh for sharp WQXGA panel"
Ingrid Gallardo [Fri, 11 Dec 2015 19:03:57 +0000 (11:03 -0800)]
Revert "ARM: dts: msm: Enable dynamic refresh for sharp WQXGA panel"

This reverts commit 9d9fb803fd88c493bd27f7b3af21358f8b16bfe2
("ARM: dts: msm: Enable dynamic refresh for sharp WQXGA panel")
since the dynamic refresh  method enabled by the change is
causing random touch events to be triggered.

Change-Id: Ibfab4827c53635bd8c399b087a9a699f26c69dbc
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
8 years agonetfilter: Fix to MT call issue
Ravinder Konka [Tue, 10 Mar 2015 11:07:00 +0000 (16:37 +0530)]
netfilter: Fix to MT call issue

Changes to store forced port only in the original direction.
This resolves the MT call issue where destination port is
incorrectly translated to forced_port.

Change-Id: I1b1c407c4beb8185ada0b005b1cd1034cb975141
Signed-off-by: Ravinder Konka <rkonka@codeaurora.org>
8 years agoARM: dts: msm: Remove obsolete USB 'power-collapse' properties
Jack Pham [Fri, 11 Dec 2015 08:43:56 +0000 (00:43 -0800)]
ARM: dts: msm: Remove obsolete USB 'power-collapse' properties

These properties are no longer used and can be removed.

Change-Id: Iea376798a6a9da5ba5a0a6fa4e24c15c1cfe188d
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agoclk: msm: clock-gcc-8996: Add USB_20_BCR
Jack Pham [Fri, 11 Dec 2015 08:44:53 +0000 (00:44 -0800)]
clk: msm: clock-gcc-8996: Add USB_20_BCR

Add the BCR to reset USB20 block to gcc_usb20_master_clk. This will
allow the driver to correctly call clk_reset().

Change-Id: Ib4f8b73317032c88f5272a530007ff08d14dbd4a
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agoqseecom: Add a new smc cmd to check RPMB key provision status
Zhen Kong [Wed, 9 Dec 2015 22:28:30 +0000 (14:28 -0800)]
qseecom: Add a new smc cmd to check RPMB key provision status

A new smc cmd is added to check RPMB key provision status

Change-Id: I50411bf9ae7f31589be34d7b5aaf48f2c12f0018
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
8 years agoASoC: wcd9335: Change RX disconnect port sequence
Phani Kumar Uppalapati [Tue, 1 Dec 2015 22:10:45 +0000 (14:10 -0800)]
ASoC: wcd9335: Change RX disconnect port sequence

Change RX disconnect port sequence so as to avoid
slimbus underflow and audio mute issues during
playback.

Change-Id: I0260e61b78e3bcfe422896dc60b15af84be424a4
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
8 years agoASoC: wcd9335: update default VBat Bias current
Banajit Goswami [Sat, 5 Dec 2015 07:45:33 +0000 (23:45 -0800)]
ASoC: wcd9335: update default VBat Bias current

Update default value for VBat Bias current for Front-end.
The increase in current value is needed to increase
robustness of VBat ADC output when the feature is used
at low temparature.

Change-Id: Ic924fa59ce867f9b32c17564f8f55406c6c467ea
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
8 years agoASoC: msm: Enable MBHC 5-pole plug detection
Phani Kumar Uppalapati [Sat, 7 Nov 2015 02:42:04 +0000 (18:42 -0800)]
ASoC: msm: Enable MBHC 5-pole plug detection

Enable MBHC (Multi Button Headset Control) 5-pole
plug detection so as to detect the presence of
second microphone whenever any accessory is inserted
in to the headset jack.

Change-Id: I53dda0d18006109c19a1cd8ce0bc4df45a13f0bf
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
8 years agosoc: qcom: ipc_router_glink_xprt: Fix receive callback
Karthikeyan Ramasubramanian [Tue, 8 Dec 2015 18:13:48 +0000 (11:13 -0700)]
soc: qcom: ipc_router_glink_xprt: Fix receive callback

G-Link driver notifies IPC Router about receive events in atomic context.
Allocate the memory from atomic pool to cache the information about rx
events for deferred processing.

CRs-Fixed: 948393
Change-Id: I09fb7ffd38b5a36b9ef99b6adb76c7e1f0168457
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
8 years agoARM: dts: msm: Disable VDD_APCC ACC regulator devices for msm8996v2
Osvaldo Banuelos [Thu, 10 Dec 2015 17:52:00 +0000 (09:52 -0800)]
ARM: dts: msm: Disable VDD_APCC ACC regulator devices for msm8996v2

Disable the regulator devices which manage ACC settings for
memories powered by VDD_APCC in the CPUSS. In addition, update
the CPR3 controller and regulator devices which manage VDD_APCC
to ensure CPR corner changes do not result in configuring ACC
regulators.

Change-Id: Ib176c762d12e996e809ee0ccf0bc56d5ae37c0f3
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
8 years agomsm: kgsl: Add missing check for size against lower VA
Rajesh Kemisetti [Thu, 10 Dec 2015 10:30:00 +0000 (16:00 +0530)]
msm: kgsl: Add missing check for size against lower VA

_get_unmapped_area_topdown() subtracts the requested size
from lower entry base without really checking its value.

This leads to overflow while working at boundary conditions.

Add a condition to check entry base with the size and proceed.

Change-Id: Ic695da683b11de35c7c4b8936a35d693dc8fa452
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
8 years agomsm: isp: Initialize buffer spin lock
Abhishek Kondaveeti [Thu, 10 Dec 2015 12:41:56 +0000 (18:11 +0530)]
msm: isp: Initialize buffer spin lock

Initialize buffer manager spin lock before
using it

Change-Id: Icef09e9d40bbbe66e90c162dd0ae2f1733ae9a06
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
8 years agomsm: kgsl: Prevent deadlock in cmdbatch timer
Tarun Karra [Thu, 22 Oct 2015 19:22:08 +0000 (12:22 -0700)]
msm: kgsl: Prevent deadlock in cmdbatch timer

Dispatcher can acquire drawctxt->lock if context is pending
and the fence it is waiting on just got signalled.
Dispatcher acquires drawctxt->lock and tries to delete the
cmdbatch timer using delete_timer_sync(). Delete_timer_sync()
waits till timer and its pending handlers are deleted.
But if the timer expires at the same time, timer handler
could be waiting on drawctxt->lock leading to a
deadlock. To prevent this use spin_trylock_bh() instead of
spin_lock_bh(). spin_trylock_bh() does not wait for the lock
if it does not get it and allows the timer handler to finish.
This prevents the deadlock.

Change-Id: Ic2344fed5fccb581b58ec0b66b45ba68af9f1459
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
8 years agosoc: qcom: msm_rtb: Add support for hotplug RTB logging
Sanrio Alvares [Fri, 4 Dec 2015 20:27:08 +0000 (12:27 -0800)]
soc: qcom: msm_rtb: Add support for hotplug RTB logging

Hotplug events are particularly interesting from system
point of view and tracing around the hotplug events would
provide essential information that could be used to debug
system issues.

Change-Id: I23e9539a76e04e222a0a05f27be51cb726ab6c33
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
8 years agomsm: ipa2: add active clients logging
Valery Gorohovsky [Thu, 26 Nov 2015 16:27:15 +0000 (18:27 +0200)]
msm: ipa2: add active clients logging

add framework for IPAv2 active clients history logging
logging is enabled by default
cat /sys/kernel/debugfs/ipa/active_clients in order to view logs
echo anything to /sys/kernel/debugfs/ipa/active_clients in order
to clear the history log buffer

Change-Id: I975271798aee56ac9889d34203a32c99a30fc958
Signed-off-by: Valery Gorohovsky <valeryg@codeaurora.org>
8 years agomsm: dba: add additional audio configuration parameters
Vinu Deokaran [Thu, 23 Apr 2015 17:28:20 +0000 (10:28 -0700)]
msm: dba: add additional audio configuration parameters

Add additional audio configuration parameters to the MSM
DBA(Display Bridge Abstraction) interface driver.

Change-Id: I7fef9b1a192a872c2e89dd9a7d6e942a1b77c6cb
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: cleanup auto-refresh implementation
Ingrid Gallardo [Thu, 17 Dec 2015 00:43:03 +0000 (16:43 -0800)]
msm: mdss: cleanup auto-refresh implementation

Auto-refresh is used on smart displays to refresh display without
SW intervention, similar to dumb displays. So when it is on, display
controller will automatically send new frame every time panel TE signal
is received. Now as per the HW implementation, disabling auto-refresh
requires that display controller is idle and there is no frame transfer
on-going. To achieve this, we need to follow certain disable sequence.
To implement this disable sequence, clean up current implementation and
introduce auto-refresh state machine.

Change-Id: Iac5d76b6431f7ef2fcd68114e19c5cb5fb02577d
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
8 years agomsm: mdss: check intr line status before handling isr
Dhaval Patel [Tue, 22 Dec 2015 22:22:33 +0000 (14:22 -0800)]
msm: mdss: check intr line status before handling isr

Hardware might return/call the pending interrupt
on one CPU when same interrupt is disabled from other
core. Such parallel processing may lead to unclocked
register access in interrupt context followed by
panic. It is safe to check the interrupt line status
before handling isr to avoid crash in such race
condition.

Change-Id: I460550cb5188c7f77b9f741682917010f9231a50
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
8 years agomsm: mdss: fix deadlock between display and ESD check thread
Ray Zhang [Mon, 18 Jan 2016 07:31:25 +0000 (15:31 +0800)]
msm: mdss: fix deadlock between display and ESD check thread

Display thread holds ov_lock followed by mutex, while the ESD
check thread for cmd mode panel holds mutex followed by ov_lock.
Fix this deadlock by acquiring mutex before ov_lock in ESD check
thread.

Change-Id: I857f780e14a6ccb679e89ff16b19706d205df4b6
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
8 years agomsm: mdss: hdmi: hdcp2p2: fix hdcp 2.2 compliance issues
Ajay Singh Parmar [Tue, 22 Dec 2015 07:59:57 +0000 (23:59 -0800)]
msm: mdss: hdmi: hdcp2p2: fix hdcp 2.2 compliance issues

Send stream management message to sink after topology update. Poll
for new message or authentication required status after successful
receiver or repeater authentication. Also, DDC hardware polls sink
for a given time. Let the polling complete and do not treat intermediate
DDC errors as failures because DDC transaction can pass in next
iteration. Once polling ends, check for errors and timeouts and reset
polling data. Treat these errors as failure only after polling ends.

Change-Id: I286fb00cf935bff493e108c05df625d5ca3ade26
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
8 years agomsm: mdss: maintain AD state through idle power collapse
Ping Li [Thu, 17 Dec 2015 02:46:12 +0000 (18:46 -0800)]
msm: mdss: maintain AD state through idle power collapse

When device enters the idle power collapse mode, the entire
AD HW block is powered down, which will cause the previous
AD settings get lost. So when device exits the idle power
collapse mode, we need to store AD to previous state.

In order to achieve this, we need to switch AD mode to 0x85 first
and manually write the last AD strength value to AD register. Keep
this setting for couple of frames, in the meantime, kick off AD
calculator with t_filter_control value of 0 to ramp up the AD
strength from 0 to current target strength. Then switch the mode
back to auto strength (0x81).

Change-Id: Iddc12dbb0da06675141fa9fe049cfe90110defb9
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: fix NULL pointer dereferencing issues
Jayant Shekhar [Fri, 8 Jan 2016 11:05:29 +0000 (16:35 +0530)]
msm: mdss: fix NULL pointer dereferencing issues

This change fixes the errors reported in static analysis
of MDSS driver code. These changes include fix for various
potential NULL pointer dereferencing and array index out of
bounds issues in MDP, DSI and PP module of MDSS driver.

Change-Id: I49f65f0b4e5218f9fc90469e9d431a3aec811ee2
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: update PHY timing calculation logic for resolution change
Sandeep Panda [Wed, 6 Jan 2016 06:21:34 +0000 (11:51 +0530)]
msm: mdss: update PHY timing calculation logic for resolution change

In current implementation we are always overriding the PHY read
from dt entry with the ones we are calculating in driver. Update
the PHY timing only when there is a change in resolution.

Change-Id: I2ba936af6e55b27c7b28d38990b32e896c877e08
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: Use the correct AD backlight for AD BL filter
Ping Li [Wed, 30 Dec 2015 23:49:20 +0000 (15:49 -0800)]
msm: mdss: Use the correct AD backlight for AD BL filter

Use the last backlight sent to AD core for AD backlight filter
threshold comparison.

Change-Id: I8ea26a8a95c700749aa83d5b70a3b16c44258767
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: Optimize backlight mapping calculation for AD
Ping Li [Wed, 30 Dec 2015 04:47:41 +0000 (20:47 -0800)]
msm: mdss: Optimize backlight mapping calculation for AD

Reduce the rounding error during AD backlight linearization and
attenuation.

Change-Id: Ibf181414512d457d3341bbccf8cf9338aef8ac76
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: Correctly reset the ad_events count
Ping Li [Wed, 16 Dec 2015 03:27:57 +0000 (19:27 -0800)]
msm: mdss: Correctly reset the ad_events count

Reset the ad_events count in the AD ioctl instead of ad_setup().
There are some time delay between AD ioctl and ad_setup, which is
part of the display commit path, so if we reset the ad_event count
in ad_setup, then it is possible that user space reads the ad_events
sysfs node after the AD ioctl but before the ad_setup(). In that
case, user space may get the incorrect ad_events count, and cause
the gradual AD off fail.

Change-Id: I13f2043a6a21be7e49b44a964b00b0aa4315dc17
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: add multiple register support in ESD check
Ray Zhang [Thu, 3 Dec 2015 06:52:58 +0000 (14:52 +0800)]
msm: mdss: add multiple register support in ESD check

Current implementation cannot support multiple registers
in ESD check, and it does not work for many cases. For
example, some panels need check multiple registers to get
its status, and some panels might return several possible
values for one register read.

To support this kind of behaviors, a new property in dtsi
is added as "qcom,mdss-dsi-panel-status-valid-params" which
specifies the valid value length we should check in the
payload returned by panel, and the payload length panel
should return is specified by the property "qcom,mdss-dsi-
panel-status-read-length". "qcom,mdss-dsi-panel-status-value"
is also extended to an array which specifies all the possible
return values from panel.

Change-Id: I098d04281b819581f53c7c509778e7b594aa499a
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
8 years agomsm: mdss: Add support to retain AD RAMs
Ping Li [Fri, 18 Dec 2015 00:54:47 +0000 (16:54 -0800)]
msm: mdss: Add support to retain AD RAMs

Modify the MDP_CBCR bits to retain the AD RAMs through idle power
collapse(IPC).

Bits setting when device enters IPC:
  - MEM_CORE_ON: 1
  - MEM_PERIPH_ON: 0
  - MEM_PERIPH_OFF: 1
Bits setting when device exits the IPC:
  - MEM_CORE_ON: 1
  - MEM_PERIPH_ON: 1
  - MEM_PERIPH_OFF: 0

Change-Id: I10749312d905eb4629e94e396b1604667738e84f
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: add min vote on the bus before iommu attach
Kalyan Thota [Thu, 7 Jan 2016 09:38:01 +0000 (15:08 +0530)]
msm: mdss: add min vote on the bus before iommu attach

MDSS needs a min vote on sysmmnoc clk to perform TZ and
IOMMU operations. This vote is needed for few low tier
chipsets.

Change-Id: Iff8c775bfc2001f0bae5118427334793bf392bc0
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
8 years agoclk: msm: mdss: Read PLL/PHY status once during bootup
Tatenda Chipeperekwa [Fri, 8 Jan 2016 00:32:20 +0000 (16:32 -0800)]
clk: msm: mdss: Read PLL/PHY status once during bootup

Read the PLL/PHY status once during bootup to avoid delays
due to polling. Polling for PLL/PHY status is only required
when handling HDMI use cases in which the cable is connected
after bootup is complete.

Change-Id: Ie1d5983a7784cb5f3472527d1b510f128ae9d325
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
8 years agomsm: mdss: debug: add xin id to pipe dump
Ingrid Gallardo [Tue, 10 Nov 2015 18:13:17 +0000 (10:13 -0800)]
msm: mdss: debug: add xin id to pipe dump

Add the xin id information on the dump of the
pipes.

Change-Id: I20d63e02d0f36f1d173185c520b7c448ead7409d
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
8 years agomsm: mdss: make sure backlight is off during suspend
Padmanabhan Komanduru [Wed, 30 Dec 2015 11:45:53 +0000 (17:15 +0530)]
msm: mdss: make sure backlight is off during suspend

The backlight of the display panel will not get turned off during
suspend if there are no display commits between suspend/resume
since allow_bl_update will only be set to 'true' after first
valid display commit after resume. This is possible for power
off charging use-case where there will be only one display
commit initially and later just the content of the buffer gets
updated without anymore display commits across suspend/resume.
Make sure the backlight is turned off during suspend by
explicitly setting allow_bl_update to 'true' before trying to
set the backlight to zero.

Change-Id: I10f39e3913e5b40a61066f0bbce3a7a8f1a9441b
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
8 years agomsm: mdss: move used pipes to cleanup list on overlay free
Veera Sundaram Sankaran [Tue, 5 Jan 2016 21:32:57 +0000 (13:32 -0800)]
msm: mdss: move used pipes to cleanup list on overlay free

Avoid moving pipes to destroy list during overlay free based on
the pipe play count as it might not give the actual information.
The play count is set to 0 for all new or config changed pipes
during the validate call. And if we get a fb_release_all request
right after the validate, it would indicate an inconsistent state
for the play count. Instead, move the used pipes to cleanup list,
so that the NULL kickoff would handle the pipes to be unstaged
and destroyed.

Change-Id: I0026d512e92d0d59962ee8114873f7804a31c018
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
8 years agomsm: mdss: remove interrupt handler when pingpong is not present
Ray Zhang [Thu, 24 Dec 2015 09:28:51 +0000 (17:28 +0800)]
msm: mdss: remove interrupt handler when pingpong is not present

Remove pingpong interrupt handler when pingpong done interrupt is
not present. This will ensure no unexpected pingpong is reported
which might lead to confliction with the destroying ctx.

Change-Id: I9a7173fb19e55344cedcfeccdaf23efaba11892c
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
8 years agomsm: mdss: set default resolution of DBA driver during boot
Sandeep Panda [Thu, 31 Dec 2015 05:03:31 +0000 (10:33 +0530)]
msm: mdss: set default resolution of DBA driver during boot

In cases of EDID read or parser failures, driver should expose
a default resolution to other modules to continue with the HDMI
initialization. So during bridge chip initialization sequence
update the default resolution.

Change-Id: Ia6a7f8b4d9e3f1650b9c11aafc118a2662801ba0
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>