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>
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>
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>
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>
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>
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>
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>
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>
The fixed issues include variable initialization missing and improper NULL
pointer checking.
Change-Id: I5302cf84f7f0414fe0cf69ccc0cafc8225142c5f
Signed-off-by: Tony Han <xiahan@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>