diff --git a/dsp/adsprpc.c b/dsp/adsprpc.c index dfed99a68e..60cea8826f 100644 --- a/dsp/adsprpc.c +++ b/dsp/adsprpc.c @@ -1207,7 +1207,7 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, struct dma_buf * map->secure = (mem_buf_dma_buf_exclusive_owner(map->buf)) ? 0 : 1; if (map->secure) { if (!fl->secsctx) - err = fastrpc_session_alloc(chan, 1, 0, + err = fastrpc_session_alloc(chan, 1, me->share_securecb, &fl->secsctx); if (err) { ADSPRPC_ERR( @@ -7374,6 +7374,9 @@ static int fastrpc_cb_probe(struct device *dev) if (of_get_property(dev->of_node, "shared-cb", NULL) != NULL) { sess->smmu.sharedcb = 1; + // Set share_securecb, if the secure context bank is shared + if (sess->smmu.secure) + me->share_securecb = 1; err = of_property_read_u32(dev->of_node, "shared-cb", &sharedcb_count); if (err) diff --git a/dsp/adsprpc_shared.h b/dsp/adsprpc_shared.h index ad434b2407..0b66a622db 100644 --- a/dsp/adsprpc_shared.h +++ b/dsp/adsprpc_shared.h @@ -945,6 +945,8 @@ struct fastrpc_apps { struct mutex mut_uid; /* Indicates cdsp device status */ int remote_cdsp_status; + /* Indicates secure context bank to be shared */ + int share_securecb; }; struct fastrpc_mmap {