Commit Graph

44 次程式碼提交

作者 SHA1 備註 提交日期
Prasad Kumpatla
8d79e00ae1 dsp: address memleak in msm_audio_ion_map_kernel
dma_vmap is not freed in else case of is_iova, so kfree dma_vmap
when is_iova is false. And also if dma_buf_vmap kernel map is
failed, need to end cpu access dma buf.

Change-Id: I111fb7a2a367a8418f46a7b5fc1459d135d7115e
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-04-09 23:35:34 -07:00
Phani Kumar Uppalapati
7370c9bf8d audio: Switch to qcom_scm_assign_mem() from hyp_assign_phys()
Switch to upstream friendly qcom_scm_assign_mem from hyp_assign_phys.

Change-Id: I4a4a798c2f3fb05a3be1ec99cccbd05b6c940903
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-03-20 15:55:02 -07:00
Prasad Kumpatla
934cadd456 dsp: add lock in ion free to avoid use after free
add lock in ion free to protect dma buff and avoid
use after free.

Change-Id: I6376408ce1a5b98b7aeacc32e44ec4db08ff9df5
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-02-09 09:56:57 -08:00
Akhil Karuturi
f8f8f14c93 dsp: fix miscellaneous defects
Fix syntax errors and spacing issues.

Change-Id: I793af41a9a72301de4200e57278b5bd8ddc018a6
2022-12-29 05:04:32 -08:00
Ranjith
a241af4cf8 dsp: audio_ion: Add checks before memmory access
-Add check for memory access in msm_audio_ion_crash_handler

Change-Id: Idd7a51578260b2779c72040d99483de453c4330e
2022-11-21 01:28:07 -08:00
Yuhui Zhao
8891411636 audio-kernel: Replace struct dma_buf_map with struct iosys_map
Replace struct dam_buf_map with struct iosys_map and
Delete nonexistent header files and API calls.

Change-Id: I04f87dc9739b487b5a4fb7d7bb615198c27b9925
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-10-06 22:57:55 -07:00
Shiv Maliyappanahalli
964187d31d dsp: fix issues related to caching of dma_vmap data
Local variable is used for dma_vmap and same value is used for caching
which becomes invalid after going out of scope. Store in heap instead.

Change-Id: I2e291137dd461d0cdb49209a6c1d804f1e806457
2022-02-10 18:50:33 -08:00
Vikram Panduranga
d42016b9c4 dsp: call hyp_assign during clean up
If the userspace which has allocated & hyp assigned the CMA
memory crashes, the crash handler is just freeing the memory
without calling hyp assign to get access back. This leads
to crash when freeing the memory as HLOS driver does not have
access to memory.

Fix this by calling hyp_assign to get access back to
HLOS driver.

Change-Id: Ic04736cf241eb7e310b8ce0af260e147f4d1edc6
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
Signed-off-by: Akhil Karuturi <akarutur@codeaurora.org>
2021-11-23 23:59:20 -08:00
Junkai Cai
d51e529a44 dsp: update audio ion driver to support new kernel
dma buffer virtuall mapping API has been updated in the kernel
update the ion driver to match the new interface

Change-Id: I3aab0609b91da7efcfb03dac99961ace498d79f3
Signed-off-by: Junkai Cai <junkai@quicinc.com>
2021-10-28 16:51:22 -07:00
Vikram Panduranga
1873045b4d dsp: remove ION_FLAG_CACHED for DMA buf heap
ION_FLAG_CACHED is no longer supported for DMA
buf heap. Remove cache maintenance as it can be
counter productive for CMA memory.

Change-Id: I13c58a4304269c6140fbca891cf718ab6a0eb2fe
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2021-07-06 09:25:56 -07:00
Meng Wang
f16860d03a dsp: audio_ion: add lock for msm_audio_ion_crash_handler
msm_audio_fd_data can be freed in msm_audio_delete_fd_entry and
msm_audio_ion_crash_handler.Add lock for msm_audio_ion_crash_handler
to avoid race condition during removal of msm_audio_fd_data and dereference.

Change-Id: I49dc0a1aca45ffad76b39e06fe075185d4281d00
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-05-18 16:29:11 +08:00
Vikram Panduranga
9ec6a7fe92 dsp: remove export symbol for static functions
Export symbol cannot be added for static functions.

Change-Id: Ief55b7868f2c16e5a11681e24432561d45765e52
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2021-03-24 10:31:39 -07:00
pavanisr
ba39b85277 dsp, ipc: add fluence NN changes
Change-Id: Ie8323156c74601333871646052068a609c7cf474
2021-03-19 16:22:04 -07:00
pavanisr
e8e79f3322 dsp: remove global msm_audio_ion_private_data
Change-Id: I2903b19295695c91d62fa5bbb8a9c9c884dfaf98
2021-03-18 12:00:07 -07:00
pavanisr
3f099a7afc dsp: clean up unnecessary apis
Change-Id: I6e92fcea9a7185bd1bc7c47ca16270641fd471de
2021-03-18 11:24:38 -07:00
Phani Kumar Uppalapati
b15db3b6c8 Merge commit 'd9fa9d435ba1b92cf0f0361a0749107b7abc45a5' into audio-kernel-5-4.lnx.1.0
Change-Id: Iaf98532030ee4ef5fe6a70df083a685733dd5670
2020-11-05 19:15:07 -08:00
Saurav Kumar
9ec95bb9c8 dsp: add change to fix use-after-free issue
Add change to properly handle the pointers by setting them to
NULL after free and adding some null checks before dereferencing.

Change-Id: I3e52b9a6885a8d8a91c09f75fe92ba69e3eb555f
Signed-off-by: Saurav Kumar <sauravk@codeaurora.org>
2020-09-11 01:58:16 -07:00
Vidyakumar Athota
584244b6ac Merge commit '5efb3a4ee3959f20ed2b697663205ec9a6bd1e5c' into audio-kernel-5-4.lnx.1.0
Change-Id: I58fbdf6b91c33ab5d147efbe5f5706616052c7fe
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2020-09-06 18:25:28 -07:00
Kunlei Zhang
d9bf6df220 dsp: add support for CMA heap allocation during call
Add support for CMA heap allocation during call.

Change-Id: I65cd291a9db56bf53d9bb9b4e6c7236da9d7288c
Signed-off-by: Kunlei Zhang <kunleiz@codeaurora.org>
2020-07-27 11:53:28 +08:00
Phani Kumar Uppalapati
bc326d21fd audio-kernel: upgrade to ar/spf changes
Rename casa to ar and gecko to spf in audio-kernel.

Change-Id: Ia37ee0497ce043443ca70131d2739737cb8f0366
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2020-06-25 00:39:53 -07:00
Taha Azzaoui
6c8bf95ddf gecko compliant drivers
Change-Id: I5f19da1472a0e90cc5d16459b5367dc07ec2f28b
Signed-off-by: Taha Azzaoui <tazzaoui@codeaurora.org>
2020-06-25 00:27:26 -07:00
Vignesh Kulothungan
76d80b53ac dsp: update ion alloc header file
Update the header file which defines ion allocation
in kernel 5.4.

Change-Id: I1dc09c32bf5ea611ba0e49c670d4dd32206dc1b3
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-12-27 11:20:57 -08:00
Xiaojun Sang
ab07f12b3a dsp: ion: unmap DMA buffer after kernel ion map failure
DMA buffer does not unmap after kernel ion map failure. It leads
to unexpected vaddr and memory leak.

Change-Id: I363dd9178a0bcbca601180bfd0a7bd7ef2430d3e
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-07-01 14:14:37 +08:00
Xiaojun Sang
53cd13a1ab ASoC: hide bind/unbind in sysfs
Exposure of driver bind/unbind to userspace via sysfs may
lead to unexpected behavior.
Hide bind and unbind by driver attribute.

Change-Id: I20d6ee653bcc16af15d6368664aaf240c6645cd0
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-05-17 15:00:33 +08:00
Meng Wang
688a867091 asoc: Update file header to GPL-2.0-only
Update file header to GPL-2.0-only.

Change-Id: If16bf92f951c6d7521f56a3e9b91da2ca2ccf6f8
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-01-29 13:43:33 +08:00
Vikram Panduranga
24efd2a62e dsp: add dma map resource cmd
Add a new API for mapping DMA resources
that needs to be attached to existing
SMMU SID.

Change-Id: I7a513d24ea30a5ead318e856e4c5317743fd0021
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2019-01-24 17:44:04 -08:00
Meng Wang
04dff94720 dsp: ion: Remove smmu initialization
SMMU initialization is not required to be done in client
probe process. SMMU framework takes care of creating
domain and attaching device. Remove related code from
audio ion driver.

Change-Id: I3756c5abb7488afb43e20fae698c7008461a18cb
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-09 22:44:08 -08:00
Meng Wang
61af6849e9 ASoC: switch audio drivers to SPDX identifier
Switch audio drivers to SPDX identifier on msm-4.19.

Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-07 15:47:32 +08:00
Laxminath Kasam
61cd502c9d dsp: audio_ion: Update IOVA start address from dt entry
In sm6150, LPASS has Agg NOC before SMMU transactions.
Agg NOC has HW limitation which considers IOVA as
physical DDR address and resulting in failure
for particular memory range. Update IOVA address
start address for audio to use different range.

CRs-Fixed: 2346788
Change-Id: Ieac3b8bdd6295a56039d9bca422d2f41e0d94944
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-11-16 17:29:23 +05:30
Karthikeyan Mani
9c69ccfce6 dsp: msm_audio_ion: unmap dma only if unmap kernel succeeds
If buf unmap is executed without successful kernel unmap
the vmap counter mismatches. Check for error scenarios in
kernel unmap function and ignore buf unmap if not necessary.

Change-Id: I3c5835dcdfe05db4baaa5cf904995ed8f89e9cfe
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2018-10-15 17:41:45 -07:00
Aditya Bavanari
542582cba2 dsp: support mdf memory share cmd
Add support for MultiDSP framework (MDF) memory
share command in q6core driver.

Change-Id: Iff0da10fe835f1fce50d2725960ded5c96237955
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-08-06 19:45:45 +05:30
Banajit Goswami
bfc919ea43 dsp: msm_audio_ion: check only for probe complete for ION alloc
While allocating and importing ION buffers, make sure to check
for probe complete flag before proceeding instead of checking for
the flag AND smmu_enabled flag. This way the restriction will be
centralized for either types of targets with and without SMMU.

Change-Id: I558e19724d1002a602377a636e274bc90ca8262d
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-06-28 15:22:17 -07:00
Banajit Goswami
ce6e7805bd dsp: msm_audio_ion: store device pointer locally for all cases
Device pointer needs to be stored during probe of msm_audio_ion
platform driver so that the same can be used later for mapping
dma_buff allocated for different clients. Store device pointer
for both cases where SMMU may be present or absent on a particular
platform.

Change-Id: I3d3d4ad254d41ac9490ff0dc98b95ffbc3e5042d
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-04-25 22:29:47 -07:00
Banajit Goswami
f6077636ee dsp: msm_audio_ion: add ION support for targets without SMMU
ION memory allocator is used for audio use cases even on targets
without SMMU. Add support for ION on those targets where ADSP
might not have an SMMU in front of it.

Change-Id: Iaacbd66edb32c8ee7c14a5ab291abe54960725b8
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-03-28 12:48:25 -07:00
Banajit Goswami
293afe4ad4 dsp: msm_audio_ion: update logic to pass pointer by reference
Update logic for pointer meant to hold virtual address of ION
buffers allocated, so that the pointer is available across
function boundary.

Change-Id: I7849498b9ccf0cbd7c357fa926eea6c4b65a194f
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-03-16 23:40:30 -07:00
Linux Build Service Account
a28bde15f0 Merge "dsp: msm_audio_ion: use dma_buf_vmap for mapping dma_buf to kernel" 2018-03-14 19:49:03 -07:00
Banajit Goswami
80b67f4e39 dsp: msm_audio_ion: use dma_buf_vmap for mapping dma_buf to kernel
Use the newly added dma_buf_vmap API for mapping a dma_buf
to kernel address space.

Change-Id: Idacada71eb827b4af96a793a180456ae910e30e8
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-03-09 16:40:36 -08:00
Banajit Goswami
d188b9586c dsp: update dma_buf cache ops
Update the API call sequence for cache operation for dma_buf.

Change-Id: I79ee36d083460b47c792120a857e92f26d9e3fe2
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-03-03 01:24:56 -08:00
Banajit Goswami
0f1f3f6d04 dsp: add cache operations for dma_buf
Add support for querying ION flags for dma_buf and for cache ops
on dma_buf with CACHED Flag on.

Change-Id: I219e564c477af8ba3b8676db1c9555a2b5b9ebab
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-02-04 03:43:17 -08:00
Banajit Goswami
08bb73698a dsp: update MSM Audio ION wrappers to align with upstream
Between Linux-4.9 and Linux-4.14, upstream has updated the
ION APIs significantly to make ION ready to bring out of
staging folder. This has changed the way ION and dma_buf
APIs used to work together for allocating, mapping and
deallocating ION buffers.
Update MSM Audio ION wrapper functions used by audio drivers
to reflect these ION API changes as per upstream ION.

Change-Id: I63097e147a397aa3a538f69ac88b6fb10871c3dc
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-02-04 03:41:06 -08:00
Asish Bhattacharya
5faacb3a7e ASoC: allow drivers to compile both static and dynamic
Based on where the code is synced the driver should allow
both static and dynamic linked compilation.
Also remove __exit for modules loaded from another common
init/exit functions.

Change-Id: Ib58f152002aba3af4446f9bbd9b82c279212bd0a
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2017-12-07 19:57:27 +05:30
Xiaoyu Ye
a87e56ddf2 dsp: sdxpoorwills: fix compilation issue
Variable 'vm_page_prot' has different types in different
ARM platforms. Using macro "pgprot_val" to handle it to
fix compilation issue for sdxpoorwills targets.

Change-Id: Ic7b8de9860759cc56812e7a3ffb1aaea2b6779f9
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2017-11-16 02:50:54 -08:00
Laxminath Kasam
8b1366a648 Audio: DLKM support for all audio modules
Switch to DLKM for all audio kernel modules.

Change-Id: I6a96023a21f655f873531af9ace81f2b01eb0f58
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-11-02 13:42:09 +05:30
Laxminath Kasam
605b42f92c audio-lnx: Rename folders to new flat structure.
Kernel audio drivers can be categorised into below folders.
asoc - ALSA based drivers,
asoc/codecs - codec drivers,
ipc - APR IPC communication drivers,
dsp - DSP low level drivers/Audio ION/ADSP Loader,
dsp/codecs - Native encoders and decoders,
soc - SoC based drivers(pinctrl/regmap/soundwire)

Restructure drivers to above folder format.
Include directories also follow above format.

Change-Id: I8fa0857baaacd47db126fb5c1f1f5ed7e886dbc0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-08-18 16:56:12 -06:00