Commit graph

98 commits

Author SHA1 Message Date
Tharun Kumar Merugu
0698c10037 msm: ADSPRPC: Initialize the list for global gfa maps
List initialization for global gfa remote heap maps is
missing. Initializing the same.

Change-Id: Ibe479a0ccc8b829919f5ce92f7ac2f868a546736
Acked-by: Himateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-04-03 10:28:16 -07:00
Tharun Kumar Merugu
3c2b633bb9 sdm660: ADSPRPC: Null check file session ctx during mmap create
During fastrpc mmap create and mmap free, we are dereferencing
file session context without checking for Null.

Change-Id: I65fc2bb566e2e6e7914b86044e17577a96db6b4f
Acked-by: Vishnu Karthik D <vikarthi@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-03-22 05:33:09 -07:00
Tharun Kumar Merugu
2b36fd66f7 msm: ADSPRPC: Null check for file session context
When any system call is made, before servicing it make sure that the
session context is not null and channel info is valid.

Change-Id: Ieba53b123d6553c5381db9f0b6d57b8f343e6155
Acked-by: Vishnu Karthik D <vikarthi@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-03-20 06:57:56 -07:00
Linux Build Service Account
db08e7c668 Merge "msm: ADSPRPC: Null check for file session context during release" 2017-03-09 17:21:32 -08:00
Linux Build Service Account
3a9ea3d533 Merge "msm: ADSPRPC: Create debugfs file with process name" 2017-03-09 17:21:32 -08:00
Sathish Ambley
df22d81402 msm: ADSPRPC: Null check for file session context during release
While releasing the device, check if the file session context is NULL
to make sure we are not dereferencing it during file free.

Change-Id: I310271189cf710b81c5182b936189fd57ddedd7b
Acked-by: Vishnu Karthik <vikarthi@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-03-08 10:55:48 -08:00
Sathish Ambley
748b6dc2a1 msm: ADSPRPC: Create debugfs file with process name
During device open create a debugfs file with name as the current
process name.

Change-Id: I7cb1c4a950b2498932f930eb79cb936952c0781d
Acked-by: Vishnu Karthik <vikarthi@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-03-07 11:21:09 -08:00
Tharun Kumar Merugu
1d18a9fdb5 msm: ADSPRPC: Handle SSR, daemon kill for audio PD
Handle SSR, daemon kill and restart scenarios for audio PD

Change-Id: If9c9e98642ad69866b19a7c0ea19160dcb357d34
Acked-by: Chenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2017-03-07 01:48:04 -08:00
Sathish Ambley
8f1eebdfa3 msm: ADSPRPC: Unregister glink notification handle after SSR
Unregister glink notification handle after SSR as otherwise it results
in the link up notification to be skipped resulting in incorrectly
completing the port open notification.

Change-Id: I668de44163a702faade1f170a74f66fb5a0c5571
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-02-27 16:04:56 -08:00
Sathish Ambley
3c6901ee67 msm: ADSPRPC: Set the device node in the session context
Set the device node associated with the session while creating
the context to allow for dma operations.

Change-Id: I7937a7bd533a9be09453144e20f7ecca3f3cc0ef
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-02-10 18:55:18 -08:00
Linux Build Service Account
f487064d89 Merge "msm: ADSPRPC: Buffer length to be copied is truncated" 2017-02-09 03:11:07 -08:00
Linux Build Service Account
d412bf2a8c Merge "msm: ADSPRPC: Check for buffer overflow condition" 2017-02-08 17:47:30 -08:00
Sathish Ambley
63f127db63 msm: ADSPRPC: Use correct method for static processes
Use correct method to connect to static processes as the existing
method was used for dynamic process creation.

Change-Id: Id7f631560edd9b8e4e970baecdda50f7804991bd
Acked-by: Ashwini Patil <aapatil@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-02-03 21:16:24 -08:00
Linux Build Service Account
294fecd4b8 Merge "msm: ADSPRPC: Use domain information to open channels" 2017-02-03 06:26:47 -08:00
Sathish Ambley
150e613cb7 msm: ADSPRPC: Use domain information to open channels
The domain information indicates which remote processor to
communicate with. Use this domain information to open up the
corresponding channel with the remote processor.

Change-Id: I54ddfae04ce71b3c760840e26285cd5754533882
Acked-by: Chenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-02-02 09:35:55 -08:00
Sathish Ambley
b6b6005b42 msm: ADSPRPC: Allow association with static processes
Allow process on application processor to be associated with a
process on DSP that has been spawned on bootup. This allows for
further RPC calls to be associated with the static process.

Change-Id: Id4b9f01ef47290bc885210bbf4da1796476ba85f
Acked-by: Ashwini Patil <aapatil@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-31 21:09:40 -08:00
Sathish Ambley
3823f0f8d0 msm: ADSPRPC: Check for buffer overflow condition
The buffer length that is being passed could result in overflow
condition causing invalid memory to be accessed.

Change-Id: I3e23f31b8cb61f8e77d09a39fab4a2d4c222cf25
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-26 10:54:57 -08:00
Sathish Ambley
99f5e59bf5 msm: ADSPRPC: Remove references to SMD
SMD is being removed from defconfig of SDM660. All the references
to SMD like macros and header files are removed from fastrpc driver.

Change-Id: Iaa961e7faee4b59562fc92133c5154027c325f53
Acked-by: Vishnu Karthik <vikarthi@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-22 21:36:22 -08:00
Sathish Ambley
dd2d22f7b7 msm: ADSPRPC: Expose information about open devices
Using Debugfs virtual file system to make debug information available
to userspace. A directory called adsprpc is created in debugfs root
directory and a debugfs file is created in this directory for every
device open in the fastrpc driver.

Change-Id: Ie944424e30ddc810ff29116481d63b266c47c037
Acked-by: Vishnu Karthik <vikarthi@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-22 21:35:53 -08:00
Linux Build Service Account
d1d4a1d606 Merge "msm: ADSPRPC: Update subsystem name for slpi" 2017-01-18 23:48:51 -08:00
Sathish Ambley
4669c8d278 msm: ADSPRPC: Attributes to process creation on remote processor
Allow creating user process on remote processor with attributes
to be used during process creation for debugging purposes.

Change-Id: I63081f8ed44bd8e86392d82018ce4e632284c6ed
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-18 14:30:40 -08:00
Sathish Ambley
8c18ec960f msm: ADSPRPC: Update subsystem name for slpi
Update subsystem name for slpi to ensure that the subsystem restart
notification is registered with the correct subsystem.

Change-Id: Ie4f409d6d63cd164323a2e58805b8154322518d1
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-18 13:00:28 -08:00
Sathish Ambley
df3c528a59 msm: ADSPRPC: add profiling counters
Added profiling counters for measuring RPC performance and
by default profiling is disabled.

Change-Id: I6a79dde638e751998ac37948f826639a161ff4a2
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-16 16:05:12 -08:00
Sathish Ambley
e83e4c14e9 msm: ADSPRPC: attributes to support per-buffer coherent mappings
Added attributes for forcing a buffer mapped as coherent or
non-coherent by using the DMA_ATTR_FORCE_COHERENT and
DMA_ATTR_FORCE_NON_COHERENT.

Change-Id: Ifecad81dd96b99ab63854bddce378ff775c22d38
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-11 16:10:30 -08:00
Sathish Ambley
b1cfb2c899 msm: ADSPRPC: Buffer length to be copied is truncated
The buffer length that is being used to allocate gets truncated
due to it being assigned to wrong type causing a much smaller
buffer to be allocated than what is required for copying.

Change-Id: I30818acd42bd282837c7c7aa16d56d3b95d4dfe7
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-06 16:09:45 -08:00
Linux Build Service Account
ba4fdd9852 Merge "msm: ADSPRPC: Add channel for compute/modem DSP" 2016-12-22 03:33:54 -08:00
Sathish Ambley
0bd3c17c62 msm: ADSPRPC: Add channel for compute/modem DSP
Add new channel to allow for communication to be established
between application and compute/modem DSP to enable RPC calls to
be made.

Change-Id: I98e443e894d81bcd815418f2a79723db14d87ce4
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-12-06 15:46:11 -08:00
Sathish Ambley
2295550247 msm: ADSPRPC: Use secure session device while freeing memory
Make sure that the secure session device is used while freeing the
buffer that was allocated from secure memory.

Change-Id: I07802c21c661fe18fb2fda70980b04f646408d7d
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-11-07 10:11:51 -08:00
Sathish Ambley
1a8a029dca msm: ADSPRPC: Do not pass offset for secure buffers
The secure buffers does not allow passing offset into the buffer
and hence skip calculation of offset for secure buffers.

Change-Id: I2cd3b87aca032d4c5868cc9db35987213349a337
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-10-28 09:50:42 -07:00
Linux Build Service Account
b3d0117122 Merge "msm: ADSPRPC: Support for dma-coherent devices" 2016-10-11 22:32:47 -07:00
Mitchel Humpherys
d26998e8f4 msm: ADSPRPC: Remove obsolete IOMMU domain attribute
The DOMAIN_ATTR_COHERENT_HTW_DISABLE IOMMU domain attribute is being
removed.  SMMU coherency will be configured through the SMMU device tree
nodes moving forward.  Remove the obsolete option.

Change-Id: I8bf9b5115db0394620fa96f4bdaf0faec4528709
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-09-26 17:42:53 -07:00
Sathish Ambley
ba1f879467 msm: ADSPRPC: Support for dma-coherent devices
Avoid cache maintenance operations (flush/invalidate) for
dma-coherent devices.

Change-Id: Ied6e925070db6fbfec80677b9f368325777db7b4
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-08-30 16:09:06 -07:00
Sathish Ambley
cac6ba2e77 msm: ADSPRPC: Update channel state during subsystem restart
Update channel link state when subsystem restart notification comes
in to ensure that the channel gets reopened properly when the subsystem
comes up.

Change-Id: I0d0762bc29982e1c15171c9597d86894caa34eb9
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-08-19 09:28:51 -07:00
Sathish Ambley
55d06ad8fb msm: ADSPRPC: Handle fastrpc glink channel open on timeout
Added channel state and checks to avoid glink channel opening twice
during timeout of previous call. Clean up and added more checks.

Change-Id: Ibf5343a86d3aeaf67acfbae381f103428c98ea73
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-07-14 14:08:50 -07:00
Sathish Ambley
e3ab187d0b msm: ADSPRPC: Handle glink channel errors
Check for error codes returned while opening the glink channel
and unregister for notifications only after the channel has
been closed.

Change-Id: Icb92ab9a430d7c49d4aac2d7c53fc6179407d082
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-06-07 11:53:16 -07:00
Sathish Ambley
7099c2a6d2 msm: ADSPRPC: Validate the SMMU session count
Make sure that the session count does not exceed the maximum
sessions to avoid buffer overflow.

Change-Id: I1a9830a6f859d7d525247d27d0a143997998d997
Acked-by: Bharath Kumar <bkumar@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-05-31 15:28:19 -07:00
Sathish Ambley
f9a4aed8c1 msm: ADSPRPC: Map pages with execute permissions
Allow for mappings to have execute permissions in Stage 2 SMMU
as dynamic shared object may get loaded and executed from these
pages on the remote processor.

Change-Id: I3d7fb2829defd8efc362253866587652f35e316b
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-05-24 11:57:42 -07:00
Sathish Ambley
3f00167fe4 msm: ADSPRPC: Provide process information in context
Provide process information as part of context being passed that
allows for messages to be queued appropriately on remote processor.

Change-Id: I93e3c6faa400121612d90f9be8fd5befe45fb39c
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-05-24 11:57:30 -07:00
Sathish Ambley
4ff21c7cfe msm: ADSPRPC: Provide SMMU information
Expose new IOCTL to provide SMMU information that allows for
userspace to determine the appropriate ION heap to be used.

Change-Id: Iead0966d76acb2d2bbc41fa9cd5d09a252a3429e
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-05-24 11:57:16 -07:00
Sathish Ambley
3469531db3 msm: ADSPRPC: Support for secure context banks
Add support for secure session that checks whether the
buffer being passed was allocated from a secure heap and
appropriately maps the buffers in the secure context bank.

Change-Id: If590f65d033e264c04f0ad782895b02765ff4f3d
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-05-19 16:08:07 -07:00
Sathish Ambley
1e82e66030 msm: ADSPRPC: FastRPC migration to GLINK from SMD
FastRPC migration to use GLINK from existing SMD driver for inter-
process communication. Updated FastRPC context bank details for
msmcobalt. Added "qcom,enable-glink" option in dtsi file for
using glink, uses smd if this flag is not defined.

Change-Id: I4a933c9b3355b0aa1b653719ec1ec7ded1f368dd
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-04-13 11:08:34 -07:00
Sathish Ambley
52bdc8c7e6 msm: ADSPRPC: Free file private data after session close
Release the session before the file data is freed to
allow for session informaiton to be retrieved from the
file data.

Change-Id: I78c36d7b34a141c6162a145f7447040395858b64
Acked-by: Bharath Kumar <bkumar@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-03-25 16:03:29 -07:00
Sathish Ambley
7c7281de28 msm: ADSPRPC: Fix memory leak for remote heap
Fix the condition that was causing the remote heap from
not being freed.

Change-Id: I825e813f4f4e7c3cecaf9150d9ef40ff40cfb5a2
Acked-by: Bharath Kumar <bkumar@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-03-25 16:03:19 -07:00
Sathish Ambley
c2410d63be msm: ADSPRPC: Enable RPC on SLPI processor
Add new channel to be able to communicate with SLPI processor
and do remote procedure calls from Apps subsystem. The Apps
and SLPI subsystems would use the memory from ADSP ION heap
for sharing the input and output buffers.

Change-Id: I186ec8e7769011d7aeeba149017f1555f2d84ed7
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-03-23 21:23:27 -07:00
Sathish Ambley
ba8056f2a6 msm: ADSPRPC: Call free only when allocation succeed
Call free only when allocation succeeded, otherwise skip freeing
remote heap memory.

Change-Id: I749c7956377764fe04e1b47898b4acb390c6b942
Acked-by: Himateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-03-23 21:23:26 -07:00
Sathish Ambley
0cffc97b53 ARM: dts: msm: ADSPRPC: Remove IOMMU domain adsp_shared_domain
Remove IOMMU domain adsp_shared_domain as domain is created
at runtime.

Change-Id: Ic5e4aa9f05167be7c721b3c1fd71ab889c1fcd1d
Acked-by: Himateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-03-23 21:23:25 -07:00
Sathish Ambley
08f929d272 msm: ADSPRPC: Call find_vma with mmap_sem semaphore held
Calling find_vma() with out holding the mmap_sem semaphore is
not safe especially when an another thread could be removing
vmas from the list. Remove find_vma in places where it is
being used just for debugging purposes.

Change-Id: I1ac12410a0880d92c7301065aa656b5ad8d521cf
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-03-23 21:23:24 -07:00
Sathish Ambley
1befdae1fa msm: ADSPRPC: Enable session restart with remote heap
Enable session restart when remote heap is allocated to
ADSP.

Change-Id: If4cd477f8c5994445f4a0e951a544afaa33be112
Acked-by: Himateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-03-23 21:23:23 -07:00