From nobody Sun Feb 8 13:27:38 2026 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 C64862F618F for ; Tue, 30 Dec 2025 06:28:41 +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=1767076123; cv=none; b=Hlg5ftfEjdgfgUKaW8OhKzmT8mwOgx0y49BvsDWO0F0LUdNtEEfCeRP7Z8QFEU4alCfTtDHoUnIfP5IycI9HrLS1efr9gWzwMsd8k3ubuLQZadu1r/bgZDY4fw6QAvpnMgJzzXIhkn8BMR2v1jUmBeiwgaxdFPOmjsDN0CTU/58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767076123; c=relaxed/simple; bh=OdLtVtiwW1xAkEP1Tuk8yBW78hA3TuPbGrqvdFREa1Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PpnxmDVMQJsAo/VKe2dcYcwUz0btng8Cy1/p9renGSTOcrqD+WFsGmbI4x+lnxbveO/AGK3K0vnvV79aoxo9YT7GN4UVDjchsnMoyf5cNNsRF7RxbHnMrvo8jzAibbwuZgepgFyl1bjfzz/73bLPsZUhJi1uFxgSXhX1TnKT2o0= 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=gQC5liGp; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=EuBkLKVc; 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="gQC5liGp"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="EuBkLKVc" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BU5RRX1898833 for ; Tue, 30 Dec 2025 06:28:41 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=p+hWMKFKc2m VbzgviX4dn/1pRPQOpQtDu/1ysXFdpkk=; b=gQC5liGpXVgNHhF4H0v7VM3rUtQ bdR7c38yZm9uTqQicj1XeDAxMNuW6N7aeO1r6yhOri4Djf0u4uurlkkfJQa4etGq lOQPdXvMUjxt7IuY5B1wnN1JyDhnR9z+wdYd6MdhwGbAkb2AX2cd2KJ2cNomXAPT +lNTBbbG+oGUjxCIZJmFZ4OdvTJZN5rFBO1a3O3Qa/lC+3tlLN7fb17rVer413JY PyKxRekNsr3iCfegm0ICPtdaPW1k1ZbNV6UPw5ZP5zcK4tYaR2j0Cw4zLyuW3j3G r+Tno1K1kOwsSOEkujnf7kib9U8B+fBss2jUXqwKuaL3bmVfNn+X47b0p/Q== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bc8ky047t-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 30 Dec 2025 06:28:40 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-34c387d3eb6so8991194a91.2 for ; Mon, 29 Dec 2025 22:28:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767076120; x=1767680920; 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=p+hWMKFKc2mVbzgviX4dn/1pRPQOpQtDu/1ysXFdpkk=; b=EuBkLKVcsnFnvcyTf8k4CPlcWFddEBRxCAdNqhIhbEQwjNQKhMpqV/Oh37EkCwAPNE TkYd7YYT/E1q/rKg3IS7d+Z4FH8O+2mrL0gX0Odtc/KO3seYGxBlZlqP3c9fMfVRbBPX 2FC2/RfeXYG5kGxk71guCobMP06fUGloeWfenUHRUbyeHNNjnG2Agvm8+ea2KFc0U6p9 GVuhAJ0qen3kQ7JoMIMfal3kWa1xssGjNdcAcK6/zyZU6rzH74F+dktVYZsSV6crIngU MliAYJRrpV4PUm6QfeAmaaNWGEFYbEQa48wBZujiY+M6YEMQTfKI+5t0v8cVtfKtGX5V w88Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767076120; x=1767680920; 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; bh=p+hWMKFKc2mVbzgviX4dn/1pRPQOpQtDu/1ysXFdpkk=; b=OnK/4OykO3rK0twcUCxqnPJyp4X3tTrQ0dUgsOiXdAJFUAbnSz6baxPxsQvKNquM9I KyclmUt02CFayI582GVHf0ckrs1VBXEcmXE16Rvzxszc7eK1I5V36koDYiABfHffvtcZ 29ia3863iXogy4UAWd1gYjhZxeD3Zd+P1A5sHQWwJxHyKCrNydps9JNtG/9tDCLI++Ia hE7xxxMZm62G3irPRaLNx5BAGveliM8AWQAcYrymseErhzC20vUir6j+iLi+aNBNCFcy j2koK6Aq5HhB7dcM/G/un32RVjKZ1M8aLlWFPcAe8l8Cwqczpy4uENBazhFWjNxATW0M R8Aw== X-Forwarded-Encrypted: i=1; AJvYcCWFn1tAdkwelnxkf7lmUGuBBo3aLLZSR38RjE8xl1vee6yd6Sbj8G9JAMjGbik5rN+KE3jqDVlQuwTzRF4=@vger.kernel.org X-Gm-Message-State: AOJu0YxguUHdg3yYfc9N5SyW3+nTND1sd7NOUttPBdS5YQ5EKFzcsx3h tgbYpMo56hbT9t4KU9Qx1ZTA7hukMaGyk1kTBUAk8CnjBEy4YxkmZd3I4GzazZWlTp6mUHCes2N y3a6H23KAdd72QWbf3FkKs18J8urFAOT4rr2mH6rzOCkGFSutk/2qfaGaJWpMmrMCGbI= X-Gm-Gg: AY/fxX4GBQZOU6QoKIkAY4lCJ/kXWXeKpCSueShXtRwbzJ/0cnjJEP4+/e3oMpEKsEA BSBU5ZiNzxj/WR/WSJE1bLp5lLUZZWP7vyapzEvZxYMF13t3aAjjQDUV93sNAFn8l6nKtzCKtx+ p0KwJ0e/ZvZJm8loPFPfvv1kRzSog06M806+YBi7N5jE1Ywozo1Yqqptvpflfm5np3DKVzxlgy/ XTkcP7knQEh1+9NAC4MwZQJwoiTDnkC2DZUp1hPpj5LrLvQcSAh+4pwBLOS8Z6eVC7Ct81GLigN DeyAPqQLqNJxsjd8+mWmaH7fyqOtZOBOLjYb6m71cjPMfSEFATWFO9rl74T77BhoaqNmZGJrWmT CMoNQNeJjT6WhRz3otwatC9FxxvZUC3gIZj8NlFSb5g== X-Received: by 2002:a05:6a20:2451:b0:35e:4f06:4fc6 with SMTP id adf61e73a8af0-376a81daff8mr32915501637.33.1767076120341; Mon, 29 Dec 2025 22:28:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMC8S1tcREodptdIQyyuwN5nUQy8IuK3aPyGljG7nPIvam307pIjnVBo/03fbiCYSgImk6wg== X-Received: by 2002:a05:6a20:2451:b0:35e:4f06:4fc6 with SMTP id adf61e73a8af0-376a81daff8mr32915482637.33.1767076119863; Mon, 29 Dec 2025 22:28:39 -0800 (PST) Received: from hu-ekangupt-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c1e7961b4d0sm26491536a12.5.2025.12.29.22.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Dec 2025 22:28:39 -0800 (PST) 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, konrad.dybcio@oss.qualcomm.com Subject: [PATCH v5 1/4] misc: fastrpc: Move fdlist to invoke context structure Date: Tue, 30 Dec 2025 11:58:28 +0530 Message-Id: <20251230062831.1195116-2-ekansh.gupta@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251230062831.1195116-1-ekansh.gupta@oss.qualcomm.com> References: <20251230062831.1195116-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: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjMwMDA1NyBTYWx0ZWRfX9vp9D6BQEbrZ LZ1Sm9/xhxUJuImdWee2aRqLhGw9+h42QPi28WpWTOESHDZHBe0nDS5I3KDHSVF9i0DNfSseFvh W2XXUEdkdKoEcPHJQXWT6H4MSiXB4LlR0ubx84WLoSSO/Lsd+mIgjQBSFzTKkCmWXwM0tdrHSZ3 VRA4HA55kCIIJHzAtBLWQQ00pcQXwZ7Ve5BP1gRNVMIIPTRoI/z6t6qujh+Lk06pxRK1MKJpyo4 8cGHyUuTk0TGtf5RSwH1CfeRC+b7T2LrvrsqdQio0QEW2gF3E74Aar/XtQdytR5yZX1thZsT5aK HXFjFp7hKIiy06qLjB5SPXRH9NtCU8Fujj1BvjfjCAK62ZwVpxXzQYZ0twvCwZh2s145KowDXws 0yh+Xy32pkCfqhyg6OAPWl2sLo3sJep8Oi6gMVAHMFiPYrtXgTGSPM/5bUVzklozxGTkJbc0NwY ujZz9JAOPO6WPam4IVQ== X-Proofpoint-ORIG-GUID: AKR4-JUWiYKf5H2VlX_UFYXbLskyI6-0 X-Authority-Analysis: v=2.4 cv=BuuQAIX5 c=1 sm=1 tr=0 ts=69537118 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=hRzSbfjIAxXVlyYcgJ4A:9 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-GUID: AKR4-JUWiYKf5H2VlX_UFYXbLskyI6-0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-29_07,2025-12-29_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 spamscore=0 adultscore=0 bulkscore=0 suspectscore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512300057 Content-Type: text/plain; charset="utf-8" The fdlist is currently part of the meta buffer, computed during put_args. This leads to code duplication when preparing and reading critical meta buffer contents used by the FastRPC driver. 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. Signed-off-by: Ekansh Gupta --- drivers/misc/fastrpc.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index ee652ef01534..679cd8997a00 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; @@ -987,6 +988,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_= invoke_ctx *ctx) rpra =3D ctx->buf->virt; list =3D fastrpc_invoke_buf_start(rpra, ctx->nscalars); pages =3D fastrpc_phy_page_start(list, ctx->nscalars); + ctx->fdlist =3D (u64 *)(pages + ctx->nscalars); args =3D (uintptr_t)ctx->buf->virt + metalen; rlen =3D pkt_size - metalen; ctx->rpra =3D rpra; @@ -1089,18 +1091,10 @@ static int fastrpc_put_args(struct fastrpc_invoke_c= tx *ctx, union fastrpc_remote_arg *rpra =3D ctx->rpra; struct fastrpc_user *fl =3D ctx->fl; struct fastrpc_map *mmap =3D NULL; - struct fastrpc_invoke_buf *list; - struct fastrpc_phy_page *pages; - u64 *fdlist; - int i, inbufs, outbufs, handles; + int i, inbufs; int ret =3D 0; =20 inbufs =3D REMOTE_SCALARS_INBUFS(ctx->sc); - outbufs =3D REMOTE_SCALARS_OUTBUFS(ctx->sc); - handles =3D REMOTE_SCALARS_INHANDLES(ctx->sc) + REMOTE_SCALARS_OUTHANDLES= (ctx->sc); - list =3D fastrpc_invoke_buf_start(rpra, ctx->nscalars); - pages =3D fastrpc_phy_page_start(list, ctx->nscalars); - fdlist =3D (uint64_t *)(pages + inbufs + outbufs + handles); =20 for (i =3D inbufs; i < ctx->nbufs; ++i) { if (!ctx->maps[i]) { @@ -1122,9 +1116,9 @@ static int fastrpc_put_args(struct fastrpc_invoke_ctx= *ctx, cleanup_fdlist: /* Clean up fdlist which is updated by DSP */ for (i =3D 0; i < FASTRPC_MAX_FDLIST; i++) { - if (!fdlist[i]) + if (!ctx->fdlist[i]) break; - if (!fastrpc_map_lookup(fl, (int)fdlist[i], &mmap)) + if (!fastrpc_map_lookup(fl, (int)ctx->fdlist[i], &mmap)) fastrpc_map_put(mmap); } =20 --=20 2.34.1 From nobody Sun Feb 8 13:27:38 2026 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 F15D82F25F0 for ; Tue, 30 Dec 2025 06:28:45 +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=1767076127; cv=none; b=b8BtZKRM62ihHcAfiS13p9oryYVuonNJzmAUhAPXDCKEfqXoyjHBNmRPB2a+OTgCSYXOt2sVZU1cMhKzyI3VHi++8ovVZC58rCa63wHC4kjsblR7Q0qNaBOLYpqCw3Ugb1ynf6kJDhH2IITGTt5PSsErxPxpIfhJNGpjj2Y4zRQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767076127; c=relaxed/simple; bh=MHn+V6TRZoHpB/IKHPrGSV0ycKamLtaH9inFw5f2g5Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lIr7PHmCv6Z1o9dClFmxDR0tJ0+X4mzWaQnfspJpo7SsumBgF8ZHivlfted7elEiE65mYgA7ZyBpq8RCLnfTdDnlpuyKVIr67icR1TdU433CF7wDjdxAP50/w70Xu96iwwElM7wrimFPJaa3EPZHi46DVPi/IkhXFUe15jg3do8= 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=o10Q6H+t; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=W/xDKhuE; arc=none smtp.client-ip=205.220.180.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="o10Q6H+t"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="W/xDKhuE" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BU0kdsh2674102 for ; Tue, 30 Dec 2025 06:28:44 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=44twYS2j8pu ef9SPj0m2ACmUVD52vfoicRaqJwTY5UY=; b=o10Q6H+tj4bFnL3VN+7vryazyuG DuLLblP/BNHZaUg5h4ItaM8YksQLg+POH5mcaFtbahNvfW7dsEJJZkC+3X+ihsDH UDBHjJelunByqbUJY6rfnL9kdhcEnkOHFBeZJLTMf3rSfsL4NdoTIB4HYGcaZKy+ fL6LsFBxk++S9rf4b73kMAmlrbgsQIzBuZKqORU2dYWKGHctsQ+yYKcDevA6phfK XLCWwRj9/niTRTXq/LkK7okPUF+1bV+vYT6z9h5NBKDqjv9UWppC8hVT7AIhEhdW AtE/9miuioWRjLRZkGjPrXeuIOet1FO16iisfi8es5qXenByC9ozLlu/gRw== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bc4fcrmbd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 30 Dec 2025 06:28:44 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-b5edecdf94eso16459782a12.2 for ; Mon, 29 Dec 2025 22:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767076124; x=1767680924; 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=44twYS2j8puef9SPj0m2ACmUVD52vfoicRaqJwTY5UY=; b=W/xDKhuEGPxVB8UCva6dz51BtdK7O8sp7nEwJPLBNweauJXWPJnOI9e2fx+JKfj7GH qQkOJwaU2GHQO3m0XoGtYe/Nakv8JHayyP8EyWiaLFJTRJsGMVo1ZV0pJNV9UYoHYN5A 97CBxImQPKZeHAGc53DXoFOpThv9NjcadqcHAYjb+FG4CqLWM0PnCin934X23kKDET8P 5AoiIpKpwCY3URaWs301xtYKyiXJXHyg6VFCcMl7f3hGjOoxL5PlogiONsrEbqIfszoj wA5qeLmDDOjdgekYlwyNWd4xJaAn/vVsxyMb8sGIFL8h2WdXPkQfm73aSv0jZLe/TVMz snOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767076124; x=1767680924; 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; bh=44twYS2j8puef9SPj0m2ACmUVD52vfoicRaqJwTY5UY=; b=qqQasi9CnvII9GCqBpNBHwdyncGru0x3fVTq0hKV5ZQZZemnCzxmfY8RLkN6fYmmAI Q589rRZiqIoXWDuLywP693OXgddIavIRq9eCGHzbuyPwn8s0vZJec0i/cR6ztOGzyGSA HaZvz3h7WOG2rS1jb0Mtacus/umN9SUaFSNb4EHimKMP1s4RwUQfnQr69Vpwu8th1Mgz Zt5YmYUlqUyfuPoSIsTQuVwLV/yRuPRehtt1lCAcyhTSjiv4qd9M70CvuFJQVPPPw744 cUryizApyTZFBmq7xZuf7xeJw2LC7zxR03FDdwofi4lU24i2LHwmTUFRs1A06pZcCGLb d/HQ== X-Forwarded-Encrypted: i=1; AJvYcCWisachKieLnV/XnHb2FRrmhGrLQPrq9R7BtU1ga8ggSRbFGFCY9nizAAfvhFfbYJx6+SoF246melZ3PRA=@vger.kernel.org X-Gm-Message-State: AOJu0YzXS4Nbxg5LOpltEL0ndJglN3i9XvbnmmN+PknE9Cgs0jh7C/ED /W2kFDXg7h0qdLfztidPheqJvrXxQ+Zu4wRRQHmmyae2/vJXpHC+ttlSK13jPutpGiRQgITifEz oqHY66NzDg7PKcXaCDm8bLmmF6iQW70q4KwT4VPQgBxUbBj8LQOAQ7KaAw55KnU0cLd4= X-Gm-Gg: AY/fxX55iOToEOgq4fWj6zCZsNRZXxV8Te8WrZwCrRBzpsLc/brO0giOU7b6GJEvy0w ck1iRADTI1jHFvf0d15txTD0KEbSy1UnofwWvIPdAU947aQSE2WY3ebA4u2zVydnvY1T6zF7biR lL/kCOsuBl8tyfnV6onaZSNo/fggbV1NPEawXco5jRNXrDpr0shc2UqgJibMKNex8vUeYwZzmfv 049915rjafADsoRy5RvvuvAfOMXVzYdQtZPykwhFjYRJMhFVosIkO2sUk2Ceu4tdCuVXopX8qYd 4nwc0eTis12qO9h4dupLnm/mbnR3tEADLqlGCRYRMO8I18mJfTtCZfVRQ5l9H/3DC1lZL6N9l4E LeNXKNz+a8hnsQsmlgl5ORww1q/CjO50hQTMAULO8ug== X-Received: by 2002:a05:6a20:4325:b0:34f:afaa:125b with SMTP id adf61e73a8af0-376a94cb491mr31113752637.50.1767076123571; Mon, 29 Dec 2025 22:28:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGa7a36ash2kDsGeHNgvuyMuFBc2a3MlePVxdjQtL2BMh0tEoB3pf2il6edj9DeU0uuo4hGVg== X-Received: by 2002:a05:6a20:4325:b0:34f:afaa:125b with SMTP id adf61e73a8af0-376a94cb491mr31113731637.50.1767076123080; Mon, 29 Dec 2025 22:28:43 -0800 (PST) Received: from hu-ekangupt-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c1e7961b4d0sm26491536a12.5.2025.12.29.22.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Dec 2025 22:28:42 -0800 (PST) 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, konrad.dybcio@oss.qualcomm.com Subject: [PATCH v5 2/4] misc: fastrpc: Replace hardcoded ctxid mask with GENMASK Date: Tue, 30 Dec 2025 11:58:29 +0530 Message-Id: <20251230062831.1195116-3-ekansh.gupta@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251230062831.1195116-1-ekansh.gupta@oss.qualcomm.com> References: <20251230062831.1195116-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: quoted-printable X-Proofpoint-GUID: fY6RXO0IAfz8fxeZETUv3oHoyKbZIhVC X-Proofpoint-ORIG-GUID: fY6RXO0IAfz8fxeZETUv3oHoyKbZIhVC X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjMwMDA1NyBTYWx0ZWRfX8E3+SBsmdYD6 zMolpVNVCRaTpRGmeL3oOMygWq6rXsLfUlN7dEN5D/RXG3K3t8zdjQOmg2eofaryMMic43m4fTO C3zCd49HMMmryXtm1jKca/2ZffrkutpV24RdQDJMKEc1fFrswreDu+R0XTXqr9sTvV/2ZAnlsKH pERn78lYiqxMW6ZlzO9JpHp4lYt/DV9B7DqxM10iRbFwJHVKZC8VvdBbHbP8kVM9gyf04o2aOvn y5uV1rCJ1yGjcPA4WJLtWPTG3+TSDhLlDMqPuuz3rK9iWIcixO1PqVY+irDD4bPllmrwRjEn2Ve JSsh/6nPsfq559rt5XK29buDJFSq2tbh/CU1cdNd+UfzFJm0cGlCDFAb9ruFHexXPyI37UZKSAH 9ubSytyDFUe9N+owhy+jooYoDNntbHO2tvViarz8VAZG8BU1J4iwWySrznC+ILcvKDP2hbSEYQR 39sTfW1y++MHdv5lGPQ== X-Authority-Analysis: v=2.4 cv=foHRpV4f c=1 sm=1 tr=0 ts=6953711c cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=mhgHPu3uRlbtNExDwEMA:9 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-29_07,2025-12-29_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 priorityscore=1501 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512300057 Content-Type: text/plain; charset="utf-8" Replace the hardcoded context ID mask (0xFF0) with GENMASK(11, 4) to improve readability and follow kernel bitfield conventions. Use FIELD_PREP and FIELD_GET instead of manual shifts for setting and extracting ctxid values. Signed-off-by: Ekansh Gupta Reviewed-by: Konrad Dybcio --- drivers/misc/fastrpc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 679cd8997a00..f7fb44a8e9c0 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -22,6 +22,7 @@ #include #include #include +#include =20 #define ADSP_DOMAIN_ID (0) #define MDSP_DOMAIN_ID (1) @@ -37,7 +38,7 @@ #define FASTRPC_CTX_MAX (256) #define FASTRPC_INIT_HANDLE 1 #define FASTRPC_DSP_UTILITIES_HANDLE 2 -#define FASTRPC_CTXID_MASK (0xFF0) +#define FASTRPC_CTXID_MASK GENMASK(11, 4) #define INIT_FILELEN_MAX (2 * 1024 * 1024) #define INIT_FILE_NAMELEN_MAX (128) #define FASTRPC_DEVICE_NAME "fastrpc" @@ -489,7 +490,7 @@ static void fastrpc_context_free(struct kref *ref) fastrpc_buf_free(ctx->buf); =20 spin_lock_irqsave(&cctx->lock, flags); - idr_remove(&cctx->ctx_idr, ctx->ctxid >> 4); + idr_remove(&cctx->ctx_idr, FIELD_GET(FASTRPC_CTXID_MASK, ctx->ctxid)); spin_unlock_irqrestore(&cctx->lock, flags); =20 kfree(ctx->maps); @@ -625,7 +626,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc( spin_unlock_irqrestore(&cctx->lock, flags); goto err_idr; } - ctx->ctxid =3D ret << 4; + ctx->ctxid =3D FIELD_PREP(FASTRPC_CTXID_MASK, ret); spin_unlock_irqrestore(&cctx->lock, flags); =20 kref_init(&ctx->refcount); @@ -2451,7 +2452,7 @@ static int fastrpc_rpmsg_callback(struct rpmsg_device= *rpdev, void *data, if (len < sizeof(*rsp)) return -EINVAL; =20 - ctxid =3D ((rsp->ctx & FASTRPC_CTXID_MASK) >> 4); + ctxid =3D FIELD_GET(FASTRPC_CTXID_MASK, rsp->ctx); =20 spin_lock_irqsave(&cctx->lock, flags); ctx =3D idr_find(&cctx->ctx_idr, ctxid); --=20 2.34.1 From nobody Sun Feb 8 13:27:38 2026 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 183E12F25F1 for ; Tue, 30 Dec 2025 06:28:48 +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=1767076129; cv=none; b=oEoSmVLVRpM8EakUPYrOwvW31fUfwVFS9c4dkLBh+0scqp5YDOOjD9tsl3X8kuxFD5LlcQADF7vu0eSqtnBhTVouZHsEERDyl3/bQdrDLpuryNjYNOCwV4+tYiuHytt5P3xIB9Zzrky+gUY9h83cOcHn7QuV/g5Yrox5isQAuD8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767076129; c=relaxed/simple; bh=F/9sfTN7nfDZ5Dx3C25HfKYIewR5jxcQ5l9BIf35o/4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UVEPEriXPQ7ltMeV9JWHA2XTA3LytG7j07QrQQDI9Xir3I8x1+7kZ+KfodkOOgPDX8ygJl4jiBhFiRkWfY3fx66eGLzPkHJLOlHGD29m9WOREVU7fAXAd9Xux54rHfx2VVzYUOn/f6oLETnQQk3DsfAFmKAh7eb5dgv2AcZnVZQ= 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=aQGxbrp6; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aiZIGUBk; 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="aQGxbrp6"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aiZIGUBk" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BU1SPWp3528353 for ; Tue, 30 Dec 2025 06:28:47 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=6T5aBckh0Dl dCBnlx57e6ydV3fyOJ05veUQnGzWVFO0=; b=aQGxbrp65iZCXljc1vAhXHjTo2o gEcN+fgWSQZNiUk7xonF5nAzcBBR8oXO9iVxoptjwPvv5qzNlE5oUSJEqpRBHk3U 5YY57RULM0ZmV8hSUxj3UaB/wLPsA6Ak8tY6IzP7eAl1BcoAhnGhJHq7D/w2xwWo OIPOQlTNVSoqL17MZGasU5fMt7767O9pDwQ0IMZ+nri4RJH1RfFBcCbM2Ktt/Lz+ D8K5XFhcP21iEu2Y0DZB/K1z3iIlfRWMeIFXy9+1sn60WRmNhXhLo/uop88vKLQo no2Rdo80ybORFYuvQikmQGsAuldt1oCGqH1x05NesSzSriiBhJ9ja0YTPDA== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bbc8yumqt-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 30 Dec 2025 06:28:47 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-34aa6655510so12049432a91.1 for ; Mon, 29 Dec 2025 22:28:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767076127; x=1767680927; 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=6T5aBckh0DldCBnlx57e6ydV3fyOJ05veUQnGzWVFO0=; b=aiZIGUBk8bWYdcHF1bxz1Sek6EZvDHYjoG50UX8CqPA4BtrRpSjMuApht63TamAL2d HJGUCrGkaJujp3uYJurgRkzTtXLHMWC6rm9rqAlAsAfbRcKdZe1b/H8iemvfB17w04yw /+E0vnZCMIwuBmqP3x/SRvIvEWMLFd/QyFLE0u84pDtOw8HdKD4Ly17vYeZaeCiyL9Wj qyrtvu1jjPFasF0g5+k6ogBVz5HMDO2OS/D5+hJaE2lUJd2B6MbwLz0UaiBNWofnMnC8 X3ZbS8CTjkmVzHYIhelj18cA0/u0dwowgkpO3PGEynD4disyhihTG9W5ATJdQQ0TXgaz QGIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767076127; x=1767680927; 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; bh=6T5aBckh0DldCBnlx57e6ydV3fyOJ05veUQnGzWVFO0=; b=UzuWMCXFE4a8Kh16NpvsQxogNoor6UIhe2fth70fMv9D1RRhUTc1nlG5sIKaozd4yK /JBuohqnMpDyUVl8C+3N6m3YGjO76SSHenMipG1xWkvmbZv7qWnItPiSTL2eWZKoDpit kJ5b3Ji4IQlN8JZgtxrjgDbmdRpPAWQ7B2B2ZCZBpa+iS9xH0uLmZlQnD1VtkDg6quKV AXf+w8KYn0m5wheCrKayYX32z4bCO83w96vMyoXUPNIkWkY9eKRb4VirnQd0qjP0P1+D 9iTCadrIf5MhN1MWbJTpPEwbVJf3fUyUdFEpBhGKQC1WqgRN+nYreA264FkMerFoVd5s s7NA== X-Forwarded-Encrypted: i=1; AJvYcCUfItDp/AyqndWs4pX60SCwoPbbnqVRV5XiOvjI1sGynQo2ttq4Z7UOgTeiJONjuk06xByfW5rXOIFFM9E=@vger.kernel.org X-Gm-Message-State: AOJu0YzHAKokpH7xSJ/fdMEAL64Ap4v30pOUlgMPclop89sSzB9lUPKX UeLNqO+tsgkXIjKzVcjQ9WM/BZ8gyfQlPPO4nNSEfFmYKyVnY3u2e5yQIPCkXBDCdRumlMahK75 SpPA0U30LRNSQUIvFAClQTuqCqHoUgN2tMm8LZHHrue67Gh+sXeYrwMrqRl4MY+V+Vf0= X-Gm-Gg: AY/fxX6hHRVZrdvTzBnhTopYHnSnIIC+CFZKslwdaOGQ/HMBv091tQBoXc9r4abBG08 27cI9N1Ypt+NvMc3Cf48U1rS4PaxIJ/5EHAgEofdDqC9/YGsB6ZE09e+fWoOC6j95SsDmy9D7T4 LCi7qXPlhfHd4qHW/VTYy/uFxosnGHD9h3xqANnjQnnotSJusXaKoSJA7aOsufkmcp1lC1Ld8yt v5OYggi8Y02g6Ozxnz45/STmKSiidV7WFS+cg/T6bCbkRf08kIF2kiMGNRYERmBMlxdsFKBYWLO yiSDF49JMw3zJgl/hAhnitUVGVQQz8wa77yOe8/fnj/5b1aHw2zaICmXVqhdeSJH4AIhTQr/oWi 2D6fiHCurgJ+noww262cpSON7yyPK0AbgvHXVeuqFgQ== X-Received: by 2002:a17:90b:1e53:b0:321:9366:5865 with SMTP id 98e67ed59e1d1-34e921e9ca9mr26762809a91.33.1767076126765; Mon, 29 Dec 2025 22:28:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRMe+2U/aiLSBzMsqrv/IRia8jR6gfLlAnG9kGH+caVyUtzCdyEPfhIhk0zzI4GLOuzMmuXA== X-Received: by 2002:a17:90b:1e53:b0:321:9366:5865 with SMTP id 98e67ed59e1d1-34e921e9ca9mr26762793a91.33.1767076126283; Mon, 29 Dec 2025 22:28:46 -0800 (PST) Received: from hu-ekangupt-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c1e7961b4d0sm26491536a12.5.2025.12.29.22.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Dec 2025 22:28:46 -0800 (PST) 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, konrad.dybcio@oss.qualcomm.com Subject: [PATCH v5 3/4] misc: fastrpc: Expand context ID mask for DSP polling mode support Date: Tue, 30 Dec 2025 11:58:30 +0530 Message-Id: <20251230062831.1195116-4-ekansh.gupta@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251230062831.1195116-1-ekansh.gupta@oss.qualcomm.com> References: <20251230062831.1195116-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: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjMwMDA1NyBTYWx0ZWRfX1ox6pxess9qr RXYsa5fb434Qaw2FGEue6gpZMeIVHF8AkshTo3d+9tf/52nYehHhBm5jauikilpxfOE9+sZ1aGg irYOC2Jtfvkm8jrQqLjhvco44EHKLDck0t+j4dJwRBTxXP5I0DrlAvJyU9VKLOW3WnkZbaUEjNL 02/XHNT/EAMJjcWRVMFRCMb0WcE7xUqDgBlWOpMlUbaDdFJGq72ZrJYBBXbVrYHWUMXjiQRMksy 4UtDwspNU8BnPqM55a6BZOge5hHQsurstT3TnjtBo7ZM2ZQyTRWtsUmWD6nPeEYiDfdlq1be+PY Y6BHHaoKFeiHZeOZY0zrhK/3wwcmB60rFoA2E0csVR9gyojO4FZixwuV9iUAJTBfvNS2IqdJirV U5TAm2Hj47SpUZv5uhnkSd0To2OzLPN6kLkpo2+OBwOLk6N3yVGK5Ki6QAqeWJxX4QT1lzQ32eY RZQPtbUjKJ/gBav8/cw== X-Authority-Analysis: v=2.4 cv=cP7tc1eN c=1 sm=1 tr=0 ts=6953711f cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=ou9iVbgrfxuWbo8UQ_4A:9 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-ORIG-GUID: 5jvUOcWzIqzn0AsBEzpYU5BhmuTYJGwo X-Proofpoint-GUID: 5jvUOcWzIqzn0AsBEzpYU5BhmuTYJGwo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-29_07,2025-12-29_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 malwarescore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 suspectscore=0 spamscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512300057 Content-Type: text/plain; charset="utf-8" Current FastRPC context uses a 12-bit mask: [ID(8 bits)][PD type(4 bits)] =3D GENMASK(11, 4) This works for normal calls but fails for DSP polling mode. Polling mode expects a 16-bit layout: [15:8] =3D context ID (8 bits) [7:5] =3D reserved [4] =3D async mode bit [3:0] =3D PD type (4 bits) If async bit (bit 4) is set, DSP disables polling. With current mask, odd IDs can set this bit, causing DSP to skip poll updates. Update FASTRPC_CTXID_MASK to GENMASK(15, 8) so IDs occupy upper byte and lower byte is left for DSP flags and PD type. Reserved bits remain unused. This change is compatible with polling mode and does not break non-polling behavior. Bit layout: [15:8] =3D CCCCCCCC (context ID) [7:5] =3D xxx (reserved) [4] =3D A (async mode) [3:0] =3D PPPP (PD type) Signed-off-by: Ekansh Gupta Reviewed-by: Dmitry Baryshkov --- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index f7fb44a8e9c0..222ff15e04bd 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -38,7 +38,7 @@ #define FASTRPC_CTX_MAX (256) #define FASTRPC_INIT_HANDLE 1 #define FASTRPC_DSP_UTILITIES_HANDLE 2 -#define FASTRPC_CTXID_MASK GENMASK(11, 4) +#define FASTRPC_CTXID_MASK GENMASK(15, 8) #define INIT_FILELEN_MAX (2 * 1024 * 1024) #define INIT_FILE_NAMELEN_MAX (128) #define FASTRPC_DEVICE_NAME "fastrpc" --=20 2.34.1 From nobody Sun Feb 8 13:27:38 2026 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 92DD02EB876 for ; Tue, 30 Dec 2025 06:28:51 +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=1767076133; cv=none; b=mVEKuLWOc+jkoR84TARxulrGi74JXXeiBGFJVC5C7si8hgVJcmLaUNemazG49zcLsyYRfaopNkJ+P9TcJCF4X4lURRcAyKj/cHofVyByaZD04XmNKWbLjWOSrYNvtoVEg+k0gSlNeZ+RfYwThAzjsA7Z7jgVsaoyNKatqt6LlWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767076133; c=relaxed/simple; bh=DsrVqkzoOh91LhP+OVCHGfehP1lnEGNGugMDlR9RqUk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KeA4YJ9DCo+z+mz0Vd7HZL9tGG6yQanj8OQKkLfUvJF/sDT++K2BfkSwOppDNg27CAyBlfMxoobxwP7qyBkh7nlpfeJc5BEsisdxaFpu7ZZuf9BfItT3Fv/n4YmXVm/MTC90VTVuA2z9C94F2+wPIDq4C+IiLICHkRYsNUXGAqE= 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=YpK0g9Mi; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YB5JsUgi; 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="YpK0g9Mi"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YB5JsUgi" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BTJqjpm2284829 for ; Tue, 30 Dec 2025 06:28:51 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=F84JmaDZwv5 YExecCbKuY9iZ3gotWGmX8OZPfkyrBJI=; b=YpK0g9Mi0onHuZNwtMSwE47KpSq UVnWyyVTHk3rtybu+voF815jgG3m5VmTjex/LbHojctwqoeDtSjvijn5AOplRX9P 8rekp2d5+dWsuvU4xccWo3SxHGGykCRSRkv5jBsh/4VB7+O0l+BzzpX1vKOS0jqN Ls5G1ns0INMFUYCO19lyM+UcgrXhTxekmpuCoIAwgN5wO8C6LRYO/qH7BYs1yucE fBr3i2v9pUGCOIv3pHNByJG2yzvZopRp7rqVmEzKiLnIhXfgzgT87ZtzrKqTeTq0 HgFz8mektw31uVvBBM1dsGf1lldyRlXWwzgdZJ602uqrx+PwpNswUnC7K8w== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bc06gs2wu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 30 Dec 2025 06:28:50 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-34c2f670a06so12535153a91.3 for ; Mon, 29 Dec 2025 22:28:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767076130; x=1767680930; 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=F84JmaDZwv5YExecCbKuY9iZ3gotWGmX8OZPfkyrBJI=; b=YB5JsUgi21XcCWjxknbDkqsplqs4WrxI/bsdwqfoImiYC92mjL9PfY5s6besRoBdg6 VqoFLoL8oGiKjGDDcLVn4jI3Sp6fdWoBk2CzbY2ud/DtUfjqzKLM149YfbP6DC0lUu6I OSSbhGPKgYvUyKiALVK8Mj77AMv+yCcG+L6qABUK5+Y7cvMMfOvOE9WNjemcBI9EGpqe oc7X6Ouo5u+Ko1clQjEcGO8WV/96sJQHCcF/Bsmdu8tunAvW9QOS6FWdP+o2shagcxpE +b3csazlaj2ICUdZvapPSU7ZpSmyMQVXKMNTegxzVA320t1F8ooglL4yVH9LD0DNUiyD ZNfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767076130; x=1767680930; 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; bh=F84JmaDZwv5YExecCbKuY9iZ3gotWGmX8OZPfkyrBJI=; b=pc6ZZBLioII+sOgkrXnNiuVLKTiCyMVbR7E4VPT4Ovm2SvVhMUIEsO8BPNo36PL5Rl tB7bcOSMGIKQ/1a/MdJ2SbIIMCUHgtaqqK6Ic8dAFb3553WAfTLIDRyYe7LJ6gzAPj6f PbJQO2KJC9+QT/wRU4Sei1OPsoxMrRPpiW5uzrlDsbHCLTcxJ7gYvjWJ7iluCQw9rahU WyuDWuYrzxdmCFUJNrvIkpN69jgZRzxxsrcrauX31EGgnhqH3qqv3hm2wQ3dTjZU7Jb4 MepaiFpcLvTtApbk1BEgFHpht7h04kfxevQP2gVy1Ah3+wosA21ux8I3aqkI1GMW/wjH 8IWA== X-Forwarded-Encrypted: i=1; AJvYcCXwB+BwDgEuKhYMJu3TgH904we/Un2+kXMORl50cLYXBC/Dj2o12+wDYmHTPKhB4GU7h6xav+BBXzYh4As=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+Zgc9tSiocTE7EtOpSDtCWuXhmt3QdFF0ffP3f7Ipdt2juTRN j9wZ4dEW3ax06Unjmjzk43ZBFvOex6+feNXkdDCO5oSsEHjjx8sp1Aiz5lWud/b7HlPIO06rsis CgNnVjxOfkdTr1+orOYatjy6xBA9eXZx0TUMR0FtXD2mPsfrAMoYXZ6gDdAbNUabz3jM= X-Gm-Gg: AY/fxX6vaq+aFAyw4lzzhzitH9KW9uwT2Uyn3sA1nXy/Y3HsE5YgUU9QbTIXvQgzrpZ aAyFGUpj+z4iKpFOZtt5tAvWHd6H9XnvhNVpEsc0Iml1IdZPJ6lyTLyjgpiebQHmzWKAX5jjzIp hRdCmcm4O5HhyYHglMAGH1SYcJ007fcBUxg+jIIuGG5m4kwOl/Cs1k4x+/wvdvfjgsY4e0i3TqX B75QcRDZpnpF7cBhGN3QaSIMS+N/KVRV3YFQHA0W1SVkSPmCC3sSP8kaET9kCj6LSzEcNqZz36s ZjbflP5H8vPRp8w+lRlfiRueIDEtbSw75wIZShhXY6YButrpofFhAe77FjRkYEPBUlT4SaWGzAG OXGQYV1EE+DAX06OGYuuTGdPs9QA/WWQG+Fo8uelT1A== X-Received: by 2002:a17:90b:5804:b0:340:2f48:b51a with SMTP id 98e67ed59e1d1-34e9212a47fmr28583227a91.15.1767076130028; Mon, 29 Dec 2025 22:28:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxN0SX4cLAXGqd3srmGONGCl3+tBbwB9OFbYSPKDNg38CUgZeOEQmctAmg3LWdfmj+UDwoRA== X-Received: by 2002:a17:90b:5804:b0:340:2f48:b51a with SMTP id 98e67ed59e1d1-34e9212a47fmr28583215a91.15.1767076129538; Mon, 29 Dec 2025 22:28:49 -0800 (PST) Received: from hu-ekangupt-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c1e7961b4d0sm26491536a12.5.2025.12.29.22.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Dec 2025 22:28:49 -0800 (PST) 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, konrad.dybcio@oss.qualcomm.com Subject: [PATCH v5 4/4] misc: fastrpc: Add polling mode support for fastRPC driver Date: Tue, 30 Dec 2025 11:58:31 +0530 Message-Id: <20251230062831.1195116-5-ekansh.gupta@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251230062831.1195116-1-ekansh.gupta@oss.qualcomm.com> References: <20251230062831.1195116-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: quoted-printable X-Proofpoint-ORIG-GUID: vDPY-RX1kTZywBSuzG0ISyylExdz8qNu X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjMwMDA1NyBTYWx0ZWRfX86l/0JO8753c 78rYl+ZMjjaTuEicsbXpVciZGPQTCMDhV46zKV5/gC4RdGoaq3cbN1bG7oYLzpIpUh+I3Mqj/Pz MSSUHMYjiI0gMrm+KhpJG9eEVOk4ytzPXej64Bqd5jRvich9VgLSC6qsN9Gh9Tgyt6WtApUo+Qy bmC0UUq5ATel4Xx/3JjU6inAAKBSPIetd3WOAe2IWMbE9iY+Y5k0uId4Ahrm8L3Ut5W2EJvswsU T9M/ef6bHh0kfTw3Mjb5BgAzJxkndOWKXgLliacofg0sXhP53ZtW7kHYnlrgCbPMXoJNuPX+MhH CRLneENrLfPYwO+KWT+3bTThY1+ieDgVgXITXTWFYoSkKJgzHLPMV+IB9bQK2etyesAxVyiShLV Zce/qxm5vFtJU4rxwjS6FhdtBm+wzmqonom+DuiPukh8oANDk3Nufhvcac5NwEC4GULvxdIS767 5K0gMfCX18LvPPsCy7Q== X-Authority-Analysis: v=2.4 cv=A45h/qWG c=1 sm=1 tr=0 ts=69537122 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=TEHdEMHTk_fMHrPBF0kA:9 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-GUID: vDPY-RX1kTZywBSuzG0ISyylExdz8qNu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-29_07,2025-12-29_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 bulkscore=0 phishscore=0 impostorscore=0 spamscore=0 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512300057 Content-Type: text/plain; charset="utf-8" For any remote call to DSP, after sending an invocation message, fastRPC driver waits for glink response and during this time the CPU can go into low power modes. This adds latency to overall fastrpc call as CPU wakeup and scheduling latencies are included. Add polling mode support with which fastRPC driver will poll continuously on a memory after sending a message to remote subsystem which will eliminate CPU wakeup and scheduling latencies and reduce fastRPC overhead. Poll mode can be enabled by user by using FASTRPC_IOCTL_SET_OPTION ioctl request with FASTRPC_POLL_MODE request id. Signed-off-by: Ekansh Gupta --- drivers/misc/fastrpc.c | 139 ++++++++++++++++++++++++++++++++++-- include/uapi/misc/fastrpc.h | 9 +++ 2 files changed, 141 insertions(+), 7 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 222ff15e04bd..d95d31d27b82 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include =20 #define ADSP_DOMAIN_ID (0) @@ -38,6 +40,7 @@ #define FASTRPC_CTX_MAX (256) #define FASTRPC_INIT_HANDLE 1 #define FASTRPC_DSP_UTILITIES_HANDLE 2 +#define FASTRPC_MAX_STATIC_HANDLE (20) #define FASTRPC_CTXID_MASK GENMASK(15, 8) #define INIT_FILELEN_MAX (2 * 1024 * 1024) #define INIT_FILE_NAMELEN_MAX (128) @@ -106,6 +109,12 @@ =20 #define miscdev_to_fdevice(d) container_of(d, struct fastrpc_device, miscd= ev) =20 +/* Poll response number from remote processor for call completion */ +#define FASTRPC_POLL_RESPONSE (0xdecaf) + +/* Polling mode timeout limit */ +#define FASTRPC_POLL_MAX_TIMEOUT_US (10000) + struct fastrpc_phy_page { u64 addr; /* physical address */ u64 size; /* size of contiguous region */ @@ -236,8 +245,14 @@ struct fastrpc_invoke_ctx { u32 sc; u64 *fdlist; u32 *crc; + /* Poll memory that DSP updates */ + u32 *poll; u64 ctxid; u64 msg_sz; + /* work done status flag */ + bool is_work_done; + /* process updates poll memory instead of glink response */ + bool is_polled; struct kref refcount; struct list_head node; /* list of ctxs */ struct completion work; @@ -301,6 +316,8 @@ struct fastrpc_user { int client_id; int pd; bool is_secure_dev; + /* Flags poll mode state */ + bool poll_mode; /* Lock for lists */ spinlock_t lock; /* lock for allocations */ @@ -894,7 +911,8 @@ static int fastrpc_get_meta_size(struct fastrpc_invoke_= ctx *ctx) sizeof(struct fastrpc_invoke_buf) + sizeof(struct fastrpc_phy_page)) * ctx->nscalars + sizeof(u64) * FASTRPC_MAX_FDLIST + - sizeof(u32) * FASTRPC_MAX_CRCLIST; + sizeof(u32) * FASTRPC_MAX_CRCLIST + + sizeof(u32); =20 return size; } @@ -990,6 +1008,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc= _invoke_ctx *ctx) list =3D fastrpc_invoke_buf_start(rpra, ctx->nscalars); pages =3D fastrpc_phy_page_start(list, ctx->nscalars); ctx->fdlist =3D (u64 *)(pages + ctx->nscalars); + ctx->poll =3D (u32 *)(ctx->fdlist + FASTRPC_MAX_FDLIST + FASTRPC_MAX_CRCL= IST); args =3D (uintptr_t)ctx->buf->virt + metalen; rlen =3D pkt_size - metalen; ctx->rpra =3D rpra; @@ -1158,6 +1177,75 @@ static int fastrpc_invoke_send(struct fastrpc_sessio= n_ctx *sctx, =20 } =20 +static inline u32 fastrpc_poll_op(void *p) +{ + struct fastrpc_invoke_ctx *ctx =3D p; + + dma_rmb(); + return READ_ONCE(*ctx->poll); +} + +static int poll_for_remote_response(struct fastrpc_invoke_ctx *ctx) +{ + u32 val; + int ret; + + /* + * Poll until DSP writes FASTRPC_POLL_RESPONSE into *ctx->poll + * or until another path marks the work done. + */ + ret =3D read_poll_timeout_atomic(fastrpc_poll_op, val, + (val =3D=3D FASTRPC_POLL_RESPONSE) || + ctx->is_work_done, 1, + FASTRPC_POLL_MAX_TIMEOUT_US, false, ctx); + + if (!ret && val =3D=3D FASTRPC_POLL_RESPONSE) { + ctx->is_work_done =3D true; + ctx->retval =3D 0; + } + + if (ret =3D=3D -ETIMEDOUT) + ret =3D -EIO; + + return ret; +} + +static inline int fastrpc_wait_for_response(struct fastrpc_invoke_ctx *ctx, + u32 kernel) +{ + int err =3D 0; + + if (kernel) { + if (!wait_for_completion_timeout(&ctx->work, 10 * HZ)) + err =3D -ETIMEDOUT; + } else { + err =3D wait_for_completion_interruptible(&ctx->work); + } + + return err; +} + +static int fastrpc_wait_for_completion(struct fastrpc_invoke_ctx *ctx, + u32 kernel) +{ + int err; + + do { + if (ctx->is_polled) { + err =3D poll_for_remote_response(ctx); + /* If polling timed out, move to normal response mode */ + if (err) + ctx->is_polled =3D false; + } else { + err =3D fastrpc_wait_for_response(ctx, kernel); + if (err) + return err; + } + } while (!ctx->is_work_done); + + return err; +} + static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel, u32 handle, u32 sc, struct fastrpc_invoke_args *args) @@ -1193,16 +1281,25 @@ static int fastrpc_internal_invoke(struct fastrpc_u= ser *fl, u32 kernel, if (err) goto bail; =20 - if (kernel) { - if (!wait_for_completion_timeout(&ctx->work, 10 * HZ)) - err =3D -ETIMEDOUT; - } else { - err =3D wait_for_completion_interruptible(&ctx->work); - } + /* + * Set message context as polled if the call is for a user PD + * dynamic module and user has enabled poll mode. + */ + if (handle > FASTRPC_MAX_STATIC_HANDLE && fl->pd =3D=3D USER_PD && + fl->poll_mode) + ctx->is_polled =3D true; + + err =3D fastrpc_wait_for_completion(ctx, kernel); =20 if (err) goto bail; =20 + if (!ctx->is_work_done) { + err =3D -ETIMEDOUT; + dev_dbg(fl->sctx->dev, "Invalid workdone state for handle 0x%x, sc 0x%x\= n", + handle, sc); + goto bail; + } /* make sure that all memory writes by DSP are seen by CPU */ dma_rmb(); /* populate all the output buffers with results */ @@ -1780,6 +1877,30 @@ static int fastrpc_get_info_from_kernel(struct fastr= pc_ioctl_capability *cap, return 0; } =20 +static int fastrpc_set_option(struct fastrpc_user *fl, char __user *argp) +{ + struct fastrpc_ioctl_set_option opt =3D {0}; + int i; + + if (copy_from_user(&opt, argp, sizeof(opt))) + return -EFAULT; + + for (i =3D 0; i < ARRAY_SIZE(opt.reserved); i++) { + if (opt.reserved[i] !=3D 0) + return -EINVAL; + } + + if (opt.req !=3D FASTRPC_POLL_MODE) + return -EINVAL; + + if (opt.value) + fl->poll_mode =3D true; + else + fl->poll_mode =3D false; + + return 0; +} + static int fastrpc_get_dsp_info(struct fastrpc_user *fl, char __user *argp) { struct fastrpc_ioctl_capability cap =3D {0}; @@ -2134,6 +2255,9 @@ static long fastrpc_device_ioctl(struct file *file, u= nsigned int cmd, case FASTRPC_IOCTL_MEM_UNMAP: err =3D fastrpc_req_mem_unmap(fl, argp); break; + case FASTRPC_IOCTL_SET_OPTION: + err =3D fastrpc_set_option(fl, argp); + break; case FASTRPC_IOCTL_GET_DSP_INFO: err =3D fastrpc_get_dsp_info(fl, argp); break; @@ -2465,6 +2589,7 @@ static int fastrpc_rpmsg_callback(struct rpmsg_device= *rpdev, void *data, =20 ctx->retval =3D rsp->retval; complete(&ctx->work); + ctx->is_work_done =3D true; =20 /* * The DMA buffer associated with the context cannot be freed in diff --git a/include/uapi/misc/fastrpc.h b/include/uapi/misc/fastrpc.h index c6e2925f47e6..3207c42fb318 100644 --- a/include/uapi/misc/fastrpc.h +++ b/include/uapi/misc/fastrpc.h @@ -16,6 +16,7 @@ #define FASTRPC_IOCTL_INIT_CREATE_STATIC _IOWR('R', 9, struct fastrpc_init= _create_static) #define FASTRPC_IOCTL_MEM_MAP _IOWR('R', 10, struct fastrpc_mem_map) #define FASTRPC_IOCTL_MEM_UNMAP _IOWR('R', 11, struct fastrpc_mem_unmap) +#define FASTRPC_IOCTL_SET_OPTION _IOWR('R', 12, struct fastrpc_ioctl_set_o= ption) #define FASTRPC_IOCTL_GET_DSP_INFO _IOWR('R', 13, struct fastrpc_ioctl_cap= ability) =20 /** @@ -66,6 +67,8 @@ enum fastrpc_proc_attr { =20 /* Fastrpc attribute for memory protection of buffers */ #define FASTRPC_ATTR_SECUREMAP (1) +/* Set option request ID to enable poll mode */ +#define FASTRPC_POLL_MODE (1) =20 struct fastrpc_invoke_args { __u64 ptr; @@ -133,6 +136,12 @@ struct fastrpc_mem_unmap { __s32 reserved[5]; }; =20 +struct fastrpc_ioctl_set_option { + __u32 req; /* request id */ + __u32 value; /* value */ + __s32 reserved[6]; +}; + struct fastrpc_ioctl_capability { __u32 unused; /* deprecated, ignored by the kernel */ __u32 attribute_id; --=20 2.34.1