cam_hal/ll_cam: avoid ISR queue use-after-free; fully quiesce DMA on stop #784
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR requires the following PRs to be merged first, and thus contains their commits:
fix jpeg soi check for psram_mode (DMA) #776fix jpeg eoi check for psram_mode (DMA) #777cam_hal: drop caches for psram_mode frames before hand-off to application #778rework psram_mode frame buffer overflow check #781cam_hal: psram: reset DMA and yield after NO-EOI to resume capture #783Description
In PSRAM DMA mode the driver could dereference a deleted event queue and
leave EOF interrupts armed after shutdown, leading to late ISRs and NPDs.
Changes:
woken
and propagate to caller viahp
when non-NULL.event_queue and frame_buffer_queue after vQueueDelete().
full W1C mask; stop CAM_START and halt link.
hp
variable and portYIELD_FROM_ISR() if set.BaseType_t *hp
.Result: no null-pointer derefs or late interrupts after teardown; ISR
wakeups propagate correctly and the DMA path restarts cleanly.
Testing
Does fix some crashes, but not everything in
psram_mode
with JPEGs.Checklist
Before submitting a Pull Request, please ensure the following: