From nobody Sun Feb 8 13:10:19 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CFE220E33E for ; Fri, 10 Jan 2025 13:43:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736516607; cv=none; b=kIN9iSArZ00GvaiTY5K9AROEmTIeY2+MLgmPpHhnHTPBnm1C72P/G9lk8W6iEOXEuwpJae/Gfh9OWfSHdq8Wf8RJlKgCr8uxxo606oqNCDE2p8JxeloWNf/FZiwMJHGYiM/R9AeAic1gFGpHwb0uZjbdAp56pw/oJhj5oqxKzZo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736516607; c=relaxed/simple; bh=i9Tw6eantn3+BORtYG8iZLD/5FotCFM3LFSge0kQNK4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=G3uo6/MJRqnc8/tZwYxrx3trza+W2dRFkW1ygaGDVs3M4iUNlBQjLYqhTC2tyVgh4V5JYEUUUjcfSojLPPEBzclAZgwfx2EbcPceL969RJ8bNXknHkDXDeSylO737gtwDSRkGrMy+P9/gQrqpoAZcKoWC0oZkcAwAgar4MDDhZ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=YHUlhgMq; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YHUlhgMq" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4368a293339so24071205e9.3 for ; Fri, 10 Jan 2025 05:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736516604; x=1737121404; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ajo8u0kIl962rl2+ZgG5egD0kAGGvfs8eYYdpNWhY1I=; b=YHUlhgMqZwFDJEJ2oj7XDiXC0I3ss1T4F8jmX7hD91HwetwCQd1QofQ5SBWEtdtPpR +hGZusHiirikDf+kg20T0yZwNjnp330wYcRt9jxB6qm49auuabLcpfSFyBE3jXoetrT6 vooGBYDr7PqbX9USv/g9iECfh6wqNxF2OxBUqSfKHzNumiTsrIBWq5o0dINwA0QN4+RG VYJey3Oyyert+HUrYfwJ44GmTLLHqSQS4M+i8oCnhcsYpfrqY9Y4ZRfH1YIVBtzGJ1Ky uYh7H1TqkVg7s8VnQyOVOoHPhMjEbkoxrMU3odZKHCn4Ywoos8p1VsY/+NDTvaljR2D6 u1+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736516604; x=1737121404; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ajo8u0kIl962rl2+ZgG5egD0kAGGvfs8eYYdpNWhY1I=; b=p759pvlJqkLqphqHUPHKwPAn3T3GtScncDMJz01rvhThIOADN4cKUBYsnvNWL4w9YL XLRt35+Zgx5nmTYmyPr04RZW1bBmleb7BMtdvgTUxkkdxf0GT9G4OtuFeajeED96c/cf 22zFUkyBIMSxebzvJmILTiBskQLywhVhKp/umxCG/ARJgWxs9jnBZkUyXwblJNz66EzP Yy82y+SIiCH0fx+1vhsFNzhr5S5HLYVvrjWRs9OrnUVcH8Yilopn/NW2xupllSa5Ks+3 H2Kxxip5W2mf2LzqM91l5Q6sOWCtH7g/e30BxR+boI9A8zNsrGE5huPIBmnJZbPW20aV KP4w== X-Gm-Message-State: AOJu0Ywjo1b4IPzGTCdwWXr4QsYS1OZSK7XeX8ozLbajT5JttOgjUN9o IgKcd3aULeFjeTG1T5ByOPVwPpagBTDERp8F4A32dQ4kKNohX7piV0sERjwhOLA= X-Gm-Gg: ASbGncsLp8OqM9BUbFF3K+808LQvWzk6T2x90S1n0v3dIeeau3/Fa680EtAPIQ0v8tP CXb2vsqVLYgLx/7+cMi8WE41aMJqFDznuTEBBsu1pgFVsERk1tLTs0HIAhs+Iyl8K5DlgE5+lRz 1RUlt/AAMg/5Zn/H9myo8BIBr0xlt9zmIDHLpEcNBcGhZ5PpPUguA393SG64pjJOMbUWkIOrjGm I7XGjZmFn42RwKu+nJmvHKnqNm+vr6N6x5gkNgh65pHSaV71KXieZZM9EuqAYeOUAwjhja2YNvT m6nkFQ== X-Google-Smtp-Source: AGHT+IFaM50SSaS2GGHdg5lKMbH/liiYHBcYq/ww1UAzsj3ZSvh1bXen+CJXpb7/XJzWqujI3O2uHA== X-Received: by 2002:a05:600c:3b08:b0:436:18e5:6917 with SMTP id 5b1f17b1804b1-436e255ffd6mr110212225e9.0.1736516603626; Fri, 10 Jan 2025 05:43:23 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436dd11d8b4sm78168695e9.1.2025.01.10.05.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 05:43:23 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Ekansh Gupta , Dmitry Baryshkov , Srinivas Kandagatla Subject: [PATCH 1/2] misc: fastrpc: Add support for multiple PD from one process Date: Fri, 10 Jan 2025 13:43:07 +0000 Message-Id: <20250110134308.123739-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250110134308.123739-1-srinivas.kandagatla@linaro.org> References: <20250110134308.123739-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5419; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=5pjgljuPUGLpKCpBFb1JGP5NYVK+cBcdFYBSQIr6uCI=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBngSPs+Op7mulrHE4gelvAMsJvVRiEDmzAA2vtD ML7yMxN+iOJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZ4Ej7AAKCRB6of1ZxzRV N/kPB/47wmymvBn8c6w1HRmKrx2/Hd5oNfap/fbaudwnv9avEjxqVe0ZQm5oEquUUl/NOB1Z4et Iup2ivatKEORGlqEMWdZPxpEZilR8p9z/eHev7iA2Eqyt5uJGwsVt0M+Xd1V/YIm+yYj2T3XgTx BIdslh6BoJMk4Zbhb5K4BpfjhOIZS4nUHjs+x5Xk9K7q5JVauD2J0aRHaiCPU0lorXg6LyI5P3/ GoGD7c2fu7KZBu3Zeaubw5YzDBk30IfDRUlH7T7kqJJv6gkW5j5W0o3v9lvC30PxGxTOJd3OzwX 3LiiweJco4KlCKoYhpTeW0Ena2heP+o+s1wDSRxaTREP6Tdx X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ekansh Gupta 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 Reviewed-by: Dmitry Baryshkov Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 74181b8c386b..9410b4b2eab7 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -299,7 +299,7 @@ struct fastrpc_user { struct fastrpc_session_ctx *sctx; struct fastrpc_buf *init_mem; =20 - int tgid; + int client_id; int pd; bool is_secure_dev; /* Lock for lists */ @@ -614,7 +614,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc( ctx->sc =3D sc; ctx->retval =3D -1; ctx->pid =3D current->pid; - ctx->tgid =3D user->tgid; + ctx->tgid =3D user->client_id; ctx->cctx =3D cctx; init_completion(&ctx->work); INIT_WORK(&ctx->put_work, fastrpc_context_put_wq); @@ -1115,7 +1115,7 @@ static int fastrpc_invoke_send(struct fastrpc_session= _ctx *sctx, int ret; =20 cctx =3D fl->cctx; - msg->pid =3D fl->tgid; + msg->pid =3D fl->client_id; msg->tid =3D current->pid; =20 if (kernel) @@ -1293,7 +1293,7 @@ static int fastrpc_init_create_static_process(struct = fastrpc_user *fl, } } =20 - inbuf.pgid =3D fl->tgid; + inbuf.pgid =3D fl->client_id; inbuf.namelen =3D init.namelen; inbuf.pageslen =3D 0; fl->pd =3D USER_PD; @@ -1395,7 +1395,7 @@ static int fastrpc_init_create_process(struct fastrpc= _user *fl, goto err; } =20 - inbuf.pgid =3D fl->tgid; + inbuf.pgid =3D fl->client_id; inbuf.namelen =3D strlen(current->comm) + 1; inbuf.filelen =3D init.filelen; inbuf.pageslen =3D 1; @@ -1469,8 +1469,9 @@ static int fastrpc_init_create_process(struct fastrpc= _user *fl, } =20 static struct fastrpc_session_ctx *fastrpc_session_alloc( - struct fastrpc_channel_ctx *cctx) + struct fastrpc_user *fl) { + struct fastrpc_channel_ctx *cctx =3D fl->cctx; struct fastrpc_session_ctx *session =3D NULL; unsigned long flags; int i; @@ -1480,6 +1481,8 @@ static struct fastrpc_session_ctx *fastrpc_session_al= loc( if (!cctx->session[i].used && cctx->session[i].valid) { cctx->session[i].used =3D true; session =3D &cctx->session[i]; + /* any non-zero ID will work, session_idx + 1 is the simplest one */ + fl->client_id =3D i + 1; break; } } @@ -1504,7 +1507,7 @@ static int fastrpc_release_current_dsp_process(struct= fastrpc_user *fl) int tgid =3D 0; u32 sc; =20 - tgid =3D fl->tgid; + tgid =3D fl->client_id; args[0].ptr =3D (u64)(uintptr_t) &tgid; args[0].length =3D sizeof(tgid); args[0].fd =3D -1; @@ -1579,11 +1582,10 @@ static int fastrpc_device_open(struct inode *inode,= struct file *filp) INIT_LIST_HEAD(&fl->maps); INIT_LIST_HEAD(&fl->mmaps); INIT_LIST_HEAD(&fl->user); - fl->tgid =3D current->tgid; fl->cctx =3D cctx; fl->is_secure_dev =3D fdevice->secure; =20 - fl->sctx =3D fastrpc_session_alloc(cctx); + fl->sctx =3D fastrpc_session_alloc(fl); if (!fl->sctx) { dev_err(&cctx->rpdev->dev, "No session available\n"); mutex_destroy(&fl->mutex); @@ -1647,7 +1649,7 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user *= fl, char __user *argp) static int fastrpc_init_attach(struct fastrpc_user *fl, int pd) { struct fastrpc_invoke_args args[1]; - int tgid =3D fl->tgid; + int tgid =3D fl->client_id; u32 sc; =20 args[0].ptr =3D (u64)(uintptr_t) &tgid; @@ -1803,7 +1805,7 @@ static int fastrpc_req_munmap_impl(struct fastrpc_use= r *fl, struct fastrpc_buf * int err; u32 sc; =20 - req_msg.pgid =3D fl->tgid; + req_msg.pgid =3D fl->client_id; req_msg.size =3D buf->size; req_msg.vaddr =3D buf->raddr; =20 @@ -1889,7 +1891,7 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, = char __user *argp) return err; } =20 - req_msg.pgid =3D fl->tgid; + req_msg.pgid =3D fl->client_id; req_msg.flags =3D req.flags; req_msg.vaddr =3D req.vaddrin; req_msg.num =3D sizeof(pages); @@ -1978,7 +1980,7 @@ static int fastrpc_req_mem_unmap_impl(struct fastrpc_= user *fl, struct fastrpc_me return -EINVAL; } =20 - req_msg.pgid =3D fl->tgid; + req_msg.pgid =3D fl->client_id; req_msg.len =3D map->len; req_msg.vaddrin =3D map->raddr; req_msg.fd =3D map->fd; @@ -2031,7 +2033,7 @@ static int fastrpc_req_mem_map(struct fastrpc_user *f= l, char __user *argp) return err; } =20 - req_msg.pgid =3D fl->tgid; + req_msg.pgid =3D fl->client_id; req_msg.fd =3D req.fd; req_msg.offset =3D req.offset; req_msg.vaddrin =3D req.vaddrin; --=20 2.25.1 From nobody Sun Feb 8 13:10:19 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FEF620E334 for ; Fri, 10 Jan 2025 13:43:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736516608; cv=none; b=t3cMjsjJIk8d95mbtMXyYkbr6Dpuy2IT8DtnBSZ2sI6Ijr9SE6RjdhRKxPRlrr2vpIN5iNd3SqQ81sk3eDewr98Lmst8IWt7+Klw9wvrERtohLFgG24VcSVKKLRf76tVe0yjFxvUjnB4p/8OGj/9zTDm+mHx+4TUtlQ+wB7zPis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736516608; c=relaxed/simple; bh=O0ZO9OSDbHGqIQA2FBb4PsiH4E3n1sgvCmfDnr84JHU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OBSeo4bW5MxEta8nxvRtgd+6v8Xq/86lakCGeflXwuYtmer5uob54PbfyESTw9qQnG6DWj/48YaRrIYwho8+4nGypkdxVnJM/+z3yRI7f79XxfNH4b0UIxgF4g/8K4pNpfYh7/9zXbaK5Lz8R9UWCapYgEKPagrLgsmHUCu3W+8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=v5zxRFtD; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="v5zxRFtD" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43624b2d453so22145605e9.2 for ; Fri, 10 Jan 2025 05:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736516604; x=1737121404; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m58jWPRh/opgoyWH5WjM7QVLBqAqXQA6emtK2XQtdYc=; b=v5zxRFtDOLjD5JXhGDOT50Y1496SRlMQV1kO1VhCzLcZnL2YYr0jIGrdnpzhghgyHp AlI8TbxiQMZxNltNT6BgARc/t1HTVqY81tT8PRg8lPfhEtT7QVHYOFjxFmSDkHuSzgBx JqVnkIJlbjaOT8X5Ysfr9UJc/mUbAi+5C5N3804BZanzM/cL5+uGkmxDbodctJm3aTP2 k7ionhfcTyLlroGJv+Fp7VrAeCd/s5r9VhwaHMQPCycM1FjfLT3ryebwX5HRhzlreFvR pmQxixR6FlHrtF/wrXX2D6TnDOUMd2c2VLFRNGn4vUiPWyzriKTvZJVH/hFtMD05Z87T ATQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736516604; x=1737121404; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m58jWPRh/opgoyWH5WjM7QVLBqAqXQA6emtK2XQtdYc=; b=JL7DFCBxQMtcMQULgIJbv5WJB58GrnAo7Af4ai6fJRIcSEckdtrGt2/cw5ip/FVAi1 PXw6ybYGilCBDszcYiIu4sYfWlDNpakx1bJIcbBiB1qZasBoADD91ium1744DTnJnPlR lSuH3isuaRmIu7Bl55tex8vrMTSZxUxznvve0FENp8HQfnFq1LDh6TCvEqfnUsmtnk7T NAYMU+NRBTUOVhMQtzxPVcvE3YVZZQkenP440FGH5d0CHmxBltnpw7SASrJc6z+X3rrU DdnaQUqABdOWAsjOX65coGmO5r8bCbn6yRwSP1AQ80zUE6FNM4fwO53baaaOz7dSedbr XcDw== X-Gm-Message-State: AOJu0YwqwsF/TOfJcL6DPWBWhXbEmRMtYW9cjCu4upTmRwmZuMgghX6p rvJKDzlabtl0W8AQjgUNheoEETmZ4Ib0MBWsTxQQyYQaRAjlKdK28kQkXkPr5s4= X-Gm-Gg: ASbGncvC2qptKJtcfb9edxKPZQoWZxk8jK0xjkJucap6uhAIcr5GjsMDt2B/u8tNzFu t2nYNJVxm0PpIV6iAuWtujTc9Sov5WykT2O6itRg0IBGtyfTkLAtq3F7qtgjeilYG1LP7wcqQCm /mUJ9AinTmFsaCE5aO+thc/hklgTxpuFs8YoMtoKLwkWhgZdIUlIj1vCM1ZZXVillnN8onYD0Hi AdhOa6SibWlcJBF7PCxVT++7tCB/EL5YXa6953zequ0CO6rxKAaq5gmQ+N3TTUsUrTsW5T72s9W IA7PAg== X-Google-Smtp-Source: AGHT+IFdA5d3mG5oGhT+GbufTtdua52Ea87GW560SD8An1cRKb8ArIN2wulpEIcyfC8/vyyHYHFdCw== X-Received: by 2002:a5d:6484:0:b0:385:d143:138b with SMTP id ffacd0b85a97d-38a87357274mr10429017f8f.51.1736516604450; Fri, 10 Jan 2025 05:43:24 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436dd11d8b4sm78168695e9.1.2025.01.10.05.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 05:43:23 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Ekansh Gupta , Dmitry Baryshkov , Srinivas Kandagatla Subject: [PATCH 2/2] misc: fastrpc: Rename tgid and pid to client_id Date: Fri, 10 Jan 2025 13:43:08 +0000 Message-Id: <20250110134308.123739-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250110134308.123739-1-srinivas.kandagatla@linaro.org> References: <20250110134308.123739-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5611; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=mx7x9oO5e8pI0enYqfmfwsESJbApQeNAZitepkTUgN8=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBngSPsdeglDk+pS5hWdVlTqaoIhROBKklMG9mXW 71stKdePdCJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZ4Ej7AAKCRB6of1ZxzRV N5quCACY/1S+ybmbj1TD5d908nI7cWnHZKZ8buLcgY4sRVuZ9eq3RSVk0RPBjfJRpBl06lC6jZM VIibPSblmunhmiN2CoFKAa9iE+MnOtxASHgifA644BJt3qYRktyUkcqT+yt/f1XyfmnKXT9Zuh9 fiCA4wlG2GNAGAYMWlhRqWwjieChb6wqXyWAI1w567gQ7ygEQTFYbloYNmQhoKqTnlmZfiTy7Kg Zf1jcXP9yES0FhnkeeCv5JFwu1lH1nh9IcxU+S6D7AiqZOKgho50PMG+N6KQt2lLuHz8XWQCgOT h5H9m928YNVhFpPBJRB73CNyACeHf5Ac5llSexHM3RCCF7n9 X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ekansh Gupta The information passed as request tgid and pid is actually the client id of the process. This client id is used as an identifier by DSP to identify the DSP PD corresponding to the process. Currently process tgid is getting passed as the identifier which is getting replaced by a custom client id. Rename the data which uses this client id. Signed-off-by: Ekansh Gupta Reviewed-by: Dmitry Baryshkov Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 9410b4b2eab7..42b4d60c224c 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -139,14 +139,14 @@ struct fastrpc_mmap_rsp_msg { }; =20 struct fastrpc_mmap_req_msg { - s32 pgid; + s32 client_id; u32 flags; u64 vaddr; s32 num; }; =20 struct fastrpc_mem_map_req_msg { - s32 pgid; + s32 client_id; s32 fd; s32 offset; u32 flags; @@ -156,20 +156,20 @@ struct fastrpc_mem_map_req_msg { }; =20 struct fastrpc_munmap_req_msg { - s32 pgid; + s32 client_id; u64 vaddr; u64 size; }; =20 struct fastrpc_mem_unmap_req_msg { - s32 pgid; + s32 client_id; s32 fd; u64 vaddrin; u64 len; }; =20 struct fastrpc_msg { - int pid; /* process group id */ + int client_id; /* process client id */ int tid; /* thread id */ u64 ctx; /* invoke caller context */ u32 handle; /* handle to invoke */ @@ -234,7 +234,7 @@ struct fastrpc_invoke_ctx { int nbufs; int retval; int pid; - int tgid; + int client_id; u32 sc; u32 *crc; u64 ctxid; @@ -614,7 +614,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc( ctx->sc =3D sc; ctx->retval =3D -1; ctx->pid =3D current->pid; - ctx->tgid =3D user->client_id; + ctx->client_id =3D user->client_id; ctx->cctx =3D cctx; init_completion(&ctx->work); INIT_WORK(&ctx->put_work, fastrpc_context_put_wq); @@ -1115,11 +1115,11 @@ static int fastrpc_invoke_send(struct fastrpc_sessi= on_ctx *sctx, int ret; =20 cctx =3D fl->cctx; - msg->pid =3D fl->client_id; + msg->client_id =3D fl->client_id; msg->tid =3D current->pid; =20 if (kernel) - msg->pid =3D 0; + msg->client_id =3D 0; =20 msg->ctx =3D ctx->ctxid | fl->pd; msg->handle =3D handle; @@ -1244,7 +1244,7 @@ static int fastrpc_init_create_static_process(struct = fastrpc_user *fl, int err; bool scm_done =3D false; struct { - int pgid; + int client_id; u32 namelen; u32 pageslen; } inbuf; @@ -1293,7 +1293,7 @@ static int fastrpc_init_create_static_process(struct = fastrpc_user *fl, } } =20 - inbuf.pgid =3D fl->client_id; + inbuf.client_id =3D fl->client_id; inbuf.namelen =3D init.namelen; inbuf.pageslen =3D 0; fl->pd =3D USER_PD; @@ -1363,7 +1363,7 @@ static int fastrpc_init_create_process(struct fastrpc= _user *fl, int memlen; int err; struct { - int pgid; + int client_id; u32 namelen; u32 filelen; u32 pageslen; @@ -1395,7 +1395,7 @@ static int fastrpc_init_create_process(struct fastrpc= _user *fl, goto err; } =20 - inbuf.pgid =3D fl->client_id; + inbuf.client_id =3D fl->client_id; inbuf.namelen =3D strlen(current->comm) + 1; inbuf.filelen =3D init.filelen; inbuf.pageslen =3D 1; @@ -1504,12 +1504,12 @@ static void fastrpc_session_free(struct fastrpc_cha= nnel_ctx *cctx, static int fastrpc_release_current_dsp_process(struct fastrpc_user *fl) { struct fastrpc_invoke_args args[1]; - int tgid =3D 0; + int client_id =3D 0; u32 sc; =20 - tgid =3D fl->client_id; - args[0].ptr =3D (u64)(uintptr_t) &tgid; - args[0].length =3D sizeof(tgid); + client_id =3D fl->client_id; + args[0].ptr =3D (u64)(uintptr_t) &client_id; + args[0].length =3D sizeof(client_id); args[0].fd =3D -1; sc =3D FASTRPC_SCALARS(FASTRPC_RMID_INIT_RELEASE, 1, 0); =20 @@ -1649,11 +1649,11 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user= *fl, char __user *argp) static int fastrpc_init_attach(struct fastrpc_user *fl, int pd) { struct fastrpc_invoke_args args[1]; - int tgid =3D fl->client_id; + int client_id =3D fl->client_id; u32 sc; =20 - args[0].ptr =3D (u64)(uintptr_t) &tgid; - args[0].length =3D sizeof(tgid); + args[0].ptr =3D (u64)(uintptr_t) &client_id; + args[0].length =3D sizeof(client_id); args[0].fd =3D -1; sc =3D FASTRPC_SCALARS(FASTRPC_RMID_INIT_ATTACH, 1, 0); fl->pd =3D pd; @@ -1805,7 +1805,7 @@ static int fastrpc_req_munmap_impl(struct fastrpc_use= r *fl, struct fastrpc_buf * int err; u32 sc; =20 - req_msg.pgid =3D fl->client_id; + req_msg.client_id =3D fl->client_id; req_msg.size =3D buf->size; req_msg.vaddr =3D buf->raddr; =20 @@ -1891,7 +1891,7 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, = char __user *argp) return err; } =20 - req_msg.pgid =3D fl->client_id; + req_msg.client_id =3D fl->client_id; req_msg.flags =3D req.flags; req_msg.vaddr =3D req.vaddrin; req_msg.num =3D sizeof(pages); @@ -1980,7 +1980,7 @@ static int fastrpc_req_mem_unmap_impl(struct fastrpc_= user *fl, struct fastrpc_me return -EINVAL; } =20 - req_msg.pgid =3D fl->client_id; + req_msg.client_id =3D fl->client_id; req_msg.len =3D map->len; req_msg.vaddrin =3D map->raddr; req_msg.fd =3D map->fd; @@ -2033,7 +2033,7 @@ static int fastrpc_req_mem_map(struct fastrpc_user *f= l, char __user *argp) return err; } =20 - req_msg.pgid =3D fl->client_id; + req_msg.client_id =3D fl->client_id; req_msg.fd =3D req.fd; req_msg.offset =3D req.offset; req_msg.vaddrin =3D req.vaddrin; --=20 2.25.1