Commit graph

607680 commits

Author SHA1 Message Date
Gerrit - the friendly Code Review server
337dc993cc Merge changes into msm-4.4 2019-10-29 09:15:20 -07:00
Linux Build Service Account
d092d362dd Merge "msm: kgsl: Check user generated timestamp before queuing drawobjs" 2019-10-29 03:06:38 -07:00
Linux Build Service Account
ae5acb1279 Merge "soc: msm-pcm: Add mutex lock to protect prvt data" 2019-10-27 22:38:11 -07:00
Linux Build Service Account
33f3e0360f Merge "cnss2: Expose PCIe window register lock related APIs" 2019-10-25 12:46:37 -07:00
Linux Build Service Account
b634cc178c Merge "HID: core: add usage_page_preceding flag for hid_concatenate_usage_page()" 2019-10-25 01:08:58 -07:00
Linux Build Service Account
eaf1260ced Merge "HID: core: move Usage Page concatenation to Main item" 2019-10-25 01:08:57 -07:00
Linux Build Service Account
fc509761a1 Merge "asoc: msm-pcm: Added lock in controls _put() and _get() callback" 2019-10-24 05:19:54 -07:00
Linux Build Service Account
9fe357b99e Merge "adreno_tz: Correct acc_relative_busy calculation" 2019-10-24 05:19:53 -07:00
Linux Build Service Account
d69c48ba9f Merge "asoc: msm-routing: Fix array out of bounds issue" 2019-10-24 05:19:53 -07:00
Linux Build Service Account
26e794c1c0 Merge "msm: adsprpc: Fix integer overflow in refcount of map" 2019-10-24 05:19:51 -07:00
Soumya Managoli
42ffbf03ec soc: msm-pcm: Add mutex lock to protect prvt data
Add mutex lock to protect private data in _put() and
get() calls.

Change-Id: I92f5a6515b6d1c4ad650a7dcf22a0a231a84dd30
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-10-24 16:18:27 +05:30
Soumya Managoli
1c9afab264 asoc: msm-pcm: Added lock in controls _put() and _get()
callback

There is race condition around private data used in put() and get()
of few mixer ctls with close() callback. Added global mutex lock and
code changes to protect such critical section by accessing such lock.

Change-Id: I276c2a234cfcbef88b4272b945e5c3f121e8eb32
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-10-24 14:52:10 +05:30
Linux Build Service Account
62e3c60264 Merge "qseecom : Clear client handle after unmap the resources" 2019-10-23 18:55:42 -07:00
Linux Build Service Account
b0929d3d6b Merge "soc: qcom: Reorganize PIL code for reclaiming MSS mem during SSR" 2019-10-23 18:55:41 -07:00
Harshitha Sai Neelati
04024ee164 adreno_tz: Correct acc_relative_busy calculation
Current acc_relative_busy calculation is causing integer overflow
in 32 bit system. "stats->busy_time * stats->current_frequency"
results in a value which is beyond the 32 bit range.

Typecasting the value to u64 to avoid overflow.

Change-Id: Id97da02bef608787ceb7c9751bbfc203af56deb1
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
2019-10-23 17:21:16 +05:30
Archana Sriram
2af9b2a1e8 msm: kgsl: Check user generated timestamp before queuing drawobjs
In ioctls like kgsl_ioctl_submit_commands(), if both syncobj
type and cmd/marker/sparseobj type are submitted, the syncobj
is queued first followed by the other obj type. After syncobj
is successfully queued, in case of failure in get_timestamp
while queuing the other obj, both the command objs are
destroyed. As sync obj is already queued, accessing this
later would cause a crash.

Compare the user generated timestamp with the drawctxt
timestamp and return early in case of error. This avoids
unnecessary queuing of drawobjs.

Change-Id: I336c95c42ab1075d7653cba02772f92c918c884c
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
2019-10-23 11:35:14 +05:30
Yue Ma
5ff3c8e366 cnss2: Expose PCIe window register lock related APIs
The register window needs to be configed properly before accessing
any larger than 4K range PCIe registers. Expose the lock to WLAN
driver to avoid race condition when both drivers try to config it.

Change-Id: I94ccd963d4fd0a9715330d2e5733346ccd993ae1
Signed-off-by: Yue Ma <yuem@codeaurora.org>
2019-10-22 12:18:15 -07:00
jitendrathakare
c5ca3ffaa4 qseecom : Clear client handle after unmap the resources
When unloading the app, reset all client members to NULL
to protect from accessing the memory after being freed.

Change-Id: I573b9c6fde03539522d2b04724a2246660c62518
Signed-off-by: jitendra thakare <jitendrathakare@codeaurora.org>
2019-10-22 03:46:39 -07:00
Linux Build Service Account
dd4645c977 Merge "msm: ekms: Remove the wait for completion of eDRM probe" 2019-10-21 00:16:55 -07:00
Candle Sun
8ba522499f HID: core: add usage_page_preceding flag for hid_concatenate_usage_page()
Upstream commit 58e75155009c ("HID: core: move Usage Page concatenation
to Main item") adds support for Usage Page item following Usage items
(such as keyboards manufactured by Primax).

Usage Page concatenation in Main item works well for following report
descriptor patterns:

    USAGE_PAGE (Keyboard)                   05 07
    USAGE_MINIMUM (Keyboard LeftControl)    19 E0
    USAGE_MAXIMUM (Keyboard Right GUI)      29 E7
    LOGICAL_MINIMUM (0)                     15 00
    LOGICAL_MAXIMUM (1)                     25 01
    REPORT_SIZE (1)                         75 01
    REPORT_COUNT (8)                        95 08
    INPUT (Data,Var,Abs)                    81 02

-------------

    USAGE_MINIMUM (Keyboard LeftControl)    19 E0
    USAGE_MAXIMUM (Keyboard Right GUI)      29 E7
    LOGICAL_MINIMUM (0)                     15 00
    LOGICAL_MAXIMUM (1)                     25 01
    REPORT_SIZE (1)                         75 01
    REPORT_COUNT (8)                        95 08
    USAGE_PAGE (Keyboard)                   05 07
    INPUT (Data,Var,Abs)                    81 02

But it makes the parser act wrong for the following report
descriptor pattern(such as some Gamepads):

    USAGE_PAGE (Button)                     05 09
    USAGE (Button 1)                        09 01
    USAGE (Button 2)                        09 02
    USAGE (Button 4)                        09 04
    USAGE (Button 5)                        09 05
    USAGE (Button 7)                        09 07
    USAGE (Button 8)                        09 08
    USAGE (Button 14)                       09 0E
    USAGE (Button 15)                       09 0F
    USAGE (Button 13)                       09 0D
    USAGE_PAGE (Consumer Devices)           05 0C
    USAGE (Back)                            0a 24 02
    USAGE (HomePage)                        0a 23 02
    LOGICAL_MINIMUM (0)                     15 00
    LOGICAL_MAXIMUM (1)                     25 01
    REPORT_SIZE (1)                         75 01
    REPORT_COUNT (11)                       95 0B
    INPUT (Data,Var,Abs)                    81 02

With Usage Page concatenation in Main item, parser recognizes all the
11 Usages as consumer keys, it is not the HID device's real intention.

This patch adds usage_page_preceding flag to detect the third pattern.
Usage Page concatenation is done in both Local and Main parsing.
If usage_page_preceding equals 3(the third pattern encountered),
hid_concatenate_usage_page() is jumped.

Change-Id: Ieba9bcae85c49619b0abbafb55ce26d72a24f086
Signed-off-by: Candle Sun <candle.sun@unisoc.com>
Signed-off-by: Nianfu Bai <nianfu.bai@unisoc.com>
Fixes: 58e75155009c ("HID: core: move Usage Page concatenation to Main item")
Link: https://lore.kernel.org/lkml/1569830949-10771-1-git-send-email-candlesea@gmail.com/
Patch-mainline: linux-kernel @ 30/09/2019, 16:09
Signed-off-by: Rahul Shahare <rshaha@codeaurora.org>
2019-10-21 00:05:22 -07:00
Nicolas Saenz Julienne
61fd8755a7 HID: core: move Usage Page concatenation to Main item
[ Upstream commit 58e75155009cc800005629955d3482f36a1e0eec ]

As seen on some USB wireless keyboards manufactured by Primax, the HID
parser was using some assumptions that are not always true. In this case
it's s the fact that, inside the scope of a main item, an Usage Page
will always precede an Usage.

The spec is not pretty clear as 6.2.2.7 states "Any usage that follows
is interpreted as a Usage ID and concatenated with the Usage Page".
While 6.2.2.8 states "When the parser encounters a main item it
concatenates the last declared Usage Page with a Usage to form a
complete usage value." Being somewhat contradictory it was decided to
match Window's implementation, which follows 6.2.2.8.

In summary, the patch moves the Usage Page concatenation from the local
item parsing function to the main item parsing function.

Change-Id: Id25c0c7e11712501d117fb715b64db7772ac2066
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Terry Junge <terry.junge@poly.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Git-commit: 5db3c5adf4
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Rahul Shahare <rshaha@codeaurora.org>
2019-10-21 00:04:35 -07:00
Linux Build Service Account
20ad64b4d0 Merge "msm: pcie: Use local variable for manipulation" 2019-10-19 01:24:46 -07:00
Linux Build Service Account
329af9b580 Merge "power: battery: Initialize work struct before cancelling work" 2019-10-18 15:15:38 -07:00
Linux Build Service Account
e39e0aa356 Merge "ASoC: Fix possible overflow in routing driver" 2019-10-18 04:49:02 -07:00
Soumya Managoli
66b26c141c asoc: msm-routing: Fix array out of bounds issue
It seems there is out of bound access chances for lsm_app_type_cfg
array within msm_routing_get_lsm_app_type_cfg_control() callback.
Added case check to return invalid value if user tries to exceed
maximum allocated size of array to avoid it.

Change-Id: Ied86e6c9a957255c55bb126a09741fbde429be32
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-10-17 03:59:51 -07:00
Soumya Managoli
27c90ea8af ASoC: Fix possible overflow in routing driver
The reg in soc_mixer_control is 32-bit. When using
SOC_SINGLE_EXT, the value of FE DAI ID which is passed
as shift(to be operated on the reg) may be more than 31,
which may cause overflow.
Use SOC_DOUBLE_EXT instead of SOC_SINGLE_EXT so that the
reg field can be set to SOC_NO_PM to avoid any DAPM operation,
while passing BE and FE IDs in shift and rshift fields. And
these values can be retrieve in get/put functions and use them.
This is to avoid any possible overflow in DAPM operation.

Change-Id: I17fa4e059889ae725e6f015a779f518e6d0a813f
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-10-17 16:26:36 +05:30
Avaneesh Kumar Dwivedi
a19e5e98f4 soc: qcom: Reorganize PIL code for reclaiming MSS mem during SSR
This change ask hypervisor to remove memory mapping for MSS
from IOMMU second stage table and assign the ownership back to
HLOS just after MBA is booted.

Presently this is being done only after MBA is booted and MDT is
authenticated.

Change-Id: I724c1bcc664827e666612dd34cd078f3f044498a
Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
2019-10-17 11:14:45 +05:30
Rahul Sharma
c2877a4eb8 msm: ekms: Remove the wait for completion of eDRM probe
Main DRM & eDRM driver has asynchronous probes. In order to ensure that
both the driver's probe has completed there is a wait for completion for
respective driver is executed. There is an issue where the
wait for the eDRM driver blocks the eDRM driver deferred probe call.

This change remove wait in the eDRM driver for completion of its probe
as eDRM driver is always initialized after main DRM and necessary clock
voting would also be done in main DRM.

Change-Id: I422419d381ad3d0361fb80f3b2b9d176203a9342
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2019-10-16 13:58:23 +05:30
Nirmal Abraham
6dec23e2d3 fbdev: msm: Avoid UAF in mdss_dsi_cmd_write
In mdss_dsi_cmd_write, a failure in copying the cmds to
'string_buf' can cause an early return. In this case,
the 'pcmds->string_buf' won't be pointing to a valid
buffer. This can lead to use-after-free and memory leak.
To avoid this, assign the newly allocated buffer to
'pcmds->string_buf' after returning from krealloc call.

Change-Id: I286f12c86078d1989cb09453c8a395a4ad94b324
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
2019-10-15 22:42:19 -07:00
Umang Chheda
666e83125b power: battery: Initialize work struct before cancelling work
Votable callback accesses work structure as part of
their callback, initialize work before creation of votables.

Change-Id: I91741b3d54c73aab5c695a31292a32752edc77cd
Signed-off-by: Umang Chheda <uchheda@codeaurora.org>
2019-10-15 11:54:11 +05:30
Linux Build Service Account
c65b958524 Merge "cnss2: Add support for genoa sdio" 2019-10-14 04:48:42 -07:00
Jayachandran Sreekumaran
e5b2b112b3 cnss2: Add support for genoa sdio
Add support for genoa sdio

Change-Id: Icf004d954ca0b508830412da6a381a7844f66efe
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2019-10-14 11:33:53 +05:30
Linux Build Service Account
4b981b7bf7 Merge "ARM: dts: msm: Removed IOMMU test device node for MSM8996" 2019-10-11 13:27:31 -07:00
Gerrit - the friendly Code Review server
a4e2c9c9ee Merge changes into msm-4.4 2019-10-11 05:18:32 -07:00
Arjun Sreenath
4bcdd835f0 ARM: dts: msm: Removed IOMMU test device node for MSM8996
Removed IOMMU test device node for MSM8996 only.

Change-Id: I3197da05da1096cd485b0464fb6ccf87513d927e
Signed-off-by: Arjun Sreenath <asreen@codeaurora.org>
2019-10-11 12:48:49 +05:30
Linux Build Service Account
eef0f89bc7 Merge "defconfig : Enable Configs for MSM8996" 2019-10-10 23:39:05 -07:00
Linux Build Service Account
f0cc9af172 Merge "msm: camera_v2: Avoid halting AXI bridge" 2019-10-10 14:55:36 -07:00
Manoj Prabhu B
e935115d05 diag: Validate msg source length to prevent out of bound access
Place check for mask size and validate source length against
sum of header length and mask size to prevent out of bound access.

Change-Id: I8ac089202b6e3007773b92be8cfdc52fcb30ec3c
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2019-10-09 01:57:01 -07:00
Rama Krishna Phani A
7eea87cef2 msm: pcie: Use local variable for manipulation
There is a chance that wr_offset can be modified to
an arbitrary value as it is a global variable. Have
a local copy of this value and use it for further
manipulation.

Change-Id: If3b76a0dd95e81bd057d89626818c72405f91d65
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
2019-10-03 11:57:10 +05:30
Naitik Bharadiya
fe064e0aca defconfig : Enable Configs for MSM8996
CONFIG_ENABLE_FP_SIMD_SETTINGS :

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

CONFIG_MSM_APP_SETTINGS :

Enable support for app specific setting on MSM8996. This
is required for providing an interface so that app specific
settings can be applied / cleared.

Change-Id: Ife81b927dc58ef5e5fb7a6668286c176f16ad7bf
Signed-off-by: Naitik Bharadiya <bharad@codeaurora.org>
2019-09-30 23:04:53 -07:00
Linux Build Service Account
a8e92fae3a Merge "msm: pcie: Add proper check before accessing variables" 2019-09-30 14:29:17 -07:00
Linux Build Service Account
fbd8673890 Merge "qseecom: correct range check in __qseecom_update_cmd_buf_64" 2019-09-30 05:49:12 -07:00
Shadul Shaikh
590cc98800 msm: camera_v2: Avoid halting AXI bridge
Avoid halting AXI bridge during CPP node close.

Change-Id: I27b2f4a054aa9b910a55f7f6f60ea84f80e3db4d
Signed-off-by: Shadul Shaikh <sshadu@codeaurora.org>
2019-09-30 16:02:02 +05:30
Linux Build Service Account
43226922ac Merge "Merge android-4.4.194 (a749771) into msm-4.4" 2019-09-26 07:32:37 -07:00
Rama Krishna Phani A
ac54df4a79 msm: pcie: Add proper check before accessing variables
Base_sel variable is being accessed with out any check.
Add proper check before accessing base_sel variable.

Change-Id: I31232cc0285bc8cc01d8fa4ee7954bf2f766cbce
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
2019-09-26 18:44:34 +05:30
Sanjay Singh
afa865d588 msm_vidc: Add checks to avoid OOB access(refined)
validate structures and payload sizes in the
packet against packet size to avoid OOB access.

Change-Id: I8a203a81506f603c2e37c1b2a780d3088e6933be
Signed-off-by: Sanjay Singh <sisanj@codeaurora.org>
2019-09-25 23:09:31 -07:00
Linux Build Service Account
b7cf9142ba Merge "msm: kgsl: Disable deprecated ioctls" 2019-09-25 09:17:04 -07:00
Linux Build Service Account
bfe76d44d2 Merge "ARM: dts: msm: Remove GPU min and low svs clocks for MSM8996ProAU" 2019-09-24 11:00:43 -07:00
jitendrathakare
2e14413b3c qseecom: correct range check in __qseecom_update_cmd_buf_64
Make change to validate if there exists enough space to write a
unit64 instead of a unit32 value, in __qseecom_update_cmd_buf_64.

Change-Id: Iabf61dea240f16108e1765585aae3a12d2d651c9
Signed-off-by: jitendra thakare <jitendrathakare@codeaurora.org>
2019-09-24 20:15:28 +05:30
Gerrit - the friendly Code Review server
bbef2c7a60 Merge changes into msm-4.4 2019-09-24 06:19:07 -07:00