Re: [PATCH v2 11/11] media: intel/ipu6: fix EOF sequence logging in ipu6_isys_isr_one()

From: Sakari Ailus

Date: Wed Nov 04 2026 - 08:36:12 EST


Hi Valerii,

On Tue, Nov 03, 2026 at 09:11:21PM +0000, Valerii Sokolov wrote:
> When handling IPU6_FW_ISYS_RESP_TYPE_FRAME_SOF in ipu6_isys_isr_one(),
> stream->seq[stream->seq_index] is populated with the current sequence
> (atomic_read(&stream->sequence) - 1) and stream->seq_index is immediately
> advanced to the next ring buffer slot.
>
> Subsequently, when IPU6_FW_ISYS_RESP_TYPE_FRAME_EOF arrives, logging
> stream->seq[stream->seq_index].sequence reads the next slot in the ring
> buffer rather than the slot written at SOF (logging a stale sequence
> number from IPU6_ISYS_MAX_PARALLEL_SOF - 1 frames ago, or 0 on the first
> frame).
>
> Read atomic_read(&stream->sequence) - 1 directly so the EOF debug message
> logs the current frame sequence number matching SOF.
>
> Fixes: f50c4ca0a820 ("media: intel/ipu6: add the main input system driver")
> Reviewed-by: Antti Laakso <antti.laakso@xxxxxxxxxxxxxxx>
> Signed-off-by: Valerii Sokolov <valerii.sokolov@xxxxx>
> ---
> drivers/media/pci/intel/ipu6/ipu6-fw-isys.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/pci/intel/ipu6/ipu6-fw-isys.c b/drivers/media/pci/intel/ipu6/ipu6-fw-isys.c
> index 5d95fb9234..ad08506b32 100644
> --- a/drivers/media/pci/intel/ipu6/ipu6-fw-isys.c
> +++ b/drivers/media/pci/intel/ipu6/ipu6-fw-isys.c
> @@ -651,7 +651,7 @@ int ipu6_isys_isr_one(struct ipu6_bus_device *adev)
> dev_dbg(&adev->auxdev.dev,
> "eof: handle %d: (index %u), timestamp 0x%16.16llx\n",
> resp->stream_handle,
> - stream->seq[stream->seq_index].sequence, ts);
> + atomic_read(&stream->sequence) - 1, ts);

Except for this one.

The IPU firmware works based on timestamps and you could obtain the
sequence based on the timestamp but I don't think it's worth it here. I'd
just omit printing the sequence number which is unreliable.

> break;
> case IPU6_FW_ISYS_RESP_TYPE_STATS_DATA_READY:
> break;

--
Regards,

Sakari Ailus