Re: [PATCH v5 03/10] media: rcar-csi2: Move {enable|disable}_streams() calls

From: Tomi Valkeinen

Date: Wed Jun 17 2026 - 05:39:10 EST


Hi,

On 16/06/2026 17:04, Niklas Söderlund wrote:

rcsi2_irq_thread() also calls rcsi2_stop(), followed by rcsi2_start().
This is to handle errors reported by the AFIFO_OF, ERRSOTHS and
ERRSOTSYNCHS interrupts. If the source isn't restarted, such an attempt
to recover from errors will likely fail. On the other hand, restarting
the source will likely not lead to great results either.

Indeed. I think for single-stream use cases the behavior should still be
the same, but for multi-stream use, any enabled stream will keep the
csi2 enabled.

This kind of error handling sounds a bit fragile. If a restart helps,
don't we need to restart the whole pipeline, not just from csi2-rx
upwards? Or is it guaranteed that the ISP/CS and VIN will continue working?

My feeling is that these kind of errors would be best handled in
userspace.

I agree this should be handled in user-space. But since we have (or at
least did not when this was added) no way to signal to user-space that
an error have occurred and that action is needed this at least solved
the error reported by the user.

If we think this is should be dropped and somehow signal user-space that
action is needed that is OK for me. But then please remove all of it.


Did this work earlier with the custom VC based routing?

That I don't know.

It did. At least for the only way I had to create the error condition by
"hot plugging" the CVBS input IIRC.
I think what I could try here is to call v4l2_subdev_disable_streams() from rcsi2_irq_thread(), disabling all currently enabled streams from the source, and then v4l2_subdev_enable_streams() them back. In theory that should do the same as the current code.

I also realized I have a bug here: enable streams does a "priv->stream_count += 1", regardless of how many streams the source_streams_mask mask contains... I need to check if this same pattern is present elsewhere.

Tomi