Commit Graph

15 Commits

Author SHA1 Message Date
Himateja Reddy
4c5701814d msm: adsprpc: Allocate designated context bank session
Currently SMMU context banks are chosen dynamically based on
available context bank. Few use cases requires context banks to
be fixed to retain SMMU mappings even after process exits and resumes
again. Few other use cases requires to use multiple context banks of
similar remote subsystem process types. Allocate designated context
bank session with process type  matching with remote subsystem
process type.

Change-Id: Ie8ccad2fde4e2e21aaf8c6ede0ab31645cdf350c
Signed-off-by: Himateja Reddy <quic_hmreddy@quicinc.com>
2023-05-15 08:53:34 -07:00
Vamsi Krishna Gattupalli
264671ac79 msm: adsprpc: Share initial debug config to DSP
This change enables sharing of a new page to DSP.
New page will contain inital debug parameters which we
need to pass to the DSP during the process initiation.

Change-Id: I8ae12cb364811a97eca3f15e70106b36bcec3f54
Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
2023-04-19 14:08:04 -07:00
Himateja Reddy
5f713c22a4 msm: adsprpc: Fix race in async context response
Currently async job is first added to pending context list and later
job is send to remote sub system. After the job is added to pending
context list, if any SSR happens, all the async pending job contexts are
responded and freed in async response thread. Original thread that added
job to pending context list might not have sent the job, as there is SSR and can
free the context again in same thread. Queue response in SSR only when
the job is sent to remote sub system.

Signed-off-by: Himateja Reddy <quic_hmreddy@quicinc.com>
Change-Id: I1f880316f327a8345433d5d22b619ef0a50d7240
2023-04-10 09:25:34 -07:00
Santosh Sakore
c0787f2846 Synchronize exit process and bus driver invoke
In current code fastrpc_file_free and bus driver invoke call are in
parallel, we would see corruption as both try to access fastrpc_mmap
list. To resolve this issue added signaling mechanism between
fastrpc_file_free and bus driver invoke call. If bus driver invoke
call is running in parallel with fastrpc_file_free, it would wait
until the invoke call is completed. Also added locks in bus driver API
to protect fastrpc_mmap's.
To improve code readablity created separate API for bus driver map
and unmap.

Change-Id: I5fd6f331febdecb319b168b36590a73e4532038a
Signed-off-by: Anirudh Raghavendra <quic_araghave@quicinc.com>
2023-04-05 15:08:22 +05:30
nishant chaubey
4d19368b34 msm: adsprpc: no debug info if ioctl wait for pdup
If pd is down, new device ioctls wait for pdup before
copying ioctl params and saving ctx information.
Shift logic to check pdup from device_ioctl to after
context creation and before invoke send to allow
current ioctl information to be store in pending ctx.

Change-Id: Ia9747394020fd35b02f4074a82edecace72f87db
Signed-off-by: nishant chaubey <quic_chaubey@quicinc.com>
2023-03-16 20:34:00 -07:00
Edgar Flores
ed0b528087 adsprpc: Enable fastrpc trusted driver
Fixes to fastrpc trusted driver to run on TVM.
Added a workqueue for receiving kernel packets.
Changed array allocation of kernel sockets to save space.
Original design was allocating static 2-d array glist_session_ctrl
for all possible subsystems and domains.
New implementation is allocating staic 2-d reference array.
Each entry in the array will only be allocated if remote domain
is supported.

Change-Id: I303375822714aa6f8eadf525b09326aa05714fd7
Signed-off-by: Edgar Flores <quic_edgarf@quicinc.com>
2023-03-16 14:14:25 -07:00
Anirudh Raghavendra
7b787e07ef Increase number of allowed sessions to 14
Increasing number of allowed sessions from 13 to 14 to accomodate
the shared context banks for CPZ.

Change-Id: Ie0757dae9d0876f5e827daab4fe9e9a661fc0680
Signed-off-by: Anirudh Raghavendra <quic_araghave@quicinc.com>
2023-03-13 19:18:09 -07:00
Vamsi Krishna Gattupalli
7d90dc2702 msm: ADSPRPC: Add subsystem states for restart, up and down
Current subsystem state flag cannot define all state of the subsystem.
Different handling might be needed for different subsystem states.
Add multiple subsystem state support.

Change-Id: Id091dfded583c8cd7e95c0d306de6dd34b03485d
Acked-by: Santosh Sakore <ssakore@qti.qualcomm.com>
Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
2023-02-27 21:54:04 -08:00
nishant chaubey
c31f7a037d msm: adsprpc: add variable to store interrupted ts
Currently no debug information of when ctx interrupted,
restored. This make ioctl hang/high invoke time issues
hard to debug. Add variables to store interrupted, restore
timestamp in pending ctx and gmsg_log.

Change-Id: I32226e96c54acb5878f2b8d37110bae7f65d49f3
Signed-off-by: nishant chaubey <quic_chaubey@quicinc.com>
2023-02-25 04:26:28 -08:00
nishant chaubey
4fef948448 msm: adsprpc: add ioctl control for thread exit
Add ioctl control support to exit notif and async
threads.

Change-Id: Ifc7212fd84bdba46724252e00e1d479865cefc64
Signed-off-by: nishant chaubey <quic_chaubey@quicinc.com>
2023-02-13 11:08:46 +05:30
Vamsi Krishna Gattupalli
e1f8f88b4b msm: ADSPRPC: Use PD type enums instead of magic numbers
Currently PD type is getting updated with some magic numbers. Add
enum with different PD type information and use these types instead
of magic numbers for better code readability.

Change-Id: I20eb03726cabfcc88589be215c3c967b608a9cdb
Acked-by: Ekansh Gupta <ekangupt@qti.qualcomm.com>
Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
2023-01-23 10:42:43 +05:30
Himateja Reddy
38ca55b8e5 msm: adsprpc: Share CP secure context banks
Currently CPZ secure context banks are not shared on CDSP. Share
CP secure context banks among applications that use secure memory,
so that many CPZ applications can be spawned and offloaded to DSP.

Change-Id: I77d95bab86ef527e41c9fe79058742615f4adb0e
Signed-off-by: Himateja Reddy <quic_hmreddy@quicinc.com>
2022-11-18 13:51:26 -08:00
Anirudh Raghavendra
f8b3c01858 Add snapshot from Kailua
Added snapshot of fastrpc code on Kailua to Lanai component.

Change-Id: I50bd699ef1c502116368c383ed9dc28f675d393c
Signed-off-by: Anirudh Raghavendra <quic_araghave@quicinc.com>
2022-11-08 13:48:12 -08:00
Anirudh Raghavendra
3a10a6b261 Resolve compilation errors in adsprpc
Number of parameters in print statement was less than number of
format specifiers. This was causing an error with the new kernel
compiler.

Change-Id: Iad4ed0ad373559ecd64e8d9bfb1da37532f443c9
Signed-off-by: Anirudh Raghavendra <quic_araghave@quicinc.com>
2022-11-02 14:59:50 -07:00
Anirudh Raghavendra
b0ee7bc076 adsprpc: Add initial src files to new target
Add fastrpc driver files to vendor branch

Change-Id: I852eee93cf6c0b2bc0833f9635f73b890de930da
Signed-off-by: Anirudh Raghavendra <quic_araghave@quicinc.com>
2022-08-12 17:41:38 -07:00