Commit graph

46 commits

Author SHA1 Message Date
Vatsal Bucha
279b0b023c qdsp6v2: q6usm: Check size of payload before access
Check size of payload before access in q6usm_mmapcallback.

Change-Id: Iff0672532c2ea40e7129237a92d8365d6b554cf2
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-04-04 23:47:19 -07:00
Vatsal Bucha
f0cc7ca310 qdsp6v2: q6usm: Check size of payload before access
Check size of payload array before access in q6usm_callback.

Change-Id: Id0c85209a053f9dfdb53133aeb6b2510ecf18eb8
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-04-02 14:50:46 +05:30
Xiaoyu Ye
f46f0d774d dsp: codecs: fix range check for audio buffer copying
The range checking for audio buffer copying in function
"audio_in_write" is using the incorrect buffer size.
Change it to the actual allocated audio buffer size.

Change-Id: Ib7aaa2163c0d99161369eb85d09dc2d23d8c787b
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2019-03-11 00:47:25 -07:00
Soumya Managoli
17544a820b dsp: codecs: use native API to configure PCM output block in multiaac
Usage of q6asm_enc_cfg_blk_pcm() does not trigger
PortSettingsChanged event which is required for multi aac component.
Configure the PCM output block using q6asm_enc_cfg_blk_pcm_native()
which ensures that the event gets triggered.

Change-Id: Ieefeead45435840c2ecc1c072e8095785fd4b583
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2018-05-16 12:13:56 +05:30
Tanya Dixit
4273a189a9 drivers: qdsp6v2: Add mutex unlock to properly release lock
Add mutex unlock in function audio_effects_shared_ioctl
at appropriate place to prevent use after free.

CRs-Fixed: 2123291
Change-Id: Ie0d321dc8cc20a295d102a44faea7e5710834932
Signed-off-by: Tanya Dixit <tdixit@codeaurora.org>
2017-11-14 05:18:43 -08:00
Satya Krishna Pindiproli
64289b9b90 ASoC: msm: qdsp6v2: modify API to configure output PCM block
Pass valid channel count and sample rate information to
configure AAC decoder component and modify the API used
to configure the output PCM block when multi AAC decoder
component is used in non-tunnelled mode.

Change-Id: I5938f316a39b722924416b6910e6c8b835e7855e
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
2017-09-07 15:29:36 -07:00
yidongh
76870985af ASoC: msm: qdspv2: initialize struct member before being used
Initialize member value of struct audio_aio_write_param after declaration.

CRs-Fixed: 2091953
Change-Id: Iaf3ff1232e85ae8d26e9d97ce4c2aa3408da7a80
Signed-off-by: Yidong Huang <yidongh@codeaurora.org>
2017-08-22 02:15:34 -07:00
Divya Ojha
7925a540c8 ASoC: msm: qdsp6v2: make audio debugfs read and release exclusive
A thread can read audio debugfs entry while another closes the
device. Protect these operations with a mutex and before read
check audio data to be a valid pointer.

Change-Id: If29a308c1a8329d7befd047d41abe5f6ab626199
Signed-off-by: Divya Ojha <dojha@codeaurora.org>
2017-06-08 03:54:14 -07:00
Siena Richard
fc6defdbbd ASoC: msm: qdsp6v2: extend validation of virtual address
Validate a buffer virtual address is fully within the region for an
extended edge case.

CRs-Fixed: 2049911
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Change-Id: I4c56fdd42336d00a2294a8b7cc17c74606e56be2
2017-05-19 16:19:34 -07:00
Linux Build Service Account
7407b90c6d Merge "ASoC: msm: qdspv2: add result check when audio process fail" 2017-05-03 03:42:38 -07:00
kunleiz
ba9b1ef0a8 ASoC: msm: qdspv2: add result check when audio process fail
A audio_process_event_req is not always to success. Therefore,
check the return value for audio_process_event_req, and
initializ usr_evt before using it.

CRs-Fixed: 2029798
Change-Id: I4adf682575f5f9233a1a1a533f9c6361af8a5bcf
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2017-04-26 17:57:45 -07:00
Alexy Joseph
4bf68bf13c ASoC: qdsp6v2: Remove Eagle code
Eagle driver is not in use any more.
Remove the code and associated calls
to it.

CRs-Fixed: 1103106
Change-Id: Ice5333861beda9538f0783b70b3267523d16fd2b
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
2017-04-24 02:59:28 -07:00
Divya Ojha
c57fa14c6a drivers: qcom: ultrasound: check concurrent device open operations
Make opened device count atomic variable to avoid probable race
condition. Race condition leads to memory leak and list corruption.

Change-Id: I4da98f27d36f616bc8fa7b1a848c20cc7eea04e5
Signed-off-by: Divya Ojha <dojha@codeaurora.org>
2017-04-16 23:12:58 -07:00
kunleiz
6233365c8d ASoC: msm: qdspv2: add mutex to prevent access same memory simultaneously
Add mutex protection to avoid simultaneous access the
same memory by multiple threads.

CRs-Fixed: 2013494
Change-Id: I440ea633ceb7312637c9a3b29d22236166d21a39
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2017-03-28 19:13:01 -07:00
Linux Build Service Account
1fda242d28 Merge "ASoC: msm: qdsp6v2: extend validation of virtual address" 2017-01-31 14:01:06 -08:00
Linux Build Service Account
0e2cc8dce4 Merge "misc: qcom: qdsp6v2: Add range check in function aac_in_ioctl_shared" 2017-01-28 00:47:13 -08:00
Siena Richard
3460635526 ASoC: msm: qdsp6v2: extend validation of virtual address
Validate a buffer virtual address is fully within the region before
returning the region to ensure functionality for an extended edge
case.

Change-Id: Iba3e080889980f393d6a9f0afe0231408b92d654
Signed-off-by: Siena Richard <sienar@codeaurora.org>
CRs-fixed: 1108461
2017-01-16 11:55:40 -08:00
Xiaoyu Ye
1af2bc60da misc: qcom: qdsp6v2: Add range check in function aac_in_ioctl_shared
Add range check for cfg->sample_rate to prevent the user space from
providing an invalid sample rate.

CRs-Fixed: 1108109
Change-Id: I17ccda0901aa4ad84d6e2f78679d71aa327f42eb
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2017-01-12 18:30:09 -08:00
kunleiz
263bb8242e ASoC: msm: qdspv2: add mutex lock when access output buffer length
Add mutex protection to avoid access output_len in parallel.

CRs-Fixed: 1104067
Change-Id: I4e17258e2abee9cd68152f4b79520b00003aa80d
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2017-01-10 22:25:02 -08:00
Arun Kumar Dasari
07c5d36ead misc: qcom: qdsp6v2: register ioctl calls for g711mlaw driver
Add support for ioctl calls registration in g711mlaw driver.

CRs-Fixed: 1094107
Change-Id: Ia5fddfce1f2eebaa08aad0f53cab9c0993b37695
Signed-off-by: Surendar karka <sukark@codeaurora.org>
2016-11-24 21:08:22 +05:30
Arun Kumar Dasari
35f5cc528f misc: qcom: qdsp6v2: modify amr decoder driver
Modify decoder driver for amrwb and amrnb.
Add compat ioctl to support 32-bit architecture.

CRs-Fixed: 1094107
Change-Id: I7d463e4e14c896be33ffb3be418b9f91f49107c5
Signed-off-by: Yamit Mehta <ymehta@codeaurora.org>
Signed-off-by: Surendar karka <sukark@codeaurora.org>
2016-11-24 21:08:09 +05:30
Arun Kumar Dasari
2ca2287f95 misc: qcom: qdsp6v2: add G711 decoder driver
add decoder driver for G711 and define a structure in a
new header which contains G711 specific configuration.
Pass this configuration parameters to the aDSP for
successful decode of G711 content.

CRs-Fixed: 1094107
Change-Id: I5296de4f525adec549c8d51fbf7fc76120b3b4f5
Signed-off-by: Yamit Mehta <ymehta@codeaurora.org>
Signed-off-by: Surendar karka <sukark@codeaurora.org>
2016-11-24 21:07:59 +05:30
Preetam Singh Ranawat
823875c46e audio: add G711 audio encoding support
G711 PCM is a commonly used waveform speech codec.
Add native audio drivers for both G711 mlaw and G711
alaw encoding formats.

CRs-Fixed: 1094107
Change-Id: Ia187948fab9840447b1f5b1ede4e9a1ece0b85c5
Signed-off-by: Preetam Singh Ranawat <apranawat@codeaurora.org>
Signed-off-by: Surendar karka <sukark@codeaurora.org>
2016-11-24 21:07:31 +05:30
Linux Build Service Account
ce631fb608 Merge "drivers: qcom: ultrasound: Lock async driver calls" 2016-11-03 06:24:02 -07:00
Sudheer Papothi
c8c16b7406 drivers: qcom: ultrasound: Lock async driver calls
Adds lock to ioctl and other external calls to driver.
Adds missing null check in __usf_set_stream_param.

Change-Id: I142f31c6bb46d6a394ad012077e1703875a120ad
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-11-02 16:40:43 -07:00
Surendar karka
57260dab56 ASoC: msm: qdsp6v2: Change audio drivers to use %pK
Change all qdsp6v2 audio driver to use %pK instead
of %p. %pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.

CRs-Fixed: 1052832
Change-Id: Id6d45982cbe42a113e58c9b6509eb6ef8064aeef
Signed-off-by: Surendar karka <sukark@codeaurora.org>
2016-10-26 21:07:26 +05:30
Linux Build Service Account
32ed0e480d Merge "ASoC: msm: lock read/write when add/free audio ion memory" 2016-10-14 03:40:32 -07:00
Haynes Mathew George
c9579e0a6b misc: qcom: qdsp6v2: Add missing initialization
Use vars in driver context after proper initialization

Change-Id: I3e59e27534b8e1088d74b42c72e0075d2fe910e6
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
CRs-Fixed: 1049521, 1049615
2016-10-12 15:24:22 -07:00
Walter Yang
b71a087daa ASoC: msm: lock read/write when add/free audio ion memory
As read/write get access to ion memory region as well, it's
necessary to lock them when ion memory is about to be added/freed
to avoid racing cases.

CRs-Fixed: 1071809
Change-Id: I436ead23c93384961b38ca99b9312a40c50ad03a
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
2016-10-12 12:58:13 +08:00
Dhanalakshmi Siddani
a605f4fab2 misc: qcom: qdsp6v2: SSR recovery support for NT decoder
Post ENETRESET error to omx component during SSR.

CRs-Fixed: 1044635
Change-Id: I8c5b8ffc62d34a44bfb47ec4f11477d4320d30a8
Signed-off-by: Dhanalakshmi Siddani <dsiddani@codeaurora.org>
2016-09-16 03:18:20 -07:00
Karthik Reddy Katta
287879c3be ASoC: msm: Add Buffer overflow check
The overflow check is required to ensure that user space data
in kernel may not go beyond buffer boundary.

CRs-Fixed: 1064411
Change-Id: I54c28a8942cf1a6a47a4e8272f3159b35d753ead
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
2016-09-10 04:49:15 -07:00
Linux Build Service Account
981a0eae00 Merge "ASoC: qdsp6v2: Add proper dependency for audio driver" 2016-09-09 01:26:10 -07:00
Linux Build Service Account
39dfe0cc0a Merge "misc: qcom: qdsp6v2: initialize config_32" 2016-09-09 01:26:02 -07:00
Asish Bhattacharya
8702e196da ASoC: qdsp6v2: Add proper dependency for audio driver
Add qdspv6v2 and snd_soc_compress dependencies for
audio driver to fix compilation issues on msmfalcon_32.

CRs-Fixed: 1061427
Change-Id: Iac276eeec710a11e5feeb6899da121ca6324e19b
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2016-09-07 11:58:22 +05:30
Laxminath Kasam
4e13ee8d6f misc: qcom: qdsp6v2: initialize config_32
Not all memebers of config_32 are set before they are used which
might lead to invalid values being passed and used. To fix this issue
initialize all member variables of struct config_32 to 0 before
assigning specific values individually.

CRs-Fixed: 1058826
Change-Id: Ifea3a6e8bf45481c65a4455ee64318304798fee2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-09-01 16:35:36 +05:30
Siena Richard
94cae80780 misc: qcom: qdsp6v2: initialize wma_config_32
Not all memebers of wma_config_32 are set before they are used which
might lead to invalid values being passed and used. To fix this issue
initialize all member variables of struct wma_config_32 to 0 before
assigning specific values individually.

Change-Id: Ibb082ce691625527e9a9ffd4978dea7ba4df9e84
CRs-Fixed: 1054352
Signed-off-by: Siena Richard <sienar@codeaurora.org>
2016-08-18 14:37:57 -07:00
Siena Richard
5feda7e458 ASoc: msm: fix out of bounds array access
Check that the array index value is less than the max array size
to avoid an out of bounds array access.

CRs-Fixed: 1037903
Change-Id: I2e357fd60c03833aed48a815794729fabfcfcf93
Signed-off-by: Siena Richard <sienar@codeaurora.org>
2016-07-14 12:43:56 -07:00
Ben Romberger
ad4a2b5368 misc: qcom: qdsp6v2: Return flush errors to user space
Return errors from the flush function including
the caller of the flush ioctl.

CRs-fixed: 1027784
Change-Id: I7ec578b42f50b6ce2f2738193c622c8a2f01ecd8
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
2016-06-27 19:53:06 -07:00
Weiyin Jiang
7966b0d08e ASoC: msm: audio-effects: fix stack overread and heap overwrite
Fix overwrite of updt_params allocated in heap, and stack overread
where param pointer is passed from user space.

CRs-Fixed: 989628
Change-Id: Ida8bdb7da2fcb97023dce3b6eafe4b899a51cb66
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
2016-05-06 12:06:24 -07:00
Vidyakumar Athota
d886b34289 msm: ultrasound: Various static analysis fixes
Remove potential null dereference.
Remove dead code from impossible error check.
Set upper bound for user-provided buffer size.

Change-Id: I212f3edfa31e9168d11e0782da7f3fd8c2b98c5d
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2016-05-06 12:06:20 -07:00
Weiyin Jiang
9847f9ca84 ASoC: msm: audio-effects: misc fixes in h/w accelerated effect
Adding memory copy size check and integer overflow check in h/w
accelerated effect driver.

Change-Id: I17d4cc0a38770f0c5067fa8047cd63e7bf085e48
CRs-Fixed: 1006609
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
2016-05-03 15:52:37 -07:00
Shiv Maliyappanahalli
8bc5414b74 ASoC: msm: qdsp6v2: use session id for token value
Read commands are currently assigning 64bit physical address
to 32bit token. There is a possibility that this physical address
may have same lower 32bit values which could cause errors. Fix
by assigning session id as the token value.

Change-Id: Ie704e34338201ecec191b2031d20552691aed3ea
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
2016-04-12 15:49:49 -07:00
Shiv Maliyappanahalli
6a9927bfd7 ASoC: msm: qdsp6v2: use token for tracking no wait cmd
Use tokens to track all active no wait commands.
In ASM driver, certain commands are waited on to get response
from ADSP. There is a possibility that certain no-wait
commands can be improperly recognized and woken up leading
to time outs.

Change-Id: I2030a354493845b63cf92d35ca4eaadef38cfb79
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
2016-04-12 15:49:48 -07:00
Phani Kumar Uppalapati
f6c9eb5139 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>
2016-03-23 21:15:54 -07:00
Laxminath Kasam
6d4b0deeb6 ASoC: audio: update API name for populate upper 32bits
In audio ion driver, append msm_audio_ to API
populate_upper_32bits to maintain consistency
across other API names in this driver.

Change-Id: I72aace56bf8e80c6dd83f768876253d2c7f334bb
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-03-23 21:13:03 -07:00
Sudheer Papothi
be1a516dcb ASoC: msm: Add Audio drivers for MSM targets
Add snapshot for audio drivers for MSM targets. The code is
migrated from msm-3.18 kernel at the below commit/AU level -

AU_LINUX_ANDROID_LA.HB.1.3.1.06.00.00.187.056
(e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1)
(Promotion of kernel.lnx.3.18-151201.)

Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:11:25 -07:00