From nobody Sun Nov 24 08:49:43 2024 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C004E1CCB50; Thu, 21 Nov 2024 08:47:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732178860; cv=none; b=UzILzKgqYU6G/ABO9pB2yqXnJmZM2h5fEJNX0U7BKht69nvmnpzcLi8MpYpp7uktcNhKCTda0CYh8NVewEUmNsli61pR6RU/C9lP9+AJNpszzrbMxAqHkcoU+DhDLGsKzrqy8tbIsxf6X5Hae2bK0j0SDjpjEW/WcACwuX1Zqz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732178860; c=relaxed/simple; bh=VyUJp9vQ/2LBs2W6+PO/mRg7VDmliVfE8OOG/ZrWTQM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kOvlAcH1GF0OPie8qG8Pf31QKGTd8RLDpefi9GVyRF8YaDppF9MX0OAcTNeHvegs6dQnheidSH96mlDUqkl3cX9CXGQ4QIAP8CWB54S0nnPd64cSKmybhNyjRnIE2uLYGVGYj++w/O9ntzuo0rnUH1RkFS8n50fWiS7HOlWEgdw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Qh1A3DZS; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Qh1A3DZS" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AKJpaCW005741; Thu, 21 Nov 2024 08:47:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 4AvMX6aXFHbqw/g7dZS4/asi8D2KEz0bf+nG6W9+gv0=; b=Qh1A3DZSqw9E9Eap je26cNK0UwuTLJsQ4luvi+EZ++YfdI01xRDWbJ+rtSfKhr5By1aebF25U5S4PSmv LaLAjNErlMKzSEvcpiQUwUQ/Py73dBGb5mmPBV11scpDzSEBmuu/TSGoZXoypQW2 2s8bWdWo2Elb37asAQFSsxwY0vI8lvW0EZw3ibbxqWjvJ1aNeyC5+rD23WXDxyKQ Msmzlq0ZjBbvzkWs7P/dDh5N4Sx5/kelmjTpNohy+CWsMS+ChbNSlzXLh1VQ98U8 v+9C48j3u5YAc3dw3bTSi/64wetIwUyRZ5B8jt7mh9Ohc8h9CS16twLwrzNQACIz mXcQMg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4308y80nrk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Nov 2024 08:47:34 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4AL8lXJD012526 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Nov 2024 08:47:33 GMT Received: from hu-ekangupt-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 21 Nov 2024 00:47:29 -0800 From: Ekansh Gupta To: , CC: , , , , , Subject: [PATCH v4 2/2] misc: fastrpc: Rename tgid and pid to client_id Date: Thu, 21 Nov 2024 14:17:13 +0530 Message-ID: <20241121084713.2599904-3-quic_ekangupt@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241121084713.2599904-1-quic_ekangupt@quicinc.com> References: <20241121084713.2599904-1-quic_ekangupt@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: JIzm28MtTpBheIxjUmQtAJghv7yaW2fZ X-Proofpoint-GUID: JIzm28MtTpBheIxjUmQtAJghv7yaW2fZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 suspectscore=0 adultscore=0 priorityscore=1501 phishscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411210067 Content-Type: text/plain; charset="utf-8" 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 --- 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 08f223c95c33..93826de9c191 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -140,14 +140,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; @@ -157,20 +157,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 */ @@ -235,7 +235,7 @@ struct fastrpc_invoke_ctx { int nbufs; int retval; int pid; - int tgid; + int client_id; u32 sc; u32 *crc; u64 ctxid; @@ -615,7 +615,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); @@ -1116,11 +1116,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; @@ -1245,7 +1245,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; @@ -1294,7 +1294,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; @@ -1364,7 +1364,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; @@ -1396,7 +1396,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.34.1