jlaitine opened a new pull request, #15083: URL: https://github.com/apache/nuttx/pull/15083
… race condition There is a race condition when timeout and completion interrupts occur at the same time. Fix this and simplify the eventwait code. ## Summary This fixes a rare race condition in imx9 sd card driver, found in tests with sdbench and sdstress with a slow memory card. If a timeout occurs at the same time when request gets completed, there is double-posting of the completion semaphore, which is not correctly handled. The issue is managed with more careful management of interrupt enablement / disablement, and resetting the semaphore in case of timeout occured (in which case we don't know for sure if the semaphore has also been posted by an interrupt). This also cleans up the imx9_eventtimeout function code, by removing the useless for loop. Also fixed some other minor style issues. ## Impact This fixes sd-card usage in a rare corner case where the sd-card operations slow down due to slow card or some internal housekeeping. ## Testing Tested with one custom imx93 board, using sdbench, and "sdstress -r 4000 -b 10000 -f 300" over weekend. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org