Commit graph

596578 commits

Author SHA1 Message Date
Jack Pham
9f8d148622 usb: pd: ensure source hard reset is handled timely
When in source mode if a hard reset is received just before or
while usbpd_sm() is in the middle of trying to send an outgoing
message, the signal handling would get delayed due waiting for
the PD PHY to complete retrying and failing both the message as
well as the subsequent Soft_Reset message. Instead, treat the
incoming hard reset with priority try to bail out of further
attempts to send a message so that we can immeidately re-queue and
process the hard reset on the next usbpd_sm() invocation.

In case the TX attempt still manages to win the race, this will
cause delay that affects our tPSHardReset (25-35ms) required time
resulting in VBUS getting turned off too late. Handle this by
keeping track of when the hard reset signal arrived so that
we can schedule SRC_TRANSITION_TO_DEFAULT within this window.

Also promote the error message when a hard reset is received
from KERN_DEBUG to KERN_ERR, as this is abnormal enough
to deserve printing to the kernel log with higher priority.

Change-Id: Ie503f7b776022067ec3a4788d5229ec508b9c55f
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2018-01-17 17:56:22 -08:00
Hemant Kumar
f83e315016 usb: pd: Support revision 3.0 in sink-only mode
commit 07040df2790e ("usb: pd: policy_engine: Handle spec revision
properly") changed the spec revision handling to be 2.0 mode unless
a programmable power supply is seen. Extend this via a module
parameter to allow PD 3.0 in sink-only mode regardless of PPS when
a 3.0 source is connected.

Since the revision of the source is first encountered when
receiving the Source Capabilities message, this information is
lost by the time pd_eval_src_caps() is called. So bring back the
handling in phy_msg_received() removed in commit 07040df2790e ("usb:
pd: policy_engine: Handle spec revision properly").

Change-Id: I0485224aeadcffbfaecd0c7942c6dbcd9ddd3813
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2018-01-17 17:55:15 -08:00
Linux Build Service Account
70a63c48d0 Merge "msm: thermal: use cluster frequency to request lmh dcvs from KTM" 2018-01-17 09:55:05 -08:00
Rahul Sharma
4d4fccf24e msm: ais: sensor: actuator: avoid accessing out of bound memory
Issue:
When total_steps is updated, after that, copy_from_user
fails with an error, then, i2c_reg_tbl is not allocated.
In this case, when calling msm_actuator_parse_i2c_params,
it lead to out-of-bound memory write.
Fix:
1) Assign total_steps to zero when error from copying.
2) Add NULL pointer check for i2c tbl.
3) Fixing the issue where the function can return
with an error code leaving "a_ctrl->i2c_reg_tbl"
and "a_ctrl->total_steps" out of sync.

Change-Id: Ib46deceb7bd8efff1cb606b894396e7016271dd3
Signed-off-by: Rahul Sharma <sharah@codeaurora.org>
2018-01-17 06:23:55 -08:00
Vinayak Menon
199d236e97 defconfig: msm: sdm660: disable memory cgroups
Memory cgroups is an unused feature on sdm660. But
enabling it in kernel means that user space can
configure it. Avoid such user configurations until
the feature is decided to be deployed.

Change-Id: Ie77a4de51a59179ff3cb543e3cc955ce48412a59
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2018-01-17 15:17:50 +05:30
Linux Build Service Account
b3b1b7012c Merge "cnss2: Fix compilation warning maybe as error" 2018-01-16 20:01:40 -08:00
Linux Build Service Account
a854e24ab5 Merge "msm: adsprpc: Fix race conditions on same buffer" 2018-01-16 20:01:38 -08:00
Linux Build Service Account
a1410220e6 Merge "scsi: ufs-qcom: Fix compilation error in ufs bus voting" 2018-01-16 10:03:34 -08:00
Linux Build Service Account
99cdbc1cdc Merge "drm/msm-hyp: add get/put function to cache FB" 2018-01-16 10:03:31 -08:00
Linux Build Service Account
874c79ac6b Merge "msm: ais: Camera clock voting fixes for LA XO" 2018-01-16 10:03:28 -08:00
Sarada Prasanna Garnayak
e1fe6842c5 ath10k: wakeup device from wow suspend on GTK rekey failure
The ath10k wlan firmware supports GTK rekeying while asleep.
Enable GTK rekeying failure wakeup source in wow suspend.
This adds support to wakeup the device from wow suspend
state if GTK rekeying process failed in the wlan firmware.

CRs-Fixed: 2169340
Change-Id: I321a6139d74b0fcf476e961ba83879fae9c39f04
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
2018-01-16 04:35:29 -08:00
Vijayavardhan Vennapusa
54e88e72a6 dwc3: debugfs: Add check for length before copy data from userspace
Add boundary check before copying data from userspace buffer to dwc3
local buffer. The third parameter passed to copy_from_user() should be
minimum of the two values between userpsace buffer size count and
(local_buffer size - 1). The last one byte in local_buffer should be
reserved for null terminator.

Change-Id: I9b2e3db4d5ad6b5f14515cadafa6264f9e8b786c
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2018-01-16 14:51:15 +05:30
Mohammed Javid
b564ffbc31 msm: ipa: Fix to unsigned integer underflow
Added code changes to fix the unsigned integer underflow
leads to accessing unmapped memory.

Change-Id: I8148aebd3597ec6ae8c184199afe816f3d80636e
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-01-16 12:36:42 +05:30
Tharun Kumar Merugu
3ebcd5d7e5 msm: adsprpc: Fix race conditions on same buffer
Variable map may pointing to the same buffer on race conditions
in functions fastrpc_internal_mmap and fastrpc_internal_munmap,
use mutex to avoid race conditions on same buffer.

Change-Id: I96ed884c44a36f574677ba3ba189dfbf2ce3751d
Acked-by: Krishnaiah Tadakamalla <ktadakam@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2018-01-15 22:36:05 -08:00
Subbaraman Narayanamurthy
371c451d08 power: qpnp-fg-gen3: Adjust recharge SOC after early termination
Currently, recharge SOC is adjusted based on the SOC at which
charge termination occurs. However, it gets reset back to the
original threshold only if input is removed. This does not work
well if charging resumes again once the battery is out of JEITA
as the recharge SOC threshold stays configured at a lower value.
Fix it by adjusting recharge SOC to the original threshold once
charging begins.

CRs-Fixed: 2163058
Change-Id: I07c714d32ba0005d3b0ff61142928eda58f049d0
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2018-01-15 14:38:24 -08:00
Manaf Meethalavalappu Pallikunhi
1296062336 msm: thermal: use cluster frequency to request lmh dcvs from KTM
KTM lmh dcvs frequency mitigation uses given online/first cpu max/min
mitigation request. There can be cases like emergency frequency
mitigation where mitigation request is for a particular cpu only and
online/first cpu may be one of the other cpus from the same cluster.
In this case lmh dcvs takes online/first cpu max request which can be
in no mitigation state. It leads to unmitigated state even though one
of the cpus is triggered.

If device supports cluster mitigation, use min/max request of that
cluster instead of min/max request of given online/first cpu.
It ensures lmh dcvs mitigation if one of the cpu mitigation is
triggered and other unmitigated cpu of same cluster is given as
online/first cpu.

Change-Id: Ibbb913eb67a7f84d4c3658d0edae495990ca9010
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2018-01-15 17:25:50 +05:30
Deepak Kushwah
e20be28bcc msm: vidc: set multistream mode for worst case scratch buffer requirement
In case of secure mode, worst case scratch buffer requimrement is
calulated upfront to avoid any delay in reallocation during the
resolution change. Worst case buffer requirement will be calulated
for max resolution and multistream mode enabled. This commit will
enable multistream mode if required to get worst case buffer requirements.

Change-Id: Iaafed40218d8a79e07584c87172bdadb62276cc6
Signed-off-by: Deepak Kushwah <dkushwah@codeaurora.org>
2018-01-15 03:03:32 -08:00
Zhiqiang Tu
249a02309f clk: msm: Add reset support in virtual clock frontend driver
To support reset function in virtual clock driver, we register
a reset controller in virtual clock front driver. It is a virtual
reset controller which talks with host backend via virtual clock
message.

Change-Id: I13d48180534110260d66e42f3a02b63c2afcaeca
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2018-01-15 15:25:42 +08:00
Ferry Zhou
4e11e0997d cnss2: Fix compilation warning maybe as error
Fix warning that the variable is used before initialized, which
might be treated as error in strict case.

Change-Id: I95a34fa31e87fde2055af745f46f65a0d0402efc
Signed-off-by: Ferry Zhou <tianguiz@codeaurora.org>
2018-01-15 13:47:42 +08:00
Linux Build Service Account
de111ce20e Merge "msm: sensor: actuator: add null pointer check for i2c array" 2018-01-13 03:50:15 -08:00
Linux Build Service Account
879163d599 Merge "soc: qcom: glink: Add sub system up notification in glink" 2018-01-13 03:50:13 -08:00
Linux Build Service Account
ee6f575089 Merge "clocksource: arch_timer: make virtual counter access configurable" 2018-01-12 15:34:03 -08:00
Linux Build Service Account
2f26ea48fb Merge "arm64: issue isb when trapping CNTVCT_EL0 access" 2018-01-12 15:34:03 -08:00
Linux Build Service Account
5d574072e3 Merge "BACKPORT: arm64: Add CNTFRQ_EL0 trap handler" 2018-01-12 15:34:02 -08:00
Linux Build Service Account
d81280ed87 Merge "BACKPORT: arm64: Add CNTVCT_EL0 trap handler" 2018-01-12 15:34:01 -08:00
Linux Build Service Account
ca9e78d525 Merge "ASoC: msm: add kcontrol for sec tdm slot config" 2018-01-12 15:34:00 -08:00
Linux Build Service Account
8867eef777 Merge "netfilter: nf_defrag_ipv4: Add sysctl to disable per interface" 2018-01-12 15:33:58 -08:00
Linux Build Service Account
39b7c5b66a Merge "ARM: dts: msm: smmu and modem switch to virtual clock on msm8996 vplatform" 2018-01-12 15:33:57 -08:00
Rahul Sharma
a211778552 msm: ais: Camera clock voting fixes for LA XO
AIS camera voting on VFE and ISPIF clocks cause XO shutdown failure.
So, add new AIS manager driver, to control AIS camera clock votes.
Also add a new method in early camera driver to turn on/off clocks
when it's needed.

Change-Id: I43090b51cb29ca9de62dfa191f77b7aa9dae8613
Signed-off-by: Rahul Sharma <sharah@codeaurora.org>
2018-01-12 02:44:57 -08:00
Haibin Liu
eabe2326e1 msm: sensor: actuator: add null pointer check for i2c array
Issue:
i2c_reg_tbl may be null under error condition when set param.
then, other actuator function still may use the i2c_reg_tbl as null.
Fix:
1) the assignment total_steps follow on kmalloc buffer.
2) Add NULL pointer check for i2c tbl.

CRs-Fixed: 2152401
Change-Id: Ieec3d88e6dae0177787da0906f53d59ac4f5a624
Signed-off-by: Haibin Liu <haibinl@codeaurora.org>
2018-01-11 23:36:14 -08:00
Linux Build Service Account
04b6b652ac Merge "leds: qpnp-wled: add stepper algorithm using brightness map" 2018-01-11 04:15:02 -08:00
Linux Build Service Account
d11384c032 Merge "leds: qpnp-wled: add support for brightness mapping" 2018-01-11 04:15:01 -08:00
Linux Build Service Account
223521eafb Merge "ARM: dts: msm: Add missing entries for XO on msm8996 agave" 2018-01-11 04:15:00 -08:00
Linux Build Service Account
4e432f6b70 Merge "mmc: host: Add device_prepare pm for mmc_host" 2018-01-11 04:14:59 -08:00
Linux Build Service Account
4233164b94 Merge "drivers: cpuidle: lpm-levels: Fix untrusted pointer dereference." 2018-01-11 04:14:57 -08:00
Linux Build Service Account
424c9af495 Merge "soc: msm: qdsp6v2: fix compile warning in ion vm driver" 2018-01-11 04:14:56 -08:00
Linux Build Service Account
e64256fca0 Merge "ASoC: msm: qdsp6v2: add spin lock to protect ac" 2018-01-11 04:14:55 -08:00
Linux Build Service Account
eb26d9d0c0 Merge "icnss: Add size check before assigning msa permission" 2018-01-11 04:14:54 -08:00
Linux Build Service Account
a26abcc37e Merge "drm/msm: Fix prototypes of the stub functions" 2018-01-11 04:14:53 -08:00
Linux Build Service Account
3ff2845f4e Merge "oc: qcom: rpm-smd-debug: Fix potential memory leaks" 2018-01-11 04:14:51 -08:00
Linux Build Service Account
75c61941bc Merge "Merge android-4.4.105 (8a53962) into msm-4.4" 2018-01-11 04:14:46 -08:00
Linux Build Service Account
e525ef12a4 Merge "Merge android-4.4.104 (8bc4213) into msm-4.4" 2018-01-11 04:14:45 -08:00
Sayali Lokhande
a2d5154013 scsi: ufs-qcom: Fix compilation error in ufs bus voting
When CONFIG_QCOM_BUS_SCALING is not defined, compilation
error is observed for ufs_qcom_set_bus_vote(), as incorrect
arguments are being passed in its defination. This change
fixes compilation error by passing correct arguments to
ufs_qcom_set_bus_vote() function.

Change-Id: I4c502482bf8dda46fd1352a097ade90f67fe1d73
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2018-01-11 09:15:42 +05:30
Subash Abhinov Kasiviswanathan
3ee7c157f7 netfilter: nf_defrag_ipv4: Add sysctl to disable per interface
Add a sysctl nf_ipv4_defrag_skip to skip defragmentation per
interface. This is set 0 to preserve existing behavior (always
defrag per interface).

This is useful for pure ipv4 forwarding scenarios (without NAT)
in conjunction with xfrm. It appears that network stack defrags
the packets and then forwards them to xfrm which then encrypts
and then later fragments them on a different boundary compared
to the source.

CRs-Fixed: 2140310
Change-Id: I11956284a9692579274e8626f61cc6432232254c
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2018-01-10 13:57:22 -07:00
Camus Wong
8c11510781 drm/msm-hyp: add get/put function to cache FB
add vendor defined get/put function to cache FB and improve hyp performance

Change-Id: I10f7faedc565819aed24c71c0815af571df10b85
Signed-off-by: Camus Wong <camusw@codeaurora.org>
2018-01-10 14:08:27 -05:00
Derek Chen
fa7c29365d ASoC: msm: add kcontrol for sec tdm slot config
Add kcontrol support for TDM slot width and
slot number configuration for secondary TDM
interface.

CRs-fixed: 2170145
Signed-off-by: Derek Chen <chenche@codeaurora.org>
Change-Id: I573421d005618c07c5735196490385d67f36f89a
2018-01-10 08:51:24 -08:00
Rahul Sharma
932d6cbc80 ARM: dts: msm: Add missing entries for XO on msm8996 agave
Some camera entries are missing in camera dtsi files which are
causing failure on LA XO shutdown. Added all missing automotive
camera entries to dtsi files which are used by camera driver
during LA XO shutdown.

Change-Id: I633ed0788bb1dd6c512c6d6349c3750c19bcdd26
Signed-off-by: Rahul Sharma <sharah@codeaurora.org>
2018-01-10 07:40:50 -08:00
Dhoat Harpal
f43f048321 soc: qcom: glink: Add sub system up notification in glink
Glink does not wait for pil to inform about subsystem up. It triggers
link up on first interrupt processed after ssr, this can cause stability
issues if some delayed interrupt is processed after ssr.

Glink waits for PIL to notify about subsystem up and initializes
its state only after that.

CRs-Fixed: 2165753
Change-Id: I71614e6d7e68bf2fa12ac7f27894492019bd3829
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2018-01-10 18:45:11 +05:30
Zhiqiang Tu
ade10b604f ARM: dts: msm: smmu and modem switch to virtual clock on msm8996 vplatform
Enable virtual clock for smmu and modem.

Change-Id: I0a399eb3535ea919ed2919a041ff467572c40e8b
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2018-01-09 23:45:26 -08:00
Mahesh Sivasubramanian
5f3b521525 drivers: cpuidle: lpm-levels: Fix untrusted pointer dereference.
The list_for_each macro was not used correctly, where the intermediate
variable would be LIST_POISON, resulting in a untrusted pointer
dereference. Switch to using list_for_each_entry_safe to for safe
removal of a list entry.

Change-Id: I0e0fd5dd9f251b5093d6e9d6335387512ec59249
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
2018-01-10 12:31:28 +05:30