fix:Unblock RPC/SDIO threads for graceful shutdown (EHM-194)#173
Open
Kevincoooool wants to merge 1 commit intoespressif:mainfrom
Open
fix:Unblock RPC/SDIO threads for graceful shutdown (EHM-194)#173Kevincoooool wants to merge 1 commit intoespressif:mainfrom
Kevincoooool wants to merge 1 commit intoespressif:mainfrom
Conversation
Unblock and allow orderly suspension of RPC and SDIO worker threads during deinit to avoid heap corruption and dangling waits. rpc_core: include FreeRTOS headers, post RPC/serial semaphores, call serial_post_read_semaphore and delay before cancelling threads so they can observe INACTIVE state. serial_drv: add serial_post_read_semaphore to wake the serial read semaphore. sdio_drv: add sdio_exit_requested flag, post SDIO-related semaphores on bus deinit, wait before cancelling threads, make tasks check the exit flag and call vTaskSuspend(NULL) instead of being abruptly deleted, use a timed wait for slave interrupt to allow periodic exit checks, reorder mempool/bus deinit and buffer free to avoid DMA writing to freed memory, and reset counters/flags on init/deinit. These changes make shutdowns safer and prevent buffer/heap races.
|
host_shuts_down_slave_to_power_save.zip |
Collaborator
|
Thanks a lot @Kevincoooool , for your contribution and time. We will have a review and merge the changes. @SohKamYung-Espressif Can you please review? Some generic comments:
|
Collaborator
|
Yes these would be really useful, for co-relating the case. thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Unblock and allow orderly suspension of RPC and SDIO worker threads during deinit to avoid heap corruption and dangling waits. rpc_core: include FreeRTOS headers, post RPC/serial semaphores, call serial_post_read_semaphore and delay before cancelling threads so they can observe INACTIVE state. serial_drv: add serial_post_read_semaphore to wake the serial read semaphore. sdio_drv: add sdio_exit_requested flag, post SDIO-related semaphores on bus deinit, wait before cancelling threads, make tasks check the exit flag and call vTaskSuspend(NULL) instead of being abruptly deleted, use a timed wait for slave interrupt to allow periodic exit checks, reorder mempool/bus deinit and buffer free to avoid DMA writing to freed memory, and reset counters/flags on init/deinit. These changes make shutdowns safer and prevent buffer/heap races.
Description
Related
Testing
Checklist
Before submitting a Pull Request, please ensure the following: