Skip to content

misc: fastrpc: Fix SMMU context fault on sensors PD

Piyush Raj Chouhan dri-devel linux-arm-msm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 1 replyIn review
  2. v11 patch 0 repliesSuperseded

Changes in v2 from the cover letter

- Retain Robin Snyders as the original patch author, with Piyush Raj Chouhan handling testing, downstream validation, and upstream submission.
- Drop inline code comment in fastrpc.c to keep the patch clean and minimal.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1misc: fastrpc: Allocate message buffer from remote heap for sensors PDdrivers/misc/fastrpc.c+1 -11 reply

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchDmitry Baryshkov
1/1R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/1] misc: fastrpc: Fix SMMU context fault on sensors PD

Hi Srinivas, Greg,

While bringing up the sensors DSP (SLPI) on Qualcomm SM8150 devices, we ran into an SMMU context fault whenever userspace (hexagonrpcd) tries to attach to the sensors protection domain (/dev/fastrpc-sdsp).

The issue comes down to fastrpc_get_args(): if the device tree defines a stream ID (sid) for the context bank, FastRPC allocates the message buffer through the SMMU using fastrpc_buf_alloc(). However, the sensors PD on SLPI firmware expects this buffer in physical shared memory from the remote heap, bypassing the context bank. Handing it an SMMU-mapped IOVA triggers an immediate fault:

arm-smmu 15000000.iommu: Unhandled context fault: fsr=0x402, iova=0x1fffff000, fsynr=0x330001, cbfrsynra=0x5a1, cb=11 qcom_q6v5_pas 2400000.remoteproc: fatal error received: PDM: service 'sensor_process' crash remoteproc remoteproc0: crash detected in slpi: type fatal error

This patch checks for SENSORS_PD and ensures its message buffer is always allocated from the remote heap, even when an SMMU sid is configured. Other workloads (compute, camera, audio) remain unaffected.

After applying this fix:
- hexagonrpcd attaches cleanly without crashing SLPI or dropping pipes.
- SLPI remains up with zero SMMU faults.
- Sensor queries over QRTR/SEE (service 400) succeed and stream live accelerometer, gyro, and magnetometer data to userspace.

Tested on Xiaomi Redmi K20 Pro and OnePlus 7T Pro running 7.3-rc.

Changes in v2:
- Retain Robin Snyders as the original patch author, with Piyush Raj Chouhan handling testing, downstream validation, and upstream submission.
- Drop inline code comment in fastrpc.c to keep the patch clean and minimal.

Thanks,
Piyush

Robin Snyders (1):
misc: fastrpc: Allocate message buffer from remote heap for sensors PD

 drivers/misc/fastrpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.55.0