media: bcm2835-unicam: Fix bug in buffer swapping logic
authorNaushir Patuck <naush@raspberrypi.com>
Fri, 5 Mar 2021 15:40:45 +0000 (15:40 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:09 +0000 (11:33 +0000)
commit04c6a448fd4a6cc7b4475d1ae632e0d6465ac0b2
tree23fa305109d0d45b39e6ce4e7c8d17425957640a
parent0c5f5ab3c7f44462eabfebd1cd83a3e4b21e4349
media: bcm2835-unicam: Fix bug in buffer swapping logic

If multiple sets of interrupts occur simultaneously, it may be unsafe
to swap buffers, as the hardware may already be re-using the current
buffers. In such cases, avoid swapping buffers, and wait for the next
opportunity at the Frame End interrupt to signal completion.

Additionally, check the packet compare status when watching for frame
end for buffers swaps, as this could also signify a frame end event.

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