From nobody Tue Feb 10 03:45:33 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