mirror of https://github.com/thesofproject/sof.git
52b33a23b8
Align the SOF spinlock API with Zephyr spinlock API. Currently SOF spinlock has two locking variants: with and without disabling local IRQs. Since taking a spinlock potentially puts the CPU into busy-looping, periods of time for holding spinlocks should be kept as short as possible. This also means, that usually the CPU, holding a spinlock shouldn't be interrupted. So usually spinlocks should be taken in atomic contexts. Therefore using the version, not locking local IRQs should only be done when IRQs are already disabled. This then saves several CPU cycles, avoiding reading and writing CPU status again. However, this should be only done with extreme care and it introduces potential for current and future bugs, including dead-locks. Zephyr spinlock API always disables local IRQs. This makes it simpler and less error prone. Switching to it potentially wastes several CPU cycles in some locations, but makes the code more robust. This is first part of work for spinlock Zephyr alignment, subsequent updates will align headers and associated splinlock dependecies. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> |
||
---|---|---|
.. | ||
cmocka | ||
CMakeLists.txt | ||
test-all-defconfigs.sh |