Message ID | 20241202064806.1164800-1-quic_ekangupt@quicinc.com |
---|---|
Headers | show |
Series | Add changes to use session index as identifier | expand |
On Mon, Dec 02, 2024 at 12:18:05PM +0530, Ekansh Gupta wrote: > Memory intensive applications(which requires more tha 4GB) that wants > to offload tasks to DSP might have to split the tasks to multiple > user PD to make the resources available. > > For every call to DSP, fastrpc driver passes the process tgid which > works as an identifier for the DSP to enqueue the tasks to specific PD. > With current design, if any process opens device node more than once > and makes PD init request, same tgid will be passed to DSP which will > be considered a bad request and this will result in failure as the same > identifier cannot be used for multiple DSP PD. > > Assign and pass a client ID to DSP which would be assigned during device > open and will be dependent on the index of session allocated for the PD. > This will allow the same process to open the device more than once and > spawn multiple dynamic PD for ease of processing. > > Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com> > --- > drivers/misc/fastrpc.c | 29 +++++++++++++++-------------- > 1 file changed, 15 insertions(+), 14 deletions(-) > > @@ -1480,6 +1481,7 @@ static struct fastrpc_session_ctx *fastrpc_session_alloc( > if (!cctx->session[i].used && cctx->session[i].valid) { > cctx->session[i].used = true; > session = &cctx->session[i]; > + fl->client_id = i + 1; /* any non-zero ID will work, session_idx + 1 is the simplest one */ With the comment in place, LGTM > break; > } > }