drivers: media: cfe: Add more robust ISR handlers
authorNaushir Patuck <naush@raspberrypi.com>
Mon, 18 Dec 2023 09:52:45 +0000 (09:52 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:24 +0000 (11:35 +0000)
commit3fb94ab423bde788663133bdf795336d11b01348
treea6b9ade46663d54ef9c0c9f5d4589383294394a3
parente1b91ade12a0e2d0a76d6d2f4118fa23c88ffe47
drivers: media: cfe: Add more robust ISR handlers

Update the ISR logic to be more robust to sensors in problematic states
where interrupts may start arriving overlapped and/or missing.

1) Test for cur_frame in the FE handler, and if present, dequeue it in
an error state so that it does not get orphaned.

2) Move the sequence counter and timestamp variables to the node
structures.  This allows the ISR to track channels running ahead when
interrupts arrive unordered.

3) Add a test to ensure we don't have a spurios (but harmlesS) call to
the FE handler in some circumstances.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
drivers/media/platform/raspberrypi/rp1_cfe/cfe.c