Current logic copies user buf size of data
from the avail dsp buf at a given offset.
If this offset returned from DSP in READ_DONE event
goes out of bounds or is corrupted, then it can lead to
out of bounds DSP buffer access, resulting in memory fault.
Fix is to add check for this buf offset, if it is within
the buf size range.
Original-Change-Id: I7753cc6db394704dbb959477150141d42b836bef
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
(cherry-picked from 28658bc2a0a290fdfcab61bed67e89874e99ca47)
[ Re-picking to adapt 1ee23bd8c3 for dsp buf check ]
Change-Id: Ie028d928492e5d113285416226abbeee8e6bfc20
Signed-off-by: Han Sol Jin <hansol@hansol.ca>
Avoid copy to user more than requested buffer size
to avoid memory corruption.
Change-Id: Ibf1607f777a358ebd16fd8b8728809afda34eba7
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
tinycap test can attempt with different size to
read from driver and need to avoid access more
than period size.
Change-Id: Ifa4ddfb086bd83aa981da62e88da3a9395f5aabc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Sometimes during device switch in recording,
observe size 0 is return from DSP due to EOS
handling. For ALSA pcm_read to unblock, buffer
appl_ptr is elapsed without actually updating
the buffer. And userspace copies the stale
data(old buffer) causing issue sometimes.
Reset the buffer for that period_size in
such cases instead of transfer stale data.
Change-Id: I0d3ac133a8d95fad0710586e3e947410a41c9c5a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
techpack/audio/asoc/codecs/wcd_cpe_services.c:658:17: error: implicit
conversion from enumeration type 'enum cpe_svc_result' to different
enumeration type 'enum cmi_api_result' [-Werror,-Wenum-conversion]
notif.result = result;
~ ^~~~~~
techpack/audio/asoc/codecs/wcd_cpe_services.c:1350:8: error: implicit
conversion from enumeration type 'enum cpe_svc_result' to different
enumeration type 'enum cpe_process_result' [-Werror,-Wenum-conversion]
rc = cpe_send_msg_to_inbox(t_info, 0, m);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
Change-Id: Ib9fce60017066e9c96e79195d7dba9ffb9177148
The global declared mmap_handle can be left dangling
for case when the handle is freed by the calling function.
Fix is to address this. Also add a check to make sure
the mmap_handle is accessed legally.
Change-Id: I367f8a41339aa0025b545b125ee820220efedeee
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
There is no check for voip pkt pkt_len,if it contains the
minimum required data. This can lead to integer underflow.
Add check for the same.
Change-Id: I91d4f2ad8dfb060cdb2ab9e36dc9f886ea40908a
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Add check for the max hpcm_buf_node size before copy to avoid
buffer out of bounds issue.
Change-Id: Id647888430ce302359a857ef54d321bee99889bf
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Current logic copies user buf size of data
from the avail dsp buf at a given offset.
If this offset returned from DSP in READ_DONE event
goes out of bounds or is corrupted, then it can lead to
out of bounds DSP buffer access, resulting in memory fault.
Fix is to add check for this buf offset, if it is within
the buf size range.
Change-Id: I7753cc6db394704dbb959477150141d42b836bef
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
ASoC CTLs with negative minimum values were changed to use S8_TLV
controls on the upstream audio-kernel.
This is a backport of the upstream change [1] as it didn't land
into any sdm845 tag.
[1] 30fad2dc20
Change-Id: Id4b3038eb5d79a027f063869136ecebc83ee873d
This patch fixes an issue with all the functions defined in
scripts/Makefile.lib gets called everytime when this makefile is
included thus causing the build to slow down.
Bug: 118818737
Change-Id: I4929e64d53a0bc865b12a27cce37520be52c9744
Signed-off-by: Thierry Strudel <tstrudel@google.com>
updt_params is an array of uint32_t with MAX_ENABLE_CMD_SIZE elements.
Fix 2 memset that initialize only first quarter of the array.
Signed-off-by: Ivan Vecera <ivan@cera.cz>
Change-Id: I2649109c8c889f7a8a9ceca05d135e8d84cf76ff
Since entry for "WCD_MBHC_IN2P_CLAMP_STATE" is missing
in mbhc reg struct of sdm660_cdc, mbhc reg indexing
is going wrong. Update this missing entry to align
with the mbhc driver reg function indexing.
Change-Id: I4e3daa9c0f3efe9523fd0d4d3ab7cd04815dc30d
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
Fixes booting with techpack online and modules disabled.
Without this it spits out a nasty NULL pointer dereference.
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Change-Id: Ib51f186ccff1c7f7c7aed27d4ef8319561b3dba4
During playback on speaker mute is observed if spk
amplifier is not enabled.
Enable speaker amplifier when SPK PA is enabled
CRs-Fixed: 2374703
Change-Id: Ib4d65bc5cc82ba54aae35a6a8000596be3c1aff7
Signed-off-by: Sujin Panicker <spanic@codeaurora.org>
Modify lineout PA teardown sequence to reset RX_LO_EN_CTL
register as per HW sequence.
Change based on commit: 7ccfaadc92d
Change-Id: Idab557947a43ab7d66ff8d83ac1ffeee9b2031ec
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
Pop is heard after PDR is triggered. This is
resolved by delay sequence change for PA disable
and boost discharge.
CRs-Fixed: 2234580
Change-Id: I3b6f2ae00f5396358c2c166c3b84bd162290c716
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Excessive error logging makes the service registration
ack of audio notifier callback timeout. Make the
sound card status offline as soon as the
Audio PD down notification comes in soundwire
audio notifier callback function to fix this.
CRs-Fixed: 2202427
Change-Id: Iea06977bcd0a9d2562b8089ee8549cd7fb4018a3
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
In analog codec and soundwire codec probe functions,
ADSP Audio PD up status is not checked which leads
to LPASS registers access during bootup
even before ADSP is ready.
Check for ADSP ready state in the respective
probe functions to fix this.
CRs-Fixed: 2202958
Change-Id: I8e05d30ef55cde58e8002d1040b3701280b91861
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Speaker DAC is not set to the proper state due to
race condition after SSR. Set it to proper state
during widget power up.
Change-Id: I38f05e00fc493dab10712375e920aee8c3bdca0d
Signed-off-by: Tanya Dixit <tdixit@codeaurora.org>
Add 2ms delay before power up to avoid PA wrong
state issues seen during ssr because of rapid
power down and power up.
Change-Id: Icc140ec5eb11cdbc1aaccdba170d75916ea70bf1
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
In analog codec, EAR PA gain control get
function is updated with input value again
resulting in override. Remove the override
of control value again.
CRs-Fixed: 2161617
Change-Id: I7ddd252adf53666a6c9adc1bc92e840067fa932c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
"LA.UM.10.3.r1-01000-sdm845.0"
* tag 'LA.UM.10.3.r1-01000-sdm845.0' of https://source.codeaurora.org/quic/la/platform/vendor/opensource/audio-kernel:
dsp: adm: add to check output/input channel
Asoc: check for invalid voice session id
asoc: add code change for pseudo playback and capture BE DAIs.
Change-Id: Ic53db8ee0144214c719593b442d25b24fe651ceb
* tag 'LA.UM.9.3.r1-01600-sdm845.0' of https://source.codeaurora.org/quic/la/platform/vendor/opensource/audio-kernel:
dsp: add change to enable preemption at cal_utils_dealloc_cal.
dsp: add change to handle use-after-free in cal_utils_is_cal_stale
dsp: q6adm: add ADM_LSM_AUDPROC_PERSISTENT cal type
dsp: q6adm: add ADM_LSM_AUDPROC_PERSISTENT cal type
uapi: msm_audio_calibration: add new cal type for ADM_LSM
uapi: msm_audio_calibration: add new cal type for ADM_LSM
dsp: add change to enable preemption at cal_utils_dealloc_cal.
dsp: add change to handle use-after-free in cal_utils_is_cal_stale
Change-Id: Iebd2905a0e98737416b255dd3b4110fcb5b7d422
This patch addresses the following locking error:
msm-lsm-client.c:337 lsm_event_handler() warn: inconsistent returns
'spin_lock:&prtd->event_lock'
Bug: 77543262
Test: build & boot
Change-Id: I6e492df8f90ba25ec17d548249b29b8ba1a87a29
Signed-off-by: David Lin <dtwlin@google.com>
This patch addresses the following locking error:
q6asm_callback() warn: inconsistent returns 'irqsave:flags'
Bug: 77543262
Test: build & boot
Change-Id: Iecf73f5985e2a7dfe96bafcf7cf387631a33677d
Signed-off-by: David Lin <dtwlin@google.com>
This removes the following logspam on boards without WSA codec:
[ 6.548448] msm_init_wsa_dev: Max WSA devices is 0 for this target?
[ 8.354834] msm_init_wsa_dev: Max WSA devices is 0 for this target?
[ 8.501192] msm_init_wsa_dev: Max WSA devices is 0 for this target?
[ 8.643592] msm_init_wsa_dev: Max WSA devices is 0 for this target?
[ 8.870054] msm_init_wsa_dev: Max WSA devices is 0 for this target?
[ 9.007772] msm_init_wsa_dev: Max WSA devices is 0 for this target?
[ 9.144575] msm_init_wsa_dev: Max WSA devices is 0 for this target?
[ 13.487951] msm_init_wsa_dev: Max WSA devices is 0 for this target?
[ 14.061869] Sound card sdm845-tavil-tdm-snd-card registered
Change-Id: Ifc29034e23d6b968c473e9f2d0f312cae27c49b5
Signed-off-by: David Lin <dtwlin@google.com>
../techpack/audio/asoc/codecs/wsa881x.c:392:9: error: 'snprintf' size argument is too large; destination buffer has size 20, but size argument is 25 [-Werror,-Wfortify-source]
len = snprintf(tmp_buf, 25, "0x%.3x: 0x%.2x\n", i,
^
1 error generated.
The warnings are correct. Fix the size arguments by only allowing the
amount of bytes that the size of the char arrays are.
Signed-off-by: shagbag913 <sh4gbag913@gmail.com>
Signed-off-by: Khusika Dhamar Gusti <mail@khusika.com>
Change-Id: I31366b5cd2f13f6d168111a4b0a2f013bd6b92f7
This is the only way to solve the mess that happens whenever
we try to rebuild the kernel without mrproper'ing it first.
It's the most dirty thing on Earth, but it's really the only
possible option.
Change-Id: Ie72adbb63d8c0a9c2d53cd4a9e8610ad9ccfef9b
* tag 'LA.UM.8.3.r1-07900-sdm845.0' of https://source.codeaurora.org/quic/la/platform/vendor/opensource/audio-kernel:
asoc: msm-compress: Add lock in controls _put() and _get() callback
Revert "rtac: Add mutex protection for rtac cal apis"
asoc: msm-routing: Fix array out of bounds issue.
asoc: msm-compress: Replace goto with return in case of invalid value.
asoc: fix for fm not routing to speaker
asoc: msm-compress: Added missing mutex initialization for pdata
rtac: Add mutex protection for rtac cal apis
ASoC: fix compilation warnings after enabling LLVM
Change-Id: Ib02bb0c221bb89d317cf79dc90476b6211819465