[PATCH v1 0/2] media: rockchip: rkcif: Fix a system hang and validate the pixel format

Mehdi Djait mehdi.djait at linux.intel.com
Thu Nov 12 10:32:06 PST 2026


Hello Michael :)

Sorry for the additional work with this flood of patches...

This series fixes two issues in the rkcif driver that stayed long enough on
my TODO list.

I am using an RK3588 ROCK 5B with an IMX415 sensor.

Patch 1 drops the reset from the runtime suspend. The reset also resets
the VICAP IOMMU and hangs the system when the IOMMU driver accesses the
IOMMU registers at the same time. This was reproduced by repeatedly
starting and stopping the stream with runtime PM enabled.

Steps to reproduce the issue:
* configure the media pipeline
* You can use this script here:
--------------------------------------------------------------------------------
$ cat stream-loop.sh
#!/bin/bash
# Start and stop yavta in a loop: stream for a random 0.1-1 s
# Usage: ./stream-loop.sh [device]

DEV=${1:-/dev/video0}

trap 'echo; echo "stopped after $i iterations"; exit 0' INT

i=0
while true; do
	i=$((i + 1))
	stream=$(printf "0.%03d" $((100 + RANDOM % 900)))

	echo "=== iteration $i: stream ${stream}s"
	timeout -s INT "$stream" yavta -c -f SGBRG10 -s 3864x2192 "$DEV"
done
--------------------------------------------------------------------------------

Patch 2 rejects pipelines where the pixel format does not match the
media bus code on the source pad.

Steps to reproduce the issue:
* configure the media pipeline to use SGBRG10
* try to capture with yavta using the format SGBRG12

Fyi:
Another patch is also needed to not get the timeout everytime the
streaming is stopped but some of the work on that patch is already done
in Daniel's 4th patch:
https://lore.kernel.org/linux-media/cover.1793702189.git.daniel@makrotopia.org/


Mehdi Djait (2):
  media: rockchip: rkcif: Don't reset the hardware in runtime suspend
  media: rockchip: rkcif: Validate the pixel format against the media
    bus code

 .../media/platform/rockchip/rkcif/rkcif-common.h  |  1 -
 drivers/media/platform/rockchip/rkcif/rkcif-dev.c | 15 ---------------
 .../media/platform/rockchip/rkcif/rkcif-stream.c  | 12 ++++++++++++
 3 files changed, 12 insertions(+), 16 deletions(-)

-- 
2.56.0




More information about the Linux-rockchip mailing list