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>
This commit is contained in:
Santosh Sakore
2023-04-05 15:08:22 +05:30
parent ff4c4832be
commit c0787f2846
2 changed files with 140 additions and 80 deletions

View File

@@ -1091,6 +1091,10 @@ struct fastrpc_file {
struct completion work;
/* Flag to indicate ram dump collection status*/
bool is_ramdump_pend;
/* Process kill will wait on bus driver invoke thread to complete its process */
struct completion dma_invoke;
/* Flag to indicate invoke pending */
bool is_dma_invoke_pend;
/* Flag to indicate type of process (static, dynamic) */
uint32_t proc_flags;
/* If set, threads will poll for DSP response instead of glink wait */