From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 4ACB03612E7 for ; Mon, 13 Jul 2026 05:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783920168; cv=none; b=kpyrPhsDgRA5gaw//lB4SSzR4Q/BnBqX80XisWdd1Qy8MAjKhK8KBIEUDlYXIJo17ZAHk0ZD3kXhD7Me0bFIf03Yb2iDr8ejDPZ7Oq1Gn6SUuyu/xhiHPXH0qbBrM/Wkf24lthzOcfzW+FlAnxbVLQMuqA20BxpFZ06ofTwFZIM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783920168; c=relaxed/simple; bh=NaqRQKJ7xNt3Dy53XIaBrvccMA4Qf4aTZxSLLGeu80o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qOp3czfDgmc5LZyZeI5kbbK7PNAbC/x302CGcnWDbnS+miSxNO9hbyacruGsy9u5B7FVd9p5XWmMaK9AMHkgfUKMTi0Jtt5bFunhM+lVoGAacUYff9fw9WwVykRYuF452enpsocIhQjVbJ9d+O2pa++tXkthgf+Xdfj2HiAoB2k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FsyCIB7K; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=gDVDFnrU; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FsyCIB7K"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="gDVDFnrU" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66D3A7pW216986 for ; Mon, 13 Jul 2026 05:22:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=TPodwT/8PmT IoV2zpAVITKv1J5JC+XSCVdQXBOcAIqc=; b=FsyCIB7KbwJydq6Ptp1qA7tL5xr rIuxXM+cplWdKwJGGH0HKO+XIIkG3AEeiPF/mn+3VGZc2TnnrGXFG2EPl7138ECH Qk9Gx0sPKhmhBW+4EswZaWK8C31mnFDNVTDNW7l6WkXfiRC+NKuAYJ6fk6TfscRs IrGE6dcttmGvxKI4rL6QxF85xxnXkEb01M1Kh0hnY2/x88c2ApDrImwb6GhO94r7 wOTUvU74rxF/BRouC4M+0nnlu7mLpiUU4/eIhEma/PjwZnIiMPUilp9V1G0v4OGs qMbvGkCKgxh26l5yQDrpx7pp5G1gplaXZakcQkZUxrstoIyLqRsyBYD4mfA== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fbebr4cbp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 13 Jul 2026 05:22:46 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-c88da04b719so2528868a12.2 for ; Sun, 12 Jul 2026 22:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783920166; x=1784524966; 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:content-type; bh=TPodwT/8PmTIoV2zpAVITKv1J5JC+XSCVdQXBOcAIqc=; b=gDVDFnrUPYbcRQ3VPzZdqwub+dVF0tiC6LuKBbQ20uX39ovqpHW1gCBdY28cnrG6Ys qtZFBCwECK+yWVbcCbZ/uNjLRhdx50oueMV9A3aCIwuKLeyVo1qzCq1vmP4ayOBV5kyH QGwfyLmf1c1Mb7VuQ5ZVS5+fwiQEGoyemIbU2TB18/lBI7ZvtoiXQ2K7/EFdvd8SSrlx JP0uIUgWrN4VYDKqNNRvwaEcDkbQI1ZXiA7tes1TBnMQddvD8DkUjLETXzCndDwlIs5u xeaF5IXeqg6XI498RLIeHju/X9ve9rfOW+N2QeQjyNspwPyt3QS1LvHp+kMDZaeZYdJ8 cJbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783920166; x=1784524966; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=TPodwT/8PmTIoV2zpAVITKv1J5JC+XSCVdQXBOcAIqc=; b=VYnIvqKqJSRHupjcHObMV18nkO9PP3xmO1E3OLNmd160rvAb5LBpchIvjq9pdI6JD7 lXDeCAADiwwg5HowkfeoSkYrAE6omER3pPn/+gjj3snfWUs0hT0cg0Ta/GcUMnDWDOYQ OuyvvACh7wU2pETcAmt3k9OweuCdpPqqMvTktKM99RdqBvOLpllpLxUZ+JqbRomHQKqK dX8F5gRlNAXsg5y6o3vLDwTYPdGKhrClE2GFEag5Y4yJyAz4SzVF2NRRwcnuZr+SyPaW GP86WIMVk1UsJMzplXJmayqPmUjEcDvJl+NkzpNIt9ovmfHJez86tfJIMntVssnZ+Y9G zdIQ== X-Forwarded-Encrypted: i=1; AHgh+RqHJm8fjVv+eSKrIW7kneG8rhdJvJY9NoGD81yvcHdBfCEHfRc0XPCSEqoqHTKEPRQjjSf6Uc7ZQgsL6w8=@vger.kernel.org X-Gm-Message-State: AOJu0Yz0w4YoqbXBpRKcym0CSSOkBPGG8Rbunjtq18j5Beq7Y1m0Lm2P jt/k43KB3ycgJ+7m9BBc+RsoSzZ4Toy2egEbacj5AozgAcBPU18cPIrLeLpH63QNuDjssKe14FT Tsl+ZNOmGpzImmHOuWUE8aBI9GI02zvG5rIEOHUZmpMkpA2Fwxe+g/HWpkVQS9hOKgX0= X-Gm-Gg: AfdE7cklda2jS2okoF6/PA2LQrPvDtceroonrA1vHC/FD26B4tz0uc8uq4rLxHiAE82 oaRkFrilhuxAaOM+/rFrC8Q3LS3XjPUumzD0BF5XpulLXnXsGzSwojGt0yDt+VnP2fwJP1Vyr3g WztjXtXJNZO8J34jNbVz0mfiHbVjXPRa1wS9PBz1QaE2FheiZRAoKpz2tTIWOShXUVb8iNM60yk momRKa7xiPb+JF05Pbh3WGIo7QUyYO2aEGESPV1X2A0pWP+9OB8F5diHOBzQWzeUBthE3Q7i4U8 BUEKjbUo9JpleU4XreC8xVQv0LXhcv/W6sj60ZiDPupClpjCDFboV0yGmA4/hPigqIzc0N3hw9h KXVVJdqmqgFWqjyG80RB9l6+2R20X3fZz7vs4YUBZYhU= X-Received: by 2002:a05:6a21:4a98:b0:3c1:657:4c95 with SMTP id adf61e73a8af0-3c11077660fmr7861510637.15.1783920165918; Sun, 12 Jul 2026 22:22:45 -0700 (PDT) X-Received: by 2002:a05:6a21:4a98:b0:3c1:657:4c95 with SMTP id adf61e73a8af0-3c11077660fmr7861490637.15.1783920165393; Sun, 12 Jul 2026 22:22:45 -0700 (PDT) Received: from hu-ekangupt-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-ca75ef0c30dsm6245605a12.17.2026.07.12.22.22.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 22:22:44 -0700 (PDT) From: Ekansh Gupta To: srini@kernel.org, linux-arm-msm@vger.kernel.org Cc: gregkh@linuxfoundation.org, quic_bkumar@quicinc.com, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, dri-devel@lists.freedesktop.org, arnd@arndb.de, dmitry.baryshkov@oss.qualcomm.com Subject: [PATCH v13 1/4] misc: fastrpc: Move fdlist to invoke context structure Date: Mon, 13 Jul 2026 10:52:33 +0530 Message-Id: <20260713052236.3033744-2-ekansh.gupta@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260713052236.3033744-1-ekansh.gupta@oss.qualcomm.com> References: <20260713052236.3033744-1-ekansh.gupta@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEzMDA1MyBTYWx0ZWRfX33SM6t9/yY27 Jtk+MER4aOSQGy9PWiyqnIDWIMlJ8IR/YX2433BRaPT+kKqr6GmYY7GTUFBKA7EZJDdGhqazlfi nQRzZnXY/Kp2M9tDqCc2xSdbviWofS8= X-Authority-Analysis: v=2.4 cv=OK8XGyaB c=1 sm=1 tr=0 ts=6a547626 cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=HL6mAI18knL3XnPGOeUA:9 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-GUID: 4q0kab6QsWjupAdpCjWdUzUaV_WQnj2P X-Proofpoint-ORIG-GUID: 4q0kab6QsWjupAdpCjWdUzUaV_WQnj2P X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEzMDA1MyBTYWx0ZWRfX3K8pg6XA4fzi h/vvRSn/mSbRWP0V7TJK0yAI2MxDA/a91JJ476I+aalaxfu92ahkVuFaMP9m3g9qgLzWRO2RLsI zMAAl3+PEKahimx04+nrVp5Fx2JZ1ELChYgh+CpuUlzSOwNL400YD5m4LSVHjf638xgtWIoL2Qa jNIaYVedB+HIroeGR4/ZiyArRgzxj98rh5Tv/72NL1L7VAg7Xo5AoDJ2VoRPNcEUM2O2hlUYQ2b vzvhaCMMW+EZU/oSi/CdMp0PJI6NdeuKiDh5CN1wHxkkET2VmqYhQKrc3up5C+VfXjkGjAPm6u7 0mxaNGqs3hKb2rjD8zIxD4r17lraPywDU01DESsYFaHq5uVH2WQbZ64sKwsygHGMhGY7IxgJU06 RszzSkbr0pOoFa2pCbt5x1XhV3CBhfQcj4l6E3zbhjDWlg5+4scN/7pFjPX8wwe287GR/i3WpKo BS3hhbXaFKbqMgnjT/Q== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-13_01,2026-07-10_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 clxscore=1015 impostorscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130053 The fdlist is currently part of the meta buffer which is set during fastrpc_get_args(), this fdlist is getting recalculated during fastrpc_put_args(). Move fdlist to the invoke context structure to improve maintainability and reduce redundancy. This centralizes its handling and simplifies meta buffer preparation and reading logic. Reviewed-by: Dmitry Baryshkov Signed-off-by: Ekansh Gupta --- drivers/misc/fastrpc.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index d86e79134c68..02c2765e1188 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -233,6 +233,7 @@ struct fastrpc_invoke_ctx { int pid; int client_id; u32 sc; + u64 *fdlist; u32 *crc; u64 ctxid; u64 msg_sz; @@ -1063,6 +1064,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx) rpra = ctx->buf->virt; list = fastrpc_invoke_buf_start(rpra, ctx->nscalars); pages = fastrpc_phy_page_start(list, ctx->nscalars); + ctx->fdlist = (u64 *)(pages + ctx->nscalars); args = (uintptr_t)ctx->buf->virt + metalen; rlen = pkt_size - metalen; ctx->rpra = rpra; @@ -1165,18 +1167,11 @@ static int fastrpc_put_args(struct fastrpc_invoke_ctx *ctx, union fastrpc_remote_arg *rpra = ctx->rpra; struct fastrpc_user *fl = ctx->fl; struct fastrpc_map *mmap = NULL; - struct fastrpc_invoke_buf *list; - struct fastrpc_phy_page *pages; - u64 *fdlist; - int i, inbufs, outbufs, handles; + u64 *fdlist = ctx->fdlist; + int i, inbufs; int ret = 0; inbufs = REMOTE_SCALARS_INBUFS(ctx->sc); - outbufs = REMOTE_SCALARS_OUTBUFS(ctx->sc); - handles = REMOTE_SCALARS_INHANDLES(ctx->sc) + REMOTE_SCALARS_OUTHANDLES(ctx->sc); - list = fastrpc_invoke_buf_start(rpra, ctx->nscalars); - pages = fastrpc_phy_page_start(list, ctx->nscalars); - fdlist = (uint64_t *)(pages + inbufs + outbufs + handles); for (i = inbufs; i < ctx->nbufs; ++i) { if (!ctx->maps[i]) { -- 2.34.1