]> granicus.if.org Git - esp-idf/commit
spi_flash: fix race condition in s_flash_op_complete access
authorIvan Grokhotkov <ivan@espressif.com>
Mon, 27 Mar 2017 17:02:58 +0000 (01:02 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Mon, 27 Mar 2017 17:34:17 +0000 (01:34 +0800)
commit92436021ab0eb2d7eb271f4bfe9f2500b8a10011
tree65fd62177db1d1fd282e832df1082f079e709571
parentcecdfdb0c01333c2b3e172da5c56a0828b4dc488
spi_flash: fix race condition in s_flash_op_complete access

Flash operation complete flag was cleared by the core initiating flash
operation. If the other core was running an ISR, then IPC task could
be late to enter the loop to check s_flash_op_complete by the time next
flash operation started. If the flag is cleared on the CPU waiting on
this flag, then the race condition can not happen.
components/spi_flash/cache_utils.c
components/spi_flash/test/test_spi_flash.c