[PATCH 0/4] media: qcom: camss: fixes for SoCs without IOMMU, RDI and CSID1 streaming
From: Allan Siriani
Date: Wed Nov 04 2026 - 18:43:08 EST
These fixes came out of bringing up the CAMSS on MSM8226 (Moto G 2013,
"falcon", MT9M114 front camera on RDI), where the CAMSS is not behind an
IOMMU. The MSM8226 support itself will be sent separately; the problems
fixed here are generic.
1. The write masters take one base address per plane, but the buffers
come from vb2_dma_sg and only the first scatterlist entry is used.
Without an IOMMU the buffer is physically scattered and the frame is
written over unrelated memory: on a 1280x960 RAW10 capture only the
first 656 lines (the first 1 MiB segment) land in the buffer, and the
device reboots within a few frames. Use vb2_dma_contig when the device is not IOMMU mapped, and
refuse non contiguous DMA mappings on the vb2_dma_sg path.
2. In frame based (RDI) mode the VFE 4.1 write master buffer size is
never programmed. Program WR_BUFFER_CFG as the downstream driver does.
3. video_stop_streaming() bails out on -ENOIOCTLCMD from a subdev
without .s_stream() (e.g. the MT9M114 pixel array), leaving the
pipeline started and the buffers with the driver: vb2 WARNs and the
next STREAMON / "media-ctl -r" fail with -EBUSY.
4. csid_set_power() powers up the VFE of the same index as the CSID,
and fails with -EINVAL when there is none. On MSM8916/MSM8226 (two
CSIDs, one VFE behind the ISPIF) streaming from CSID1 fails with
"Failed to power up pipeline: -22". Skip the VFE power up there.
Build tested (W=1) on next-20261104 for ARM with COMPILE_TEST.
Runtime tested on the MSM8226 (Moto G 2013) with the same changes applied
to a 6.16 based kernel, not yet on linux-next: on the rear AR0543 (RAW10
1280x960, CSIPHY0) every buffer gets exactly sizeimage bytes and nothing
past it, and STREAMOFF/STREAMON and "media-ctl -r" work repeatedly. On the
front MT9M114 (UYVY) the first frame after STREAMON can still run 128
bytes past sizeimage (one burst); later frames are exact. Patch 1 alone
already stops the memory corruption.
Allan Siriani (4):
media: qcom: camss: use contiguous buffers when there is no IOMMU
media: qcom: camss: vfe-4-1: program the RDI write master buffer size
media: qcom: camss: always stop the pipeline in stop_streaming
media: qcom: camss: do not fail CSID power up without a matching VFE
drivers/media/platform/qcom/camss/Kconfig | 1 +
.../media/platform/qcom/camss/camss-vfe-4-1.c | 34 +++++++-
.../media/platform/qcom/camss/camss-vfe-4-7.c | 3 +-
.../media/platform/qcom/camss/camss-vfe-4-8.c | 3 +-
.../platform/qcom/camss/camss-vfe-gen1.c | 5 +-
.../platform/qcom/camss/camss-vfe-gen1.h | 3 +-
.../media/platform/qcom/camss/camss-video.c | 78 ++++++++++++++++---
drivers/media/platform/qcom/camss/camss.c | 17 ++--
8 files changed, 115 insertions(+), 29 deletions(-)
base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4
--
2.43.0