Commit grafiek

21 Commits

Auteur SHA1 Bericht Datum
Meng Wang
ac06fe7d10 dsp: prm: move g_prm.state and g_prm.status into mutex_lock protection
When two clients call prm_gpr_send_pkr concurrently, g_prm.status will be
set to 0 for both clients. When client_A returns some error, g_prm.status
will be some error value and not cleared for Client_B. When audio_prm_callback
returns correct value for Client_B, g_prm.status is some error value which causes
prm_gpr_send_pkt fails for Client_B by mistake.
Move g_prm.status and g_prm.state into mutex_lock to resolve this issue.

Change-Id: Ie028533e6590bfd59b2fa08a496bbffc8793e5f6
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-10-28 01:59:53 -07:00
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
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
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
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
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
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
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
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
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
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
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
Ritu Sharma
380d126f2a dsp: wait for apm_ready in audio_prm
Wait for spf_core_is_apm_ready before sending first command to
spf after bootup and after SSR.

Change-Id: I7c3a7fbb9e190310554ae716937fd6a0d036ce6f
Signed-off-by: Ritu Sharma <ritushar@codeaurora.org>
2020-08-26 22:29:47 -07:00
Bharath Tirunagaru
ac15eb7016 audio-kernel: SSR/PDR fixes on audio-drivers.
Few Fixes on the drivers we are making are
1. snd_event is not resetting client info on deregister.
2. audio_prm is not providing the snd event up notification
3. gpr_lite reversing registration seq to avoid race condition
4. pinctrl-lpi reversing reg seq to avoid race condition.

Change-Id: I749de8874b33a528cb6b386d753f5d594139a577
Signed-off-by: Bharath Tirunagaru <bharatht@codeaurora.org>
2020-06-25 00:35:35 -07:00
Bharath Tirunagaru
ebf0162590 audio-kernel: Add changes to support SSR/PDR
Add changes in audio-pkt,voice_mhi and gpr-lite drivers.
Fixing bug in audio_pdr driver w.r.t memory allocation.

Change-Id: I6ab7ff13b532921f85e9548341969abd32ee3b6d

Signed-off-by: Bharath Tirunagaru <bharatht@codeaurora.org>
2020-06-25 00:35:08 -07:00
Phani Kumar Uppalapati
f8d25f4dfb audio_prm: Remove false error message
Change-Id: Ic59f21aa42973a5dff450e89b161d4b3ed99c5a2
Signed-off-by: Taha Azzaoui <tazzaoui@codeaurora.org>
2020-06-25 00:34:13 -07:00
Ashish Jain
4bca3d64c1 dsp: fix prm driver getting woken twice
Ensure that the mutex is not signalled twice.
Also update resp_recieved variable to false before
the command is sent. This helps ensure that the
prm driver does not miss wake up signal issued
from prm_callback.

Change-Id: Ief9274768ef38095e0cadaf8e1e4b1f0dc5350ad
Signed-off-by: Taha Azzaoui <tazzaoui@codeaurora.org>
2020-06-25 00:33:50 -07:00
Vignesh Kulothungan
8fc7957756 ASoC: add hw_core voting via PRM module
Change-Id: Ifa070caa6e5ff0263d0d471e5f0d7e7b09a41f0d
Signed-off-by: Taha Azzaoui <tazzaoui@codeaurora.org>
2020-06-25 00:31:10 -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