Commit Graph

743 Commits

Author SHA1 Message Date
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
Yuhui Zhao
19b039aa73 asoc: add config files to support pineapple target
add pineapple config file to all drivers:
Kbuild, including soc/dsp/ipc

Change-Id: I2357c7c96739bd42cb8764753d2a4fd5dd1c9634
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-10-07 11:24:42 +05:30
Yuhui Zhao
1dacaf014f audio-kernel: Compilation fixes with "Break" and "fallthrough"
Compilation fixes with "Break" and "fallthrough".

Change-Id: Ica05d0410efc5e9dc52addcf4cd8c0253f49fada
2022-10-06 22:40:29 -07:00
Soumya Managoli
ee00c83a92 audio-kernel: Bring up changes for bengal
Enable audio driver compilation for bengal.

Change-Id: I1ce7f0356fe70bc59c7caa6d333ad380d1e725ff
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2022-09-29 16:50:51 +05:30
qctecmdr
6f16c80cc0 Merge "dsp: Correct the condition check of apm ready." 2022-08-04 09:00:20 -07:00
Prasad Kumpatla
e569b3b05e dsp: Defer clients probe, when audio notify probe is not complete.
Audio notify probe is defer and PDR state change is not happening before
the clients calls to audio_notifier_register(). Due to this the
service_data[service][domain].state remains as UNINIT_SERVICE (where service is
PDR domain is ADSP) and due to this audio_notifier_reg_client() return success
without registering to PDR service, which is incorrect. To avoid this, will
defer the client probes when the audio notify probe is incomplete.

Change-Id: Ib96bdb24dd92ea8b81a0201a7b48e917c7b1403c
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-07-27 10:32:03 -07:00
Ritu Sharma
cd090cb9e9 dsp: Correct the condition check of apm ready.
Correct the condition check of apm ready status during
prm_send_pkt, loop should exit if apm is ready or retry
count exceeds max count.

Change-Id: I0c32731cb3696ef388a0d17d873a8b1485b54805
Signed-off-by: Ritu Sharma <quic_ritushar@quicinc.com>
2022-07-25 02:54:39 -07:00
Asish Bhattacharya
d27e25c674 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: Ic2f3ef5631d0f4e4191bf772eb0b3f0b825044a6
2022-07-05 04:50:41 -07:00
qctecmdr
a041970a5d Merge "audio-kernel: select param id vote against sleep when enter to securezone" 2022-06-01 13:21:21 -07:00
Prasad Kumpatla
6a758782b1 audio-kernel: select param id vote against sleep when enter to securezone
select param id vote against sleep when enter to securezone with the help of
mixer ctl from pal.

Change-Id: Icb0d6aba4b13edc0658e676eb89c996d440e9971
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-05-27 12:51:23 +05:30
Matthew Rice
acc89c1a44 dsp: Add audio SSR traces for profiling
Adds traces before ssr shutdown and after powerup.

Change-Id: I77309be3e7598381117f6bdbf991f540a736b4f9
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-05-26 13:46:14 -07:00
Meng Wang
95c95b2d67 asoc: update digital_cdc_rsc_mgr_hw_vote API
Update digital_cdc_rsc_mgr_hw_vote_enable/disable API with device
info for easy debug. Also, add swrm clock enable checks during SSR.
When SSR happens, swrm->hw_core_clk_en and swrm->aud_core_clk_en will
be reset without resetting audio_vote and core_vote clk. This would
cause clk mismatch in audio driver and adsp and device fails suspending
when there's no audio usecase. Make this change to reset audio_vote
and core_vote clk when receiving SWR_DEVICE_SSR_DOWN.

Change-Id: I9875aac9f6faf8b6481457a70f31b005073369e0
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-05-06 10:50:36 -07:00
Shazmaan Ali
a20e11e0c3 asoc: codecs: Replace dev_err/info with ratelimit prints
replace all dev(pr)_err/info logs
that could potentially flood kernel logs with
ratelimit functions dev_err_ratelimited and
dev_info_ratelimited

Change-Id: I32dc6002dead1a07622978c4de63d541c01982fd
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
2022-04-13 12:43:20 -07:00
Phani Kumar Uppalapati
0ceec6c1ac audio-kernel: select RCO clock if lpi PCM logging is enabled
Select clock root as RCO for VA use-case whenever LPI
PCM logging feature is enabled.

Change-Id: I461b2afb9eeb595975d550d56c54e7548f0f2130
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2022-02-27 23:55:47 -08: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
Junkai Cai
bd4a663a65 asoc: add config files to support kalama
add kalama config file to all drivers' Kbuild, including soc/dsp/ipc

Change-Id: I56a6092da515f211a56617f0cff60079dbf0aa39
Signed-off-by: Junkai Cai <junkai@quicinc.com>
2021-10-27 14:37:34 -07:00
sarath varma ganapahiraju
6b039c6b85 asoc: dsp: prm: Add support to send reg info to PRM for UPD
Send codec register's and its value to enable/disable EAR PA
when codec duty cycling is enabled.

Change-Id: I6ce7183bda3dd2d02829d280d27e5a5573e3efcc
signed-off-by: sarath varma ganapahiraju <ganavarm@codeaurora.org>
2021-09-15 22:21:07 -07:00
qctecmdr
b61e1747a5 Merge "dsp: audio_prm: check if gpr is ready" 2021-09-03 01:46:33 -07:00
Meng Wang
ffefd0f046 dsp: audio_prm: check if gpr is ready
During SSR, GPR will receive adsp down notification
first and set to SUBSYS_DOWN mode. Sometimes before
audio_prm received adsp down notification, prm_gpr_send_pkt
is called but it will get stucked in spf_core_is_apm_ready
for 30s and device crash happens. In audio_prm, before
checking if spf is ready, check if both prm and gpr are ready
to avoid getting stucked.

Change-Id: I851c140a07162e4fcf20353002ef0130441ca1db
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-08-27 16:57:09 +08:00
Meng Wang
df743705b4 dsp: audio_notify: add soft dependency on qcom_q6v5_pas
if remoteproc for qcom_q6v5_pas is not ready and audio_notify_probe
is called, it will call EPROBE_DEFER. Sometimes audio_notify_probe
is called again very late even after gpr/audio_prm/pinctrl_lpi probe
which causes it doesn't receive the adsp_up notidication and soundcard
is not registered. Add soft dependency for audio_nofity to make sure
audio_notify_probe is called after qcom_q6v5_pas is ready.

Change-Id: I5a25f8d47dc2e7694a8078ad0052e7889a28b11d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-08-25 08:01:23 +08:00
qctecmdr
a39bae0a48 Merge "Revert "dsp: add workqueue for audio_prm and pinctrl_lpi"" 2021-07-13 23:01:34 -07:00
Meng Wang
f01200e92b Revert "dsp: add workqueue for audio_prm and pinctrl_lpi"
This reverts commit 8b3578665b as
it would cause NOC issue.
Move clk reset and snd_event_notify from PD notification to
ssr_enable function to make sure these are done after GPR is
up.

Change-Id: I784ad03093846434313967bcf18c946b3ef18bfc
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-07-08 14:07:09 +08: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
qctecmdr
671d354cf5 Merge "dsp: audio_prm: move mutex_init to module_init" 2021-06-27 12:35:05 -07:00
Meng Wang
a982e87448 dsp: audio_prm: move mutex_init to module_init
During SSR, prm_gpr_send_pkr may request g_prm.lock and
audio_prm_probe may reinitiaze g_prm.lock. When prm_gpr_send_pkr
unlock g_prm_lock, warning log will be there.
Move g_prm.lock init and destroy to module_init and module_exit.

Change-Id: Id410e55f9dee7c0dcb487591cda8fd21e01c7255
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-06-17 09:43:31 +08:00
Patrick Lai
ea9d97a198 dsp: adsp-loader: call proper APIs to shutdown DSP gracefully
Original implementation calls rpoc_report_crash API which yanks out
ADSP abrutptly without proper shutdown. This leads to NOC errors
being reported. Update adsp-loader to call proper shutdown API.

Change-Id: Ibf4bab1e8a8b63082ab4014fff298abcb8750118
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2021-06-16 12:59:30 -07:00
Meng Wang
500ce512d1 dsp: adsp_loader: Probe only after remoteproc is ready
This change checks whether the adsp remoteproc is ready or not
before probing the adsp loader. Since adsp loader is not useful
until the adsp remoteproc is ready, defer probe of the driver.

Change-Id: I659e67f0207707388c6484e58366637c1809d304
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-06-16 01:53:08 -07:00
Meng Wang
8b3578665b dsp: add workqueue for audio_prm and pinctrl_lpi
GPR will deregister and register to audio notifier during
SSR. When ADSP up notification comes to pinctrl LPI before
GPR is registered to audio notifier. Pinctrl LPI will
reset core vote clks however GPR is not masked as up yet
which will causes audio hold clk mutex_lock for long time
and cause kernel panic.
Add workqueue for audio_prm and pinctrl_lpi to avoid hold
clk mutex_lock for long time to resolve this issue.

Change-Id: Idcd7c7d18709dbd5ae85e19eb2abfbed009ffab1
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-06-07 05:16:37 -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
Patrick Lai
504884e349 dsp: address deadlock situation in prm driver during subsystem restart
When ADSP crashes, prm driver can get audio PD down notification from
audio notifier in one thread while prm device instance is being removed
in another thread. This leads to two threads acquiring two locks
(audio notifier & prm) in reverse order. Update audio_prm_remove function
to deregister audio_notifier without acquiring prm lock.

Change-Id: I76dda54340973dc8c4005c741b273dfbdbb1610d
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2021-05-09 15:54:33 -07:00
Vignesh Kulothungan
e334b71c41 dsp: probe defer when remoteproc is uninitialized
There can be race condition that audio_notifier probe
function is called before remoteproc-adsp driver instance
is initialized. In such case, NULL handle would be returned.
It should not be treated as unrecovery error. Update return
status to EPROBE_DEFER upon getting NULL handle back from remoteproc

Change-Id: Id9d182949d12923a25b582142e3fe8bad85e19de
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2021-04-09 16:21:37 -07:00
Vignesh Kulothungan
3e64caacf8 dsp: initialize head of client linked list
Client list head is initialized during audio notifier probe,
and clients cant be added to the list before it is initialized,
which can lead to undesired behavior.
Initialize client list head during declaration.

Change-Id: I03fe218399662df8ac0665f34273c8e7749c1ad2
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2021-04-01 10:25:49 -07: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
Linux Build Service Account
3f632097fb Merge "audio-kernel: move audio_notifier_register to probe function" into audio-kernel.lnx.5.10 2021-01-14 21:27:19 -08:00
Laxminath Kasam
08fffc5bef dsp: Set is_initial_boot before calling child node
Execute gpr driver probe before exiting spf core probe

Change-Id: I983b5e093e9c7d0204e56bdec3d3a590343fb5d3
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-01-12 10:49:01 +05:30
Linux Build Service Account
4d0f39aa7f Merge "dsp : Remove duplicate symbols" into audio-kernel.lnx.5.10 2021-01-11 08:46:12 -08:00
Laxminath Kasam
30fa514858 dsp : Remove duplicate symbols
Remove digital-cdc-rsc-mgr file from q6_dlkm

Change-Id: I3ec21772b095a4449d1a6c97e73ffdede1499cb9
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-01-11 17:47:33 +05:30
Laxminath Kasam
103d2cc5a9 audio-kernel: Fix audio_notifier service registration issue
Change default return value to 0.

Change-Id: I44c069ce451ee4eeeb6de526cf85e299d3cf7fe0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-01-08 19:25:34 +05:30
Patrick Lai
276748a26f audio-kernel: move audio_notifier_register to probe function
audio_notifier driver has been changed to be a platform driver.
Most of initialization steps have been moved to probe function
now. Client should also call audio_notifier_register in probe
function correspondingly. Update audio_prm driver to reflect
the new call sequence.

Signed-off-by: Patrick Lai <plai@codeaurora.org>
Change-Id: I378638d403f230ed20d5275e097ec3ee52f653b7
2021-01-04 16:23:58 -08:00
Jyotirmoi Sarma
6b78aacd7f audio-kernel: Enable out of tree compilaton
Add Makefile in each sub-folder
Add Android.mk file on top level folder of audio-kernel

Change-Id: I024aa5080ae52b55700f0a65ab05034be8c9cdad
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>
2020-12-17 18:05:48 +05:30
Linux Build Service Account
7b85983896 Merge "dsp: Enable remoteproc on adsp-loader" into audio-kernel.lnx.5.10 2020-12-16 01:25:04 -08:00
Linux Build Service Account
8245a005db Merge "audio-kernel: dsp: Upgrade dsp to support 5.10 kernel" into audio-kernel.lnx.5.10 2020-12-16 01:24:02 -08:00
Jyotirmoi Sarma
054c3a6191 dsp: Enable remoteproc on adsp-loader
Modify adsp-loader to use remoteproc to boot adsp image

Change-Id: I6eb481b1795c6dba5ec18938840a029f485da5bc
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>
2020-12-16 14:20:12 +05:30
Jyotirmoi Sarma
b1797ef8b8 audio-kernel: Enable new PDR interface
Migrate to upstream PDR interface
Add audio-notifer as a platform driver

Change-Id: Ia07e12f134e77c4a63744052d060c589f5fb6d29
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>
2020-12-16 14:13:45 +05:30
Jyotirmoi Sarma
21d89c12d0 audio-kernel: dsp: Upgrade dsp to support 5.10 kernel
Change-Id: I774b4eb80d9b428a50b046e1b29957932a9eda11
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>
2020-12-14 12:53:34 +05:30