zephyr/lib
Yong Cong Sin 1a578eb72c lib: os: mpsc_pbuf: do not wait when spinlock is held
Check if the spinlock is held before attempting to wait by
taking the semaphore, as that would cause a context switch which
isn't allowed and will trigger an assertion error when
`CONFIG_SPIN_VALIDATE` is enabled.

Logging in spinlock-held context when the log buffer is full can lead
to an infinite assertion error loop, as the logging subsys attempts to
allocate buffer when there's none available, it will try to wait for
one and thus triggers the assertion error, the error message will be
printed through the logging sybsys but there's no buffer available,
so it will try to wait for one and triggers another assertion error..
This loop just goes on and on forever, and nothing gets printed to
the terminal.

Added a test to validate the fix.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Signed-off-by: Maxim Adelman <imax@meta.com>
2025-01-06 06:53:52 +01:00
..
acpi lib: acpi: update shell and test app with the modifed resource struct 2024-02-15 12:28:55 +01:00
cpp cmake: set minimal C++ linker properties in minimal C++ CMake impl 2024-11-16 15:28:20 -05:00
crc lib: crc: add crc8_rohc for CRC-8/ROHC variant calculation 2024-10-09 09:48:00 +02:00
hash
heap multi_heap: introduce support for realloc() 2024-11-16 14:02:07 -05:00
libc newlib: correct signature of _open() for xtensa 2025-01-05 09:56:54 +01:00
mem_blocks
net_buf net: buf: increase log level of timeout ignore 2024-10-10 14:59:16 -04:00
open-amp openamp: resource table: fixes resource table for ram_console section 2024-11-08 15:55:11 -06:00
os lib: os: mpsc_pbuf: do not wait when spinlock is held 2025-01-06 06:53:52 +01:00
posix posix: options: remove default setting of toolchain option 2025-01-04 00:49:03 +01:00
runtime
smf lib: smf: use while (true) in get_child_of for better clarity 2024-07-01 16:08:05 -04:00
utils json: support parsing and serializing 'uint64_t' 2024-10-05 14:04:48 -04:00
CMakeLists.txt lib: net_buf: move the network buffer implementation to lib 2024-09-07 11:19:05 -05:00
Kconfig lib: net_buf: move the network buffer implementation to lib 2024-09-07 11:19:05 -05:00