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>
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>
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>
Add change to properly handle the pointers by setting them to
NULL after free and adding some null checks before dereferencing.
Change-Id: Ic2f3ef5631d0f4e4191bf772eb0b3f0b825044a6
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>
Adds traces before ssr shutdown and after powerup.
Change-Id: I77309be3e7598381117f6bdbf991f540a736b4f9
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
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>
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>
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
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>
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>
add kalama config file to all drivers' Kbuild, including soc/dsp/ipc
Change-Id: I56a6092da515f211a56617f0cff60079dbf0aa39
Signed-off-by: Junkai Cai <junkai@quicinc.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Export symbol cannot be added for static functions.
Change-Id: Ief55b7868f2c16e5a11681e24432561d45765e52
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
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
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>
Modify adsp-loader to use remoteproc to boot adsp image
Change-Id: I6eb481b1795c6dba5ec18938840a029f485da5bc
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>