This reverts commit ea5aa7a3fe5143774b2d3944f4f932d610ae23d7.
The issue has been fixed properly in Idafc26a739df1831d04ea2fde4625e8f9ca1a0ae
Change-Id: I8275c11660af6cd03907970dea020897b66ceaa3
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
If the driver is not yet initialized, return EPROBE_DEFER to the
external driver trying to register a notification, so that we
don't miss any.
Change-Id: Idafc26a739df1831d04ea2fde4625e8f9ca1a0ae
Enable interrupt request only when the interrupt is
in disabled state.
Change-Id: I67795bf0ee344661e02b0fec3181cd7980d56652
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Update SOC_SINGLE_SX_TLV to SOC_SINGLE_S8_TLV to make codec
driver compatiable with upstream driver.
Change-Id: I4061b015d715978f3b294ad630f53b64bf66c2b7
Signed-off-by: Meng Wang <mengw@codeaurora.org>
[dereference23: Backport to msm-4.14]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Fix is to add check for this ADSP returned buf offset + size,
if it is within the available buf size range
Change-Id: I400cc4f5c07164f0a9b405ebea144ea0ae4b6cf2
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
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>
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>
Change-Id: I5c945b6570ccd348659b2e8ee889368e7f4f6f80
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
Fix is to add check for this ADSP returned buf offset + size,
if it is within the available buf size range
Change-Id: I400cc4f5c07164f0a9b405ebea144ea0ae4b6cf2
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
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>
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>
Change-Id: I5c945b6570ccd348659b2e8ee889368e7f4f6f80
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>
Check for the proper param size before copying,
to avoid buffer overflow.
Original-Change-Id: I70c52e6ab76f528ea3714784ab9013b070839c40
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
Change-Id: Ic7fa9b3dd047d8eeba3cea02b99d6bc5b9df8daf
Conversion of negative "num_modules" var value
will result in max possible unsigned int value
and hence can cause mem corruption when accessed.
Resolve this by assigning the same data type
to "num_modules" var as used in the calling fn.
Original-Change-Id: I4c9d7215b9c7345637e1eb3a1992a41fef71c5cb
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Change-Id: I55fd3ea6bf214e3852c58f8dcae9ada4723fa7d8
Check if payload data is big enough before accessing
the data in it.
Change-Id: I939f205a8cebf6ef4859f81fae5429bca013d540
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Check for the proper param size before copying,
to avoid buffer overflow.
Change-Id: I70c52e6ab76f528ea3714784ab9013b070839c40
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
Conversion of negative "num_modules" var value
will result in max possible unsigned int value
and hence can cause mem corruption when accessed.
Resolve this by assigning the same data type
to "num_modules" var as used in the calling fn.
Change-Id: I4c9d7215b9c7345637e1eb3a1992a41fef71c5cb
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
(cherry picked from commit 75ed04dc1f7e7da565e41b7190fb44f078c5b4d6)
(cherry picked from commit a23fc1d9e2a6166dde561c6e5cf8f1e09e0a5c0c)
(cherry picked from commit efed5ad0c48e83e66b4be7f33147aa192e47e498)
(cherry picked from commit 8a55be718c836abf6d4bc5a1233e982374fd3316)
(cherry picked from commit b6c2999fdb6f3d71385d1a1edf839ff14e4bc0d7)
(cherry picked from commit 34715e51bf1fd10b6fec2e581524b20286fb46c4)
(cherry picked from commit 5fec4357e73939eb0a6252f7848480d8bf624fe6)
(cherry picked from commit 7d6be584cf1ea2879fd8ef21178766b06be13fe8)
(cherry picked from commit 8b0aa1ebc13c6ccd9a250bdf5004d64da2f089aa)
(cherry picked from commit 1485ebd685e6d2af1b45ab43297b9d32ee0aacc2)
(cherry picked from commit 089735f8cf8b4808bc52901da2b337b733983f4c)
(cherry picked from commit 7a65bfba52cf301b3394ed85f4ff4cc14ef0446f)
(cherry picked from commit ca17239efeca7b58d286989e17381a57b6174111)
(cherry picked from commit c9c2c5291e9ddb47720dd211ef584c84a73774ee)
(cherry picked from commit c04791f3fcad54d81e76cce4f4f7a565660e94bd)
(cherry picked from commit 01d7d6fd40d4899770a5786b8a0683dc976fcc13)
(cherry picked from commit c84794133685b0feb98a557e9d377746e7e0a05f)
(cherry picked from commit 562ca2c99dab1fcaf7316d285395dbf3dc681dc7)
(cherry picked from commit 7956f56b1d6675dfb8db1328f7a4f16fe2d926be)
(cherry picked from commit acea29dd2ce6a33904829fd821ef8754bf56b70a)
(cherry picked from commit cdf2ba1f7426eca51e692d4e57f5b009fff55c9a)
There's no need to compile the sa8155 driver when targeting sm8150
mobile devices.
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
The reg in soc_dapm_mux is 32-bit. The BE DAI ID passed
as shift(to be operated on the reg) may be more than 31,
which may cause overflow.
Set reg field to SND_SOC_NOPM to avoid any DAPM operation
while passing BE IDs in shift_l field and hence avoid overflow.
Change-Id: Ibbbca04c61b7c56eb4c5a7485a4e93dc28a09709
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
[dereference23: Forward port to 4.14]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Change-Id: Ia33743c8770dbb3cffe52aa1b57faa3267f37d8f
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
[dereference23: Extend to audio-kernel 4.0]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Change-Id: If2b6b67afafddc749557a2230582fbacd1c85c26
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
[dereference23: Extend to audio-kernel 4.0]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
The non-blocking if-statement here causes the AUDIO_GET_AMRWB_ENC_CONFIG
ioctl to always return -EFAULT, even upon success. Fix it by correctly
guarding the -EFAULT return value.
Change-Id: Ia3a7247f5febb21d3b654c0ed29e81135e732c79
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
[dereference23: Extend to audio-kernel 4.0]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
"LA.UM.9.1.r1-12600-SMxxx0.QSSI12.0"
By Sandhya Mutha Naga Venkata (1) and Shazmaan Ali (1)
Via Gerrit - the friendly Code Review server (2) and Linux Build Service Account (1)
* tag 'LA.UM.9.1.r1-12600-SMxxx0.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel:
asoc: codecs: Add nullptr check
asoc: codecs: Add nullptr check
Seeing as we shut this down intentionally, I don't see why we need
to be alerted it's failure, repeatedly, and from multiple drivers.
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Silence loggers directly where possible in order to avoid
extraneous guarding. Additionally, clean up npu_debugfs.
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
The non-blocking if-statement here causes the AUDIO_GET_AMRWB_ENC_CONFIG
ioctl to always return -EFAULT, even upon success. Fix it by correctly
guarding the -EFAULT return value.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
The on-stack th_vi_v_vali struct is not fully initialized by
afe_get_sp_th_vi_v_vali_data(), leaving members of the th_vi_v_vali
struct used despite not being initialized. Fix it by zeroing out the
memory in afe_get_sp_th_vi_v_vali_data().
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>