From mboxrd@z Thu Jan 1 00:00:00 1970 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 52FAB3C0625 for ; Thu, 16 Apr 2026 14:02:53 +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=1776348174; cv=none; b=K0BKkdaJi3PQH1prI8ttNJZYBhgAFjxikxUPWIfgzBfsI4/EPEgT10L/fBCVPmzhBu5T4fKiENQ3hyQlB/DFLbWKaZV9TE7N2aTozBgZw5T1X8EozH18jx37Yp622f3+r1npi44lD6FIbCvDm2vKJbPZiFLJfh5ZqP0Ji+ii4+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776348174; c=relaxed/simple; bh=qjRdv1T42sIsZ52Prw/LobikbnuRFbe8j88C1bwa3Wc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=D6NDcV7BYlg985q0ai0HdxVVk4wMqz9gXNm1ki7zXZ2TUEvEusctNtn3W/QqxXDuPbEzoWz51zmsXbLSzOY/JHkLFTmMslTw+d180FG2ua528mkynHuuonOTE9yJsEV4BPdx3WhgPsD5AZkE/A5ihn3ekjawlex3fKzTGTSacac= 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=K88paQfM; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=HO2rmB0o; 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="K88paQfM"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="HO2rmB0o" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63G8CMXZ2575781 for ; Thu, 16 Apr 2026 14:02:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= lK4ABVEsh6vQVo/gXF6kYceIrK1uJbLooD8HSUD9HiY=; b=K88paQfMfy9cAtk2 kzMbi/YdkaDrgPNwIPQdzDhZWgqOjhYwuwfNHKEgk33d09bMdZl4Jn1gEWXtCIWN xM7vM0Nxi3aycorwa1zAfmTBHGb2SgsewN/TnguvOvzP1WUe3qWTz5cTqu2FUcL8 1TO5E1xZwik8YQNb4VcmGuK8Ln88CXRyyhhuEamnc3wtzBZwgIJ0rHIR8DhH+r0C fQBMA0qd4i3yNWUtAprWcS94JZS0gdGZDwZSMpnobI0RNIGa6c1fcYSQNmo0DJJl HiFPwVrpWTmUb5C6NaxcFEqCepv4ygg6L6mSIfdXRuAM810/1x0ng1rRs2s4ojF+ 0mwn9Q== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4djv27h7xe-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 16 Apr 2026 14:02:52 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-82f543bae3cso413953b3a.1 for ; Thu, 16 Apr 2026 07:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776348171; x=1776952971; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=lK4ABVEsh6vQVo/gXF6kYceIrK1uJbLooD8HSUD9HiY=; b=HO2rmB0oTAG5vDTjt354u/GVpjIq3SVa7xHBQU2QiBqzLg3Lamfx00sl0EGQY6ppCO RRqRX5sNnEdIDG58PctaH48nnZ2f+LxInBVVLziOydBbGzjDyIuIw4CcgpoSNPeA4q2H RcpbAx6A3z+pgEf7qw/HjXKfzqld5Q49wcigKhs7oHPA5eNd4wQoYCOHNZ4FNwDjxzmE N5S4A24vYn5JKMTonE3OC8cm8lAbapv+C9iVaA9ZF5Gu5VwC3o9wgXdFSQBZi37wpJvU Si8WGamoHB7ZtZHaHpc+pOFxSAWGgish8NEVpIQtEaMPEbXagdtK8N7gshaqD6fE7EOH Rr/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776348171; x=1776952971; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lK4ABVEsh6vQVo/gXF6kYceIrK1uJbLooD8HSUD9HiY=; b=qwR3/AHu9CWqyZlfWY9AtaOVt93W005c27nbqhRAEvA+27xVMgGWgPo70OfSa4JvjF GkAofDTAZdOAf4ypbJ9ohTLauWVunR6wuZ1+QUMrf42XZq6+wnZ4kpZMyv1+GwYzsJ+I UeAgqzbJprccctWcP4+2+5hV+pOJuheUgSY8wGK6qs+xxF/bOBbPXJtkOKG0NzE7XAJV a3BGkhil9Nfsgbe9vMRmw9/UTWpDMSY/bbdyWnTHrgXE25/BUDIqz6nWbJ26dyFKXo3O Mz2Ht3ch1Pal26ENhEZe6b3a4+tt0SVQZ20Fa/NkNhzO65Jcy+NgCXnk3bHQUm/WRqAR POQQ== X-Forwarded-Encrypted: i=1; AFNElJ8Rd+4lyM2wBeLxHUcxPPfjEt/wtNkSDe4fEycXUnHBAUb8uOimD/fnGOSm2uvctU9r+M+fbNx5Gh4rWBE=@vger.kernel.org X-Gm-Message-State: AOJu0YwZL1A5xrdR4VsnxZvZt8CcIJAG/GPAw0B4bdmtVTr4XAO784OP /1GIGZ2PEBC8+YPCVFD2MxL16/8AuvCPCp1SN5mj1gPh4VieVowTa4yTc3OwT/kmwAnIKEkd6yr KR422+XKpagrHNvaJ+7ZJ/DCWUAHkBgZrwc1yxU3EuUVvF9AKHdvkWR/+rES/ln40fUR3yJSJXB uHvA== X-Gm-Gg: AeBDievZtpNu1fUIYKazcf7rH/ozXKB0FEB4BKZ3ktWzD6RAlD+DLM1Tj3t2gw5nZbY zjfGxVw1K/95rwzs554voVAF3JvoRfWJCoFCSg0fcGNCINv2QyMZyJpwxLJdEAd3pUmnSmNQ3eg EH4HYv9RwYgkkJyk11glJCkqDVcfao9eOQtWrtNfOXQgBR6gi1hNWeIn8ItX+GfgDzA41zS1eng xLklZ3p60u5iPw8rD6p0zCfreKoLorNV9BAtmfDjNfEMuzkFtKw3u+4H66OO7vD4WBqy5wMJfKn 2X9m627iV4DUBkhC6tRzl0Dc/4nzm4N6vrExiNbdMhEiXbyQV+8fqhvMZtsJrMKQ9LjWJ2+l7tb ny7shqczO94UU1zgZl2CttebL2qZL7qD9U5G2xnd2eJ8k0A+5BpMz/h/QijQRxk8= X-Received: by 2002:a05:6a00:4308:b0:82f:6640:7221 with SMTP id d2e1a72fcca58-82f764f632dmr3315534b3a.22.1776348170752; Thu, 16 Apr 2026 07:02:50 -0700 (PDT) X-Received: by 2002:a05:6a00:4308:b0:82f:6640:7221 with SMTP id d2e1a72fcca58-82f764f632dmr3315466b3a.22.1776348170039; Thu, 16 Apr 2026 07:02:50 -0700 (PDT) Received: from [192.168.1.10] ([122.164.36.130]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f738b399bsm3451789b3a.8.2026.04.16.07.02.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Apr 2026 07:02:49 -0700 (PDT) Message-ID: <0bab12c2-48f3-45a2-a87b-b33b60b5a7df@oss.qualcomm.com> Date: Thu, 16 Apr 2026 19:32:43 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 4/4] misc: fastrpc: Add polling mode support for fastRPC driver To: Dmitry Baryshkov Cc: srini@kernel.org, linux-arm-msm@vger.kernel.org, gregkh@linuxfoundation.org, quic_bkumar@quicinc.com, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, dri-devel@lists.freedesktop.org, arnd@arndb.de, konrad.dybcio@oss.qualcomm.com, andersson@kernel.org References: <20260415112530.4083240-1-ekansh.gupta@oss.qualcomm.com> <20260415112530.4083240-5-ekansh.gupta@oss.qualcomm.com> Content-Language: en-US From: Ekansh Gupta In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=PJQ/P/qC c=1 sm=1 tr=0 ts=69e0ec0c cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=XANuBpsXGvULjGEGCPeV4Q==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=pm_eAs2JUF_NPnZ18oEA:9 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv:22 X-Proofpoint-GUID: FGBht_c3uhtKOyO_oS0NEFwD1lkOXlZ2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE2MDEzNCBTYWx0ZWRfXzlqyVygfT2Sz ddvJSR8MRuMoyQBfZsxc/7hhop//8pgqZfCRQaxgjCEXnoAg7aPiobkWzfoWec0plKYNFxb69Er vNYW6DIQuJR7QXmPM7fR+MVvShpBmkpsvv0G9zCjdh/LMAZ7tgYl9jGe32RVvxZOnWDnZN3FTZI wqjEODVu6ZhclWney4OzTWQ3POL3zsk/U2LgtkRVM8gzAPC4YcnUh01TLCja7fPjCsVxadi0kma LQQ4+JqaXhW9SSmzZTFBEyjpLwki0MEfPPriEnANHpRODhcKLPjUxnhb6+C2lqjNaAasvybx3Fc I7oNcmuL/KXPuGkDcC7pTRIcqByCES6VB8UdLCR9oWmUvChEqSr/7+vpGBiQYdgwENuu1Qo0bLt 0PkTezcSWATVpPfRriBJd5jEUvAWoYzuI+LI9PFBP/RsNgLiAJlsMwcbtF4pwLZt5Mv9i5Mv7XY obCn7JWSi7X9nXrCYzw== X-Proofpoint-ORIG-GUID: FGBht_c3uhtKOyO_oS0NEFwD1lkOXlZ2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-16_03,2026-04-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604160134 On 16-04-2026 16:25, Dmitry Baryshkov wrote: > On Wed, Apr 15, 2026 at 04:55:30PM +0530, Ekansh Gupta wrote: >> 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. In case >> poll timeout happens, the call will fallback to normal RPC mode. 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 | 137 ++++++++++++++++++++++++++++++++++-- >> include/uapi/misc/fastrpc.h | 25 +++++++ >> 2 files changed, 155 insertions(+), 7 deletions(-) >> >> @@ -1813,6 +1908,30 @@ static int fastrpc_get_info_from_kernel(struct fastrpc_ioctl_capability *cap, >> return 0; >> } >> >> +static int fastrpc_set_option(struct fastrpc_user *fl, char __user *argp) >> +{ >> + struct fastrpc_ioctl_set_option opt = {0}; >> + int i; >> + >> + if (copy_from_user(&opt, argp, sizeof(opt))) >> + return -EFAULT; >> + >> + for (i = 0; i < ARRAY_SIZE(opt.reserved); i++) { >> + if (opt.reserved[i] != 0) >> + return -EINVAL; >> + } >> + >> + if (opt.request_id != FASTRPC_POLL_MODE) >> + return -EINVAL; >> + >> + if (opt.value) >> + fl->poll_mode = true; > > This will enable poll mode on the platforms where it is not supported, > later silinently changing back to the normal mode. Please don't surprise > users and make this call fail if polling mode is not supported. Ack. Working on adding compatible based checks for supporting platforms by reading the root compatible string, something like pdmapper[1]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/soc/qcom/qcom_pd_mapper.c#n643 Thanks, Ekansh > >> + else >> + fl->poll_mode = false; >> + >> + return 0; >> +} >> + >