linux/drivers/misc
Ekansh Gupta 96e62cc0a8 misc: fastrpc: Add polling mode support for fastRPC driver
For any remote call to DSP, after sending an invocation message,
the fastRPC driver waits for a glink response, during which the CPU
can enter low power modes. This adds latency to the fastRPC call
due to CPU wakeup and scheduling overhead. Add polling mode support
where the fastRPC driver polls a shared memory location for
completion after sending the invocation, avoiding CPU wakeup and
scheduling latency and reducing fastRPC overhead. If the poll times
out, the call falls back to the normal interrupt/glink-based
completion path.

Poll mode is only applied to dynamic modules running in a user PD
(handle > FASTRPC_MAX_STATIC_HANDLE), since static/root-PD handles
are not expected to benefit from, or require, this optimization.
Support is advertised per SoC via fastrpc_soc_data, with a closed
exception list for older platforms whose DSP firmware is known to
support polling but which otherwise use the default soc_data.

Poll mode can be enabled by userspace via the FASTRPC_IOCTL_SET_OPTION
ioctl with the FASTRPC_POLL_MODE request id.

Since context IDs (ctxid) are allocated from a fixed-size, per-channel
cyclic IDR shared by all processes on a DSP, a context ID can be
recycled for a new request soon after it is freed. In poll mode the
context can be considered complete (and released) as soon as the poll
memory is updated, while the corresponding glink COMPLETE response
from the DSP may still be in flight. If that response arrives after
the ctxid has been reused, it would otherwise match the new context
and incorrectly signal completion for it while the DSP may still be
operating on the new context's buffers. To prevent this, embed a
monotonically increasing per-channel sequence number in the unused
upper bits of the ctxid/message context and validate it in the
rpmsg callback, dropping any response whose sequence number does not
match the current owner of that ctxid slot.

Signed-off-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20260729094352.111065-8-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-31 14:15:53 +02:00
..
altera-stapl Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
amd-sbi misc: amd-sbi: Add SBTSI ioctl register transfer interface 2026-07-17 15:50:48 +02:00
bcm-vk misc: bcm-vk: validate write size before allocation 2026-07-17 15:49:56 +02:00
c2port Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cardreader misc: rtsx: add missing write register handling 2026-07-17 15:49:57 +02:00
cb710 misc: cb710: Fix a NULL vs IS_ERR() check in probe() 2025-11-26 15:09:34 +01:00
eeprom Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
genwqe misc: genwqe: handle a first DMA address of zero 2026-07-17 15:50:25 +02:00
ibmasm misc: ibmasm: add parentheses around sizeof operand 2026-07-17 15:49:48 +02:00
issei issei: add heci hardware module 2026-07-17 15:48:11 +02:00
keba misc: keba: cp500: use pcim_enable_device() 2026-07-17 15:50:34 +02:00
lis3lv02d lis3lv02d: Omit IRQF_ONESHOT if no threaded handler is provided 2026-04-01 10:19:43 +02:00
lkdtm string: Remove strncpy() from the kernel 2026-06-18 16:39:31 -07:00
mchp_pci1xxxx Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
mei Merge 7.2-rc5 into char-misc-next 2026-07-27 14:17:19 +02:00
ocxl Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pvpanic Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
rp1 misc: rp1: Switch to irq_domain_create_linear() 2026-07-17 15:51:10 +02:00
sgi-gru misc: sgi-gru: fill execution status in exception details 2026-07-17 15:50:28 +02:00
sgi-xp Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
uacce Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vmw_vmci drivers: misc: vmw_vmci: fix typo in comment 2026-05-23 13:47:33 +02:00
ad525x_dpot-i2c.c misc: ad525x_dpot: use driver core groups for sysfs files 2026-07-17 15:50:10 +02:00
ad525x_dpot-spi.c misc: ad525x_dpot: use driver core groups for sysfs files 2026-07-17 15:50:10 +02:00
ad525x_dpot.c misc: ad525x_dpot: use driver core groups for sysfs files 2026-07-17 15:50:10 +02:00
ad525x_dpot.h misc: ad525x_dpot: use driver core groups for sysfs files 2026-07-17 15:50:10 +02:00
apds9802als.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
atmel-ssc.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
bh1770glc.c misc: bh1770glc: use pm_runtime_resume_and_get() in power_state_store 2025-11-26 15:09:37 +01:00
cs5535-mfgpt.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ds1682.c sysfs: treewide: switch back to bin_attribute::read()/write() 2025-06-17 10:44:13 +02:00
dummy-irq.c
dw-xdata-pcie.c dw-xdata: Use str_write_read() in dw_xdata_start() and dw_xdata_perf() 2025-09-06 15:59:39 +02:00
enclosure.c drivers/misc/enclosure: Replace strcpy() + strcat() with snprintf() 2026-07-17 15:49:07 +02:00
fastrpc.c misc: fastrpc: Add polling mode support for fastRPC driver 2026-07-31 14:15:53 +02:00
gehc-achc.c misc: gehc-achc: Follow renaming of SPI "master" to "controller" 2024-02-08 11:54:43 +00:00
hi6421v600-irq.c misc: Remove redundant dev_err()/dev_err_probe() 2026-07-17 14:56:17 +02:00
hisi_hikey_usb.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
hmc6352.c misc: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-07-03 16:41:00 +02:00
hpilo.c misc: hpilo: validate device queue entries before use 2026-07-17 15:49:59 +02:00
hpilo.h
ibmvmc.c misc: ibmvmc: reject oversized inbound messages 2026-07-17 15:50:03 +02:00
ibmvmc.h
ics932s401.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
isl29003.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
isl29020.c misc: isl29020: Fix the wrong format specifier 2024-11-12 12:54:53 +01:00
Kconfig issei: initial driver skeleton 2026-07-17 15:48:11 +02:00
kgdbts.c Char/Misc/IIO driver changes for 7.0-rc1 2026-02-17 09:11:04 -08:00
lan966x_pci.c misc: lan966x_pci: depopulate children on populate failure 2026-07-17 15:50:12 +02:00
lan966x_pci.dtso misc: lan966x_pci: Fix dtc warn 'Missing interrupt-parent' 2024-11-04 14:34:25 +01:00
lattice-ecp3-config.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
Makefile issei: initial driver skeleton 2026-07-17 15:48:11 +02:00
mrvl_cn10k_dpi.c misc: Remove redundant dev_err()/dev_err_probe() 2026-07-17 14:56:17 +02:00
nsm.c Merge 7.2-rc5 into char-misc-next 2026-07-27 14:17:19 +02:00
ntsync.c ntsync: Honour caller's time namespace for absolute MONOTONIC timeouts 2026-06-02 21:05:36 +02:00
open-dice.c misc: open-dice: add ACPI device discovery support 2026-07-17 15:51:03 +02:00
pch_phub.c misc: pch_phub: Make MAC address configuration more robust 2026-07-17 15:49:01 +02:00
pci_endpoint_test.c misc: pci_endpoint_test: Remove dead BAR read before doorbell trigger 2026-06-22 15:23:12 -05:00
phantom.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
qcom-coincell.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00
rpmb-core.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smpro-errmon.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
smpro-misc.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
sram-exec.c mm: Introduce set_memory_rox() 2022-12-15 10:37:26 -08:00
sram.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sram.h misc: sram: Improve and simplify clk handling 2023-03-09 17:31:53 +01:00
ti_fpc202.c misc: ti_fpc202: Support special-purpose GPIO lines with LED features 2026-04-02 16:29:27 +02:00
tifm_7xx1.c misc: tifm: Use PCI_VDEVICE to initialize pci_device_id array 2026-05-23 13:47:33 +02:00
tifm_core.c memstick: Constify the driver id_table 2026-05-11 16:59:43 +02:00
tps6594-esm.c misc: Remove redundant dev_err()/dev_err_probe() 2026-07-17 14:56:17 +02:00
tps6594-pfsm.c misc: Remove redundant dev_err()/dev_err_probe() 2026-07-17 14:56:17 +02:00
tsl2550.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vcpu_stall_detector.c misc: vcpu_stall_detector: Switch to use hrtimer_setup() 2025-02-18 11:19:04 +01:00
vmw_balloon.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xilinx_sdfec.c misc: xilinx_sdfec: validate LDPC code register offsets 2026-07-17 15:50:22 +02:00
xilinx_tmr_inject.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
xilinx_tmr_manager.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00