Commit graph

99 commits

Author SHA1 Message Date
Tharun Kumar Merugu
b9a42b4ce5 msm: adsprpc: maintain local copy of rpra offloaded to DSP
Since DSP is not supposed to modify the base pointer rpra of the
input/output arguments offloaded to DSP, maintain a local copy of
the pointer and use it after receiving interrupt from DSP.

Change-Id: I4afade7184cb2aca148060fb0cda06c6174f3b55
Acked-by: Maitreyi Gupta <maitreyi@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
Signed-off-by: Mohammed Nayeem Ur Rahman <mohara@codeaurora.org>
2019-06-17 06:52:56 -07:00
Mohammed Nayeem Ur Rahman
74bc55d2fa msm: adsprpc: Fix memory out of bounds error
Fixes memory out of bound error.

Change-Id: I9cc11b5231ba3654588eadf7a7adca68aff35684
Signed-off-by: Mohammed Nayeem Ur Rahman <mohara@codeaurora.org>
2019-01-08 04:47:37 -08:00
Tharun Kumar Merugu
092de9c894 msm: adsprpc: allocate all remote memory in kernel
Allocate all memory given to remote subsystem in the kernel
instead of mapping memory allocated in userspace.

Change-Id: I79c1f40d426e271403afa67514714fe6af26cf4e
Acked-by: Thyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2019-01-04 16:42:12 +05:30
Mohammed Nayeem Ur Rahman
c32975c887 msm: ADSPRPC: debugfs global and dsp file changes.
Changes the naming convention and adds
PID as suffix to the debugfs files.

Adds debugfs file data in the tabular format and also
creates global file in /sys/kernel/debug/adsprpc directory.

Change-Id: I25f3f7ea59dd39c9d44d99c8503f431f10072c33
Signed-off-by: Mohammed Nayeem Ur Rahman <mohara@codeaurora.org>
2018-11-22 05:15:22 -08:00
Tharun Kumar Merugu
7652e325a4 Revert "msm: adsprpc: DSP device node to provide restricted access to ADSP/SLPI"
Applicable only for CDSP present branches. Not needed for 4.4 kernel.

This reverts commit 90cb306f50.

Change-Id: I645120212b2c9a43cb5d12cc866d5592979cd44b
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2018-08-23 13:27:21 +05:30
Tharun Kumar Merugu
90cb306f50 msm: adsprpc: DSP device node to provide restricted access to ADSP/SLPI
Support 2 separate device nodes with this change, one for ADSP/SLPI
and another for CDSP.

Change-Id: I2a09ebfdeccd9a092b1a3602c249b2727ec91c92
Acked-by: Amol Mahesh <amahesh@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2018-08-07 23:10:28 +05:30
Tharun Kumar Merugu
c2eebf8cdf msm: adsprpc: destroy mutex before file free
Destroy mutex before file free, to avoid use after free of mutex.

Change-Id: I4ff73dc17b15043eacbb299219a379bfd1a8efa6
Acked-by: Himateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2018-07-11 15:20:08 +05:30
Tharun Kumar Merugu
d413f3e7fc msm: ADSPRPC: handle 32 bit support
Handle 32 bit support without any truncation.
Add IOCTL calls for map and unmap for 64 bit separately.

Change-Id: I077a0b4345a6c21a88d7a500aa5c9faf7193f620
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2018-06-13 12:17:01 +05:30
Linux Build Service Account
c638be9b40 Merge "msm: ADSPRPC: Validate rpra to avoid Null pointer dereference" 2018-03-28 15:28:07 -07:00
Linux Build Service Account
cbae14bbfc Merge "ASoC: msm: Fix KW issues for audio drivers" 2018-03-21 10:10:17 -07:00
Tharun Kumar Merugu
eede053d5f msm: ADSPRPC: Validate rpra to avoid Null pointer dereference
In get_args function their is no NULL pointer check for rpra
variable, that might lead to null pointer dereference. Add
condition to verify.

Change-Id: I0789e8ea875221de5809598419bc7f842aa3e22e
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2018-03-20 17:17:44 +05:30
Tony Han
0152bff079 ASoC: msm: Fix KW issues for audio drivers
The fixed issues include variable initialization missing and improper NULL
pointer checking.

Change-Id: I5302cf84f7f0414fe0cf69ccc0cafc8225142c5f
Signed-off-by: Tony Han <xiahan@codeaurora.org>
2018-03-15 13:52:52 +08:00
Tharun Kumar Merugu
e569b915a2 msm: ADSPRPC: Use ID in response to get context pointer
Send context ID in rpc header instead of context pointer.
Validate context ID received in response and get context pointer.

Change-Id: I9cfd10d0c1b25c3085b8e15c7ca1c8ff214bf10d
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2018-02-08 15:30:54 +05:30
Tharun Kumar Merugu
3ebcd5d7e5 msm: adsprpc: Fix race conditions on same buffer
Variable map may pointing to the same buffer on race conditions
in functions fastrpc_internal_mmap and fastrpc_internal_munmap,
use mutex to avoid race conditions on same buffer.

Change-Id: I96ed884c44a36f574677ba3ba189dfbf2ce3751d
Acked-by: Krishnaiah Tadakamalla <ktadakam@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2018-01-15 22:36:05 -08:00
Tharun Kumar Merugu
720c24578a msm: adsprpc: Use unsigned integer for length values
As the length datatype is signed, supplying a negative number
can have undesired consequences. Always use unsigned integer
types for length values.

Change-Id: Ifde2f0d35129014b976507f7723a319c53fabddf
Acked-by: Thyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-12-22 17:56:46 +05:30
Linux Build Service Account
bb863df68a Merge "msm: ADSPRPC: use access_ok to validate pointers" 2017-12-04 15:19:47 -08:00
Linux Build Service Account
541f2b13c3 Merge "msm: ADSPRPC: validate context pointer with magic number" 2017-12-04 06:17:00 -08:00
c_mtharu
b3c277dac5 msm: ADSPRPC: use access_ok to validate pointers
Check the validity of the pointer in user space that you intend to
access. access_ok function simply checks that the address is likely
in user space, not in the kernel.

Change-Id: I936f73a2c2029f9e7ca12cc8fc06d0698e6710c0
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-12-04 02:34:54 -08:00
c_mtharu
595c2eab87 msm: ADSPRPC: validate context pointer with magic number
Validate context pointer using magic number instead of searching
through context list. It removes the usage of spin lock in interrupt
handler for avoiding deadlock and reducing latency.

Change-Id: I2492a7984a8d6545618a9cfb7a2d239d03ddd5a2
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-11-28 13:13:17 +05:30
c_mtharu
4222d44cf0 msm: ADSPRPC: Change SSC VMID from 5 to 38
Change Dest VM of SSC from 5 to 38 and it can be unmapped to
HLOS through hyp_assign.

Change-Id: I8e4ace8e9722d4fa79b553ad6b8d29353954f8c5
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-11-24 12:17:28 +05:30
Linux Build Service Account
99956cfb73 Merge "msm: ADSPRPC: Use msm_ion_do_cache_op to flush userspace buffers" 2017-08-24 14:01:18 -07:00
Linux Build Service Account
c6c29db754 Merge "msm: ADSPRPC: Queue one more intent to avoid race condition" 2017-08-23 20:24:48 -07:00
Linux Build Service Account
5f76ac9d86 Merge "msm: ADSPRPC: validate user buffers after copying from user" 2017-08-21 20:01:11 -07:00
Tharun Kumar Merugu
d78cfa2316 msm: ADSPRPC: Queue one more intent to avoid race condition
Queue 2 intents for adsprpc glink channel to avoid remote
processor failure for glink.
One intent for threads responding back of size 16,
another intent for IST failure responding without intent
request of size 64.

Change-Id: I85444cb0283c57ddf15cf7d1d50b827fe5339d4c
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-08-21 10:00:02 -07:00
Tharun Kumar Merugu
96be9b208b msm: adsprpc: Avoid leak info of pointers addresses to dmesg
To avoid leak info of pointers addresses to dmesg,
use %pK instead of %p to print virtual addresses.

Change-Id: I7d8e900d7cd62e9ad3fb9ea3ba9865d6911bdfcb
Acked-by: Chenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-08-17 15:38:33 -07:00
tharun kumar
73b20757e5 msm: ADSPRPC: validate user buffers after copying from user
validate user buffers before accessing in kernel driver.

Change-Id: I7997d069d0549de03f1467c63bdb81b20fcf3d6c
Acked-by: Chenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-08-16 02:55:10 -07:00
Tharun Kumar Merugu
0cdcf0409b msm: ADSPRPC: Use msm_ion_do_cache_op to flush userspace buffers
Remove the use of dmac_flush_range for userspace buffers and add
msm_ion_do_cache_op for flushing user space buffers.

Change-Id: Ice73eafac840bd1cabee0a2bfc8a641832a7d0c8
Acked-by: Bharath Kumar <bkumar@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-08-10 16:01:59 +05:30
Tharun Kumar Merugu
dc979af523 msm: adsprpc: Separate hyp_assign call for audio remote heap protection
Enable audio remote heap protection for separate hyp_assign call to map
HLOS buffer to ADSP_Q6_ELF VM.

Change-Id: I91a70cb8ef2c2feb2d4c398c15c220c78c96a509
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-08-10 02:21:58 -07:00
Tharun Kumar Merugu
25ff5f0b64 msm: ADSPRPC: Queue receive intent for adsprpc glink channel
Queue receive intent for adsprpc glink channel to avoid remote
processor failure to acknowlege first message.

Change-Id: I314099acca71683a36661c0ff6c4a0430653d97e
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-08-01 22:59:02 -07:00
Linux Build Service Account
deea343b37 Merge "msm: ADSPRPC: Handle SMD event signal" 2017-07-28 08:21:40 -07:00
Linux Build Service Account
150e8fab68 Merge "msm: ADSPRPC: Add exec permission for hyp_assign_phys" 2017-07-21 20:15:19 -07:00
Tharun Kumar Merugu
bcd8434f47 msm: ADSPRPC: Handle SMD event signal
Handle multiple sessions properly for given channel.

Change-Id: I3061fd883794da0465bfdae2b1c19d425ede7470
Acked-by: Krishnaiah Tadakamalla <ktadakam@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-07-21 07:17:52 -07:00
Tharun Kumar Merugu
8048977b41 msm: ADSPRPC: Add exec permission for hyp_assign_phys
Add execute permission for hyp_assign_phys for adsp shared
memory region to allow for the memory to be reused by other user
space processes when this is not used by the remote processor.

Change-Id: I4f593584f332f8dc775afb68e6bfae1ea8f803fa
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-07-19 00:56:19 -07:00
tharun kumar
86ad5044c3 msm: ADSPRPC: avoid sending new requests to dsp while device_release
When fastrpc_device_release is in progress, don't send any new
requets to DSP

Change-Id: I4d9e2f06485cde6dbd3d7aef402e3e853e0be998
Acked-by: Chenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-07-18 02:47:45 -07:00
Linux Build Service Account
6cc3f85f8c Merge "msm: ADSPRPC: define separate signals for port and link states" 2017-07-14 04:00:25 -07:00
Sathish Ambley
09055c5057 msm: ADSPRPC: Avoid multiple hypervisor assign calls for a buffer
Access to dma shared buffer is set at device probe, avoid making
multiple hypervisor assign calls for the same buffer.

Change-Id: I91f7dd0bca109fa774af49159bdec57b8acd65b2
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
2017-07-06 05:00:00 -07:00
Tharun Kumar Merugu
a3124fe134 msm: ADSPRPC: define separate signals for port and link states
Handle Glink register bail path in case of SSR.

Change-Id: Ic3b7d9d4b0b53d348faf338d03d12fc471030ae6
Acked-by: Krishnaiah Tadakamalla <ktadakam@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-07-06 04:59:32 -07:00
Tharun Kumar Merugu
f7a56df0ca msm: ADSPRPC: Initialize FastRPC invoke metadata
Initializing metadata buffer to zero before reusing the buffer
for next invoke.

Change-Id: Iaab3478732b83427a475e95afa0e031cb76f60d9
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-07-03 04:54:30 -07:00
Linux Build Service Account
5d52e10d48 Merge "sdm660: adsprpc: Map uncached buffers as non-coherent" 2017-06-13 08:48:36 -07:00
c_mtharu
71733cb184 sdm660: adsprpc: Map uncached buffers as non-coherent
Map un-cached buffers as non io-coherent to avoid snooping overhead.

Change-Id: Iddbde76d6d8a13cd48c737f1046a53a2bc1ef2a5
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-06-11 22:37:30 -07:00
tharun kumar
db95e66a97 SDM660: ADSPRPC: Handle NULL pointer dereference
Avoid using strlen as it results in NULL pointer
dereference for NULL value.

Change-Id: I21a9793b48caddb423f081cdcf2690ded1822e88
Acked-by: Chenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-05-29 01:44:25 -07:00
Tharun Kumar Merugu
6e853a66c3 SDM660: ADSPRPC: Fix for NULL pointer dereference
Fixing NULL pointer dereference in fastrpc_device_ioctl

Change-Id: I240e6eae69f9ab4831352a8bf160d5f0e8a98b1b
Acked-by: Chenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-05-18 04:33:32 -07:00
Linux Build Service Account
5404e35069 Merge "msm: ADSPRPC: Copy process name buffer to kernel space" 2017-05-16 16:08:16 -07:00
Tharun Kumar Merugu
7fbbf8a306 msm: ADSPRPC: Copy process name buffer to kernel space
Copy user space process name buffer to kernel space using
copy_from_user.

Change-Id: I5272a42651ac50ddeda3f0f7a4cbd32dbaf495ec
Acked-by: Himateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-05-16 06:09:24 -07:00
Tharun Kumar Merugu
94e69df401 msm: ADSPRPC: verify and initialize some variables
Verify cid variable before accessing it and
initialize invoket variable before bailing out.

Change-Id: Idec133bf8ba1a000b83f92bb567f0b75bbdab340
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-05-11 23:40:29 -07:00
Tharun Kumar Merugu
5a15915855 msm: ADSPRPC: close glink channel before opening again
Added proper checks to avoid opening a glink channel before
completely closing previously opened channel.

Change-Id: Iaa41f4b27a80967b634dd832cc6ad060ea083b18
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-05-09 23:05:44 -07:00
Tharun Kumar Merugu
0f776b9069 SDM660: ADSPRPC: Align the size of IOVA to 128MB
Align the size of the IOVA that is being passed
in the arm_iommu_create_mapping() to 128MB.

Change-Id: Ia554c2157d6c46b2f3848f993a7e61ff7f029547
Acked-by: Chenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-05-01 22:52:17 -07:00
Linux Build Service Account
ffee4e8638 Merge "msm: ADSPRPC: Initialize the list for global gfa maps" 2017-04-28 11:12:16 -07:00
Tharun Kumar Merugu
8a3caf5c49 msm: ADSPRPC: Use SMD on targets that doesn't support GLINK
Enable SMD for backward compatibility on targets that doesn't
support glink.

Change-Id: I9e9073dd3b2d7b789c79a31ae77fff78e6e61e36
Acked-by: Bharath Kumar <bkumar@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-04-14 00:29:38 -07:00
Linux Build Service Account
c9b6da0d6c Merge "sdm660: ADSPRPC: Null check file session ctx during mmap create" 2017-04-05 12:17:01 -07:00