msm: adsprpc: Usage of HLIST for async queue instead of LIST

To avoid queueing of a duplicate job that may belong to a freed ctx,
update async queue type from LIST to HLIST to avoid appending unhashed
nodes back to queue. Thread race can occur between thread undergoing
SSR routine and invoke response thread for FASTRPC_INVOKE2_ASYNC_RESPONSE
to queue job to the async queue.

Change-Id: Iebcd0e82f22ceb64d0f89e8458d6329c08c62bdc
Signed-off-by: Ansa Ahmed <quic_ansa@quicinc.com>
This commit is contained in:
Ansa Ahmed
2023-08-02 02:18:11 +05:30
parent 7fd02f3859
commit 6087dc5827
2 changed files with 15 additions and 11 deletions

View File

@@ -579,7 +579,7 @@ struct smq_notif_rsp {
struct smq_invoke_ctx {
struct hlist_node hn;
/* Async node to add to async job ctx list */
struct list_head asyncn;
struct hlist_node asyncn;
struct completion work;
int retval;
int pid;
@@ -631,7 +631,7 @@ struct fastrpc_ctx_lst {
/* Number of active contexts queued to DSP */
uint32_t num_active_ctxs;
/* Queue which holds all async job contexts of process */
struct list_head async_queue;
struct hlist_head async_queue;
/* Queue which holds all status notifications of process */
struct list_head notif_queue;
};