Commit graph

1512 commits

Author SHA1 Message Date
Dhoat Harpal
10181e6279 soc: qcom: glink: Free if_ptr before freeing dummy transport
Dummy transport is only way to access if_ptr. When dummy
transport is freed, if_ptr allocated for dummy transport is
not freed. This result in memory leak.

kfree of if_ptr is called before freeing dummy transport.

CRs-Fixed: 2116744
Change-Id: I832e0fcde418b7c3d992f50e817866bc9075da3c
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2017-09-28 07:57:52 -07:00
Dhoat Harpal
664fcc0919 soc: qcom: glink: Free data memory before freeing intent
Data of intent is not freed even in purge_intent_list. This results
in memory leak.

Kfree is done for data before freeing intent.

CRs-Fixed: 2116744
Change-Id: Ib99261208df1cc9b63b4cd0a35ac0c7942efb4a8
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2017-09-28 07:57:21 -07:00
Amir Samuelov
aef18b277c spcom: spcom_get_next_request_size() unlock while waiting for rx data
spcom server app might open the channel before the SP client app.
The asynchronous CONNECTED callback might be called while the server
is waiting for data.
Avoid locking the channel while waiting for data to avoid dead lock
while handling the CONNECTED callabck.

Change-Id: I7c576f240b60720a6f1461b3e48f4422c110e7c4
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2017-09-28 00:41:26 -07:00
Amir Samuelov
7ced3825df spcom: avoid using stale glink handle
spcom_notify_state() is a callback called by glink upon channel connect.
It is asynchronous callback, that might be called after glink_close().
Avoid storing stale glink handle in such case.

Change-Id: I10359f38ca48f618899673f677a6409b01bc6618
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2017-09-28 00:39:07 -07:00
Kaushal Kumar
dc81965316 soc: qcom: pil: Avoid possible buffer overflow
MBA image size comparison check is currently being
done with a signed count whose value can possibly be
negative. If count value is negative then comparison
will always succeed and invoke memcpy with incorrect
value of count leading to buffer overflow. Fix this
by not using signed comparison.

Change-Id: Id2d0cafae01f940f36cfd559d4656fc0f022d6a5
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
2017-09-27 04:41:48 -07:00
Avaneesh Kumar Dwivedi
64b52f80aa soc: qcom: Create additional ramdump device node for SSR minidump
This change add a new ramdump device node which is only used to collect
SSR minidump by ramdump process.

Change-Id: I3af5c15798d3c74896a499c8db30e5733743f106
Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
2017-09-20 12:29:58 +05:30
Avaneesh Kumar Dwivedi
d0a863a26a soc: qcom: Optimize minidump collection check and add debug log
This change does additional checks for more imem ToC entries
before invoking minidump.
This change also add few debug logs to ease process of debugging.

Change-Id: Ie70301d70fe85ec9f85573c0167098319c2b1cfe
Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
2017-09-19 05:04:56 -07:00
Vidyakumar Athota
34b0260fbc soc: qcom: fix out of bounds read issue
If userspace sends non-null terminated channel name then
out of bounds read is possible while printing channel name.
Fix this issue by validating channel name before use.

Change-Id: I418b7f446c6a849450dd4314592c1d3810163bdc
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2017-09-18 16:07:39 -07:00
Arun KS
972d901c7c soc: qcom: pil: set device dma mask as 32 bit
APPS interact with MPSS through 32 bit register interface.
Set dma mask for 32 bit so that mba and mdt memory are allocated
from 32 bit physical address range.

Change-Id: I623f00097d464b1bdd8f609e2d6c9a126f4bea4d
Signed-off-by: Arun KS <arunks@codeaurora.org>
2017-09-13 22:05:08 -07:00
Linux Build Service Account
8027efd3cc Merge "soc: qcom: initialize glink link state" 2017-09-08 22:04:14 -07:00
Linux Build Service Account
e91bfdb176 Merge "soc: qcom: ipc_router_glink_xprt: Add wakeup source in RX path" 2017-09-05 13:45:23 -07:00
Linux Build Service Account
c607ed2561 Merge "spcom: avoid implicit casting from size_t to uint32 for file ops" 2017-09-04 06:37:55 -07:00
Linux Build Service Account
a65b91a0c4 Merge "soc: qcom: dump current task stack and task_struct for minidump" 2017-09-04 06:37:51 -07:00
Linux Build Service Account
78cc6c172a Merge "Merge branch 'dev/msm-4.4-8996au' into msm-4.4" 2017-09-03 23:04:20 -07:00
Amir Samuelov
b5b4f0eb8d spcom: avoid implicit casting from size_t to uint32 for file ops
spcom expose "pseudo file" char-device to user space.
The file operation callback function definition is using size_t for user
buffer size.
The spcom API uses uint32 as the spcom communication buffers are about
300 bytes, and the user space file operation read()/write() are limited to
PAGE_SIZE which is about 4KB.
Use explicit casting rather than implicit casting when fops callbacks
calls spcom internal functions.

CRs-Fixed: 2025174
Change-Id: I5d6bf71ab77f97ea350178bb8b3473fd4cefddfd
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2017-09-03 03:12:59 -07:00
Chris Lew
3be5a5a839 soc: qcom: smp2p: spinlock_test: Initialize work item
Initialize the has_locked member before running SSR
spinlock test to ensure consistent results.

CRs-Fixed: 2091946
Change-Id: Ifad37541a94668b496aa9204dc80920b9a7ff244
Signed-off-by: Chris Lew <clew@codeaurora.org>
2017-09-01 11:10:55 -07:00
Lingutla Chandrasekhar
af5a88a343 soc: qcom: dump current task stack and task_struct for minidump
Register the current stack and task_struct of all cpus to
the minidump table on panic.

Change-Id: I6906721f8c734dbf8142dc49e80dc730530f028c
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2017-09-01 02:51:08 -07:00
Zhiqiang Tu
c140ef0eee Merge branch 'dev/msm-4.4-8996au' into msm-4.4
Change-Id: I9736089c23ce5dca4e4341406671269f19b7515f
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2017-09-01 10:30:44 +08:00
Vidyakumar Athota
ff6c6abc1b soc: qcom: initialize glink link state
Initialize glink link state to GLINK_LINK_STATE_DOWN to
return error if userspace sends glink command packet
before glink link is up.

Change-Id: I79b5e4eb5a743dd0b118ba1b28523bfea24044d7
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2017-08-31 16:34:52 -07:00
Linux Build Service Account
c762445edd Merge "soc: qcom: glink: Initialize dummy xprt with dummy functions" 2017-08-30 19:30:03 -07:00
Linux Build Service Account
7392248e79 Merge "soc: qcom: Add SSR minidump provision for subsystem ramdump" 2017-08-30 06:26:15 -07:00
Linux Build Service Account
e53deedd20 Merge "icnss: Fix uninitialized variable" 2017-08-29 21:19:34 -07:00
Avaneesh Kumar Dwivedi
88707fb091 soc: qcom: Add SSR minidump provision for subsystem ramdump
Minidump is concise and bare minimum dump to enable technology
teams to debug most of subsystem issues. This change adds required
driver code changes to provide support of subsystem minidump.

Increase PIL timeout to give MBA more time for encryption
and decryption for modem segments.

Change-Id: I1d04a9306ce507bc610777bc476197f26c1e18ac
Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
2017-08-29 03:49:48 -07:00
Amir Samuelov
df572ff0bc spcom: fix memory leak in spcom register client / register service API
free allocated memory in error handling of spcom_register_client()
and spcom_register_service() kernel API.

Change-Id: Ieb5787cb1a11d4b3320237fa8cdde3dc357d9084
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2017-08-28 06:10:40 -07:00
Dhoat Harpal
4b6bee8a8a soc: qcom: ipc_router_glink_xprt: Add wakeup source in RX path
In function glink_xprt_notify_rxv work item is queued without
wakelock. This allows system to go in suspend state without
scheduling this work item.

Wakelock is taken to avoid system suspend before workqueue
execution.

CRs-Fixed: 2098623
Change-Id: Ic5f74dbb4bf315f1cb6aa528367a6fb80e8a11b6
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2017-08-28 16:42:40 +05:30
Linux Build Service Account
d4a8f9c9ca Merge "spcom: return POLLERR when poll() has error" 2017-08-24 06:14:31 -07:00
Zhiqiang Tu
ac693094e7 qcom: scm_qcpe: update function return value and input parameter type
Update the function return value and input scm_ret variable
type for restore secure configuration in scm_restore_sec_cfg() fn.
Adding scm_ret input variable for scm_get_feat_version() fn.

Change-Id: I5fff488f973b018f898eef616801a4b5e5a900fb
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2017-08-24 16:47:25 +08:00
Zhiqiang Tu
9df1d44946 Merge branch 'msm-4.4' into dev/msm-4.4-8996au
Conflicts:
	drivers/iommu/arm-smmu.c
	drivers/media/platform/msm/ais/fd/msm_fd_dev.c
	drivers/media/platform/msm/camera_v2/fd/msm_fd_dev.c
	drivers/soc/qcom/glink.c
	include/uapi/linux/msm_ipa.h

Change-Id: Id007a850fa2df09f08c413ffcd447a6532fad83c
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2017-08-24 16:39:56 +08:00
Linux Build Service Account
5739675594 Merge "icnss: Do not process FW messages after Modem shutdown" 2017-08-23 20:24:56 -07:00
Linux Build Service Account
0b199b966f Merge "soc: qcom: glink_spi_xprt: Remove extra SPI transactions" 2017-08-23 20:24:49 -07:00
Linux Build Service Account
f61a791dc1 Merge "ASoC: msm: qdspv2: add an API to destroy ion client" 2017-08-23 20:24:47 -07:00
Linux Build Service Account
c3af8979a6 Merge "ASoC: APR: initialize struct member before being used" 2017-08-23 20:24:45 -07:00
Sameer Thalappil
1b2a982b4f icnss: Do not process FW messages after Modem shutdown
During Modem graceful shutdown, QMI messages from WLAN FW can
still be delivered to host even after icnss receives Modem
shutdown notification from SSR framework. So prevent processing
any such messages from FW after Modem shutdown.

CRs-Fixed: 2095386
Change-Id: Ice21d043393b0f7b97aaccd68e1b28702cc9e393
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
2017-08-23 12:57:39 -07:00
Amir Samuelov
f7c2ad0fb8 spcom: return POLLERR when poll() has error
spcom_device_poll() return POLLERR rather than -EINVAL.

Change-Id: Ifce0fa9c6a0a5136ae1d109543a9345ad77359bf
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2017-08-23 00:02:48 -07:00
Anurag Chouhan
123604f4fd icnss: Fix uninitialized variable
As part of optimization in msa permissions assignment
source and destination vmids are introduced as uninitialized
arrays.
The fix is for initialization of the array as zero initially
so that variables doesnot have the garbage value from the stack.

Change-Id: Ie30d61f3be9ed5a5a2cef2e63348d987e894c22a
CRs-fixed: 2096940
Signed-off-by: Anurag Chouhan <achouhan@codeaurora.org>
2017-08-22 23:09:10 -07:00
Srinivas Ramana
6f062b7e60 socinfo: Add support for SDM/A 636 SOCs
Add socinfo support and CPU IDs for SDM636
and SDA636 SOCs.

Change-Id: If14654c3fb93a52e4db0270e60cb6e6371ef077f
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2017-08-22 22:43:13 -07:00
Prakash Burla
5a713f928f soc: qcom: Add hypervisor abstraction driver
This new driver is meant to be a cross-platform abstraction
layer for utilizing the underlying hypervisor system.
This API can be accessed from both user and kernel sides.
The intended users of this are the multimedia drivers who want
to communicate with the host OS to use the multimedia hardware.

Conflicts:
	drivers/soc/qcom/Kconfig
	drivers/soc/qcom/Makefile
	include/uapi/linux/Kbuild

Change-Id: I37743df490d14249a9d378225771367750899eb0
Signed-off-by: Edward Lee <eleekimk@codeaurora.org>
Signed-off-by: Yimin Peng <yiminp@codeaurora.org>
2017-08-22 19:39:11 -07:00
Chris Lew
5295824c33 soc: qcom: glink_spi_xprt: Remove extra SPI transactions
The TX FIFO write reg and the RX FIFO read reg are controlled
by this processor. Keep track of the state of these two indexes
to reduce the amount of SPI reads.

CRs-Fixed: 2093123
Change-Id: I4ffa0e08bce6dabd57f33a13fef8107211ce3f09
Signed-off-by: Chris Lew <clew@codeaurora.org>
2017-08-22 15:25:58 -07:00
yidongh
4c78ad9740 ASoC: APR: initialize struct member before being used
Initialize member value of struct apr_client_data after declaration.

CRs-Fixed: 2091948
Change-Id: I8a185ebd4126f7d064de90bf652bc96c2ab7b408
Signed-off-by: Yidong Huang <yidongh@codeaurora.org>
2017-08-22 01:36:18 -07:00
Vidyakumar Athota
e4faef1e35 ASoC: msm: qdspv2: add an API to destroy ion client
Currently ion fd is used to extract ion handle to free ion client.
ION FD is not valid if user-space application is crashed so ion handle
is returned to the client during msm_audio_ion_phys_assign() API which
is used to destroy ion client in msm_audio_ion_phys_free() API.

Change-Id: Idcc4ca838741aac26662a679117af9d9c935e630
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2017-08-21 10:56:56 -07:00
Dhoat Harpal
e8574a4350 soc: qcom: glink: Initialize dummy xprt with dummy functions
Few function pointers are left uninitialized in dummy transport.
System can crash if these function pointer get dereferenced.

Initialize all the function pointers which can get called, with
dummy functions.

CRs-Fixed: 2067859
Change-Id: I9172776d9ffa0af5deb9898125fc6403fdcdee0f
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2017-08-21 21:05:29 +05:30
Linux Build Service Account
e235763c9f Merge "icnss: Add support to validate the result and error code" 2017-08-21 00:20:11 -07:00
Linux Build Service Account
2a003c6ab4 Merge "soc: qcom: glink_smem_native_xprt: Fix memory leak during qos init" 2017-08-21 00:20:09 -07:00
Linux Build Service Account
2d27540111 Merge "soc: qcom: Modify scm_qcpe to comply with new hab API" 2017-08-21 00:19:48 -07:00
Anurag Chouhan
6c6fb7901e icnss: Add support to validate the result and error code
Add support to validate the result and error code
received from the WLAN firmware service.

CRs-fixed: 2095184
Change-Id: I454df58e293fbf2d99601d1c6820e67b5cae370c
Signed-off-by: Anurag Chouhan <achouhan@codeaurora.org>
2017-08-18 17:01:19 +05:30
Dhoat Harpal
40fa8e0735 soc: qcom: glink_smem_native_xprt: Fix memory leak during qos init
In function parse_qos_dt_params, memory is allocated to arr32 but it
is never freed.

Free memory when exiting the function.

CRs-Fixed: 2093722
Change-Id: Ic1fc58c6685990e2865ef4033b54303d47311560
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2017-08-18 15:53:51 +05:30
Amit Blay
392569ef70 soc: qcom: Modify scm_qcpe to comply with new hab API
Changes to reflect  slight change in HAB API return values.

Change-Id: I8825f6fca6a50449a929f05c317d0beeb6908d26
Signed-off-by: Amit Blay <ablay@codeaurora.org>
2017-08-17 00:22:59 -07:00
Amit Blay
a87f53981a soc: qcom: Modify scm_qcpe to comply with new hab API
Changes to reflect  slight change in HAB API return values.

Change-Id: I8825f6fca6a50449a929f05c317d0beeb6908d26
Signed-off-by: Amit Blay <ablay@codeaurora.org>
2017-08-16 23:04:32 -07:00
Abir Ghosh
c9cf0e7a71 qbt1000: Add changes to support VOLUMEDOWN and CBGE
Add changes to qbt1000 fingerprint driver to enable
input device to report KEY_VOLUMEDOWN when a finger
is detected. Add changes for supporting CBGE with
retry logic and multiple IPC messages.

Change-Id: I29a52c516a8f9216abc623ca3bfaebe19f89eaa3
Signed-off-by: Abir Ghosh <abirg@codeaurora.org>
2017-08-16 11:15:43 +05:30
Linux Build Service Account
9a34ec62d2 Merge "ASoC: msm: qdsp6v2: assign decoder memory to ADSP" 2017-08-11 16:23:49 -07:00