]> granicus.if.org Git - esp-idf/commit
Merge branch 'bugfix/flash_op_deadlock' into 'master'
authorIvan Grokhotkov <ivan@espressif.com>
Fri, 31 Mar 2017 08:02:26 +0000 (16:02 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Fri, 31 Mar 2017 08:02:26 +0000 (16:02 +0800)
commit47b8f78cb0e15fa43647788a808dac353167a485
tree1f5bb7f837e50004a894aa160933adfd0a78a12e
parenta4acf7b67b876bd0b24ce6144971208a8ed8d0a9
parent92436021ab0eb2d7eb271f4bfe9f2500b8a10011
Merge branch 'bugfix/flash_op_deadlock' into 'master'

spi_flash: fix race condition in s_flash_op_complete access

Flash operation complete flag was cleared by the CPU 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. This would cause a deadlock, as the IPC task would still be waiting for `s_flash_op_complete` to be set (which was already cleared by the next flash operation), while the flash operation task would be blocked waiting for IPC task to set `s_flash_op_can_start`.

If the flag is cleared on the CPU waiting on this flag, then the race condition can not happen.

See merge request !615