Skip to contentSkip to conversation

ipu6: no frames from a RAW8 stream while i-wake is enabled

PATCH Emfox Zhou 1 participant 1 message Nov 11

Subsystems (2)
lore
Share & tools
lore

Emfox Zhou

author
#0 lore raw

Hi,

On a Surface Pro 8 (Tiger Lake, IPU6) with the VD55G0 IR sensor on CSI2 port 5, a RAW8 stream never delivers a frame while i-wake is enabled. STREAMON succeeds, no buffer ever completes, and the receiver reports

intel_ipu6_isys.isys intel_ipu6.isys.40: csi2-5 error: Transfer FIFO overflow

The same sensor, same link and same line length register, with only the mbus code changed from Y8_1X8 to Y10_1X10, delivers every frame.

What the driver computes (7.4-rc2, line length register forced to 1440 px in both runs; the fill column is 200 KiB / rate, the rest is printed by the driver):

	format      rate  fill     did written      threshold  frames
	Y8_1X8      140   1462 us  1023 (clamped)   92         0 / 10
	Y10_1X10    112   1828 us  1023 (clamped)   93         5 / 5

The watermark numbers are not what separates the two cases: the failing stream has the smaller fill time and a slightly smaller threshold, and both hit the same did clamp.

Ruled out on this machine:

- CPU idle latency. Three cores at 100% for the whole capture changes nothing, twice. Same error string as Hans' report of October 2025 (<[email protected]>), but there the CPU load made it go away.

- Capture node pixel format. GREY and BA81 both fail.

- Line period. Stretching the VD55G0 line length register from 1200 to 1440 px moves the RAW8 line period from about 12.1 us to 14.5 us and every frame is still lost. This is not a complete test: bpp covers both the bytes per line and the pixel rate, so RAW10 at the same register setting has an 18.2 us line period and the two were never matched exactly.

With i-wake disabled the RAW8 stream works, which is how I have been capturing frames so far.

On the host side the only thing that differs is the MIPI data type handed to the firmware: ipu6_isys_get_frame_desc() takes it from the mbus code through ipu6_isys_mbus_code_to_mipi(), 0x2a for RAW8 and 0x2b for RAW10. I could not find any other host-side handling that depends on the bpp.

So before writing anything: is a RAW8 stream expected to work with i-wake at all, or should the driver simply not enable it for that data type?

The error line above only appears because I read the receiver status once when the stream stops. In 7.4-rc2 ipu6_isys_csi2_error() is only called on PIN_DATA_READY, which never happens when no frame completes, so a stock kernel shows nothing at all. That change is eight lines and is appended below.

Reproduction, sensor at 640x600 on port 5, capture node 40:

	media-ctl -d /dev/media0 \
	  --set-v4l2 '"vd55g0 3-0060":0[fmt:Y8_1X8/640x600]' \
	  --set-v4l2 '"Intel IPU6 CSI2 5":0[fmt:Y8_1X8/640x600]' \
	  --set-v4l2 '"Intel IPU6 CSI2 5":1[fmt:Y8_1X8/640x600]' \
	  --link '"Intel IPU6 CSI2 5":1 -> "Intel IPU6 ISYS Capture 40":0[1]'
	v4l2-ctl -d /dev/video40 \
	  --set-fmt-video=width=640,height=600,pixelformat=GREY \
	  --stream-mmap --stream-count=10 --stream-to=/tmp/f.raw

With Y10_1X10 from the sensor up to the port and pixelformat='Y10 ', the same commands deliver ten frames.

Thanks,
Emfox Zhou

8< ---
Patch mentioned above, applies to v7.4-rc2:

From: Emfox Zhou <[email protected]>
Subject: [PATCH] media: ipu6: report CSI2 receiver errors when a stream stops

ipu6_isys_csi2_error() is only called from the PIN_DATA_READY path, so a stream that never completes a frame never reads the receiver status and reports no error at all. The only visible symptom is that STREAMON succeeds and no buffer ever completes.

Read the accumulated status once when the stream is disabled. On a machine where a stream overflows the receive FIFO this turns a silent failure into

csi2-5 error: Transfer FIFO overflow

No functional change for streams that do complete frames: the status bits are write-1-to-clear and are cleared right after being read.

---
 drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c +8 -0
index 152545427..e2b00f889 100644
@@ -767,6 +767,14 @@ static int ipu6_isys_csi2_disable_streams(struct v4l2_subdev *sd,
 
 	struct ipu6_isys_stream *stream =
 		ipu6_isys_find_stream_firmware(csi2, vc);
+
+	/*
+	 * Receiver errors are otherwise only reported on PIN_DATA_READY, so a
+	 * stream that never completes a frame reports nothing at all. Read the
+	 * accumulated status once on the way out.
+	 */
+	ipu6_isys_csi2_error(csi2);
+
 	ipu6_isys_stop_stream_firmware(stream);
 
 	if (IS_IPU7(isp) || IS_IPU8(isp))