Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2.7] correct timeout of 1ms to k forever #64270

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Oct 23, 2023

Backport of #63958 to v2.7-branch

Fixes #63965
Fixes #64002

@cfriedt cfriedt requested review from henrikbrixandersen and a team October 23, 2023 16:42
@cfriedt cfriedt marked this pull request as draft October 23, 2023 16:43
@cfriedt cfriedt force-pushed the v2.7-correct-timeout-of--1ms-to-k-forever branch from fa36080 to 79a879e Compare October 23, 2023 16:44
Many releases ago, specifying to block indefinitely in the log
processing thread would do just that.

However, a subtle bug was introduced  such that specifying -1
for `CONFIG_LOG_BLOCK_IN_THREAD_TIMEOUT_MS` would have the
exact opposite effect than what was intended.

As per Kconfig, a value of -1 should translate to a timeout of
`K_FOREVER`. However, conversion via `K_MSEC(-1)` results in
a `k_timeout_t` that is equal to `K_NO_WAIT` rather than the
intent which is `K_FOREVER`.

Add a dedicated check to to ensure that a value of -1 is
correctly interpreted as `K_FOREVER` in `log_core.c`.

For reference, the blocking feature was described in zephyrproject-rtos#15196,
added in zephyrproject-rtos#16194, and it would appear that the regression
happened in c5f2cde.

Signed-off-by: Christopher Friedt <[email protected]>
(cherry picked from commit 137097f)
@cfriedt cfriedt force-pushed the v2.7-correct-timeout-of--1ms-to-k-forever branch from 79a879e to 10abbe5 Compare October 23, 2023 16:52
@cfriedt cfriedt marked this pull request as ready for review October 25, 2023 13:56
@cfriedt cfriedt merged commit 13072b4 into zephyrproject-rtos:v2.7-branch Oct 26, 2023
22 checks passed
@cfriedt cfriedt deleted the v2.7-correct-timeout-of--1ms-to-k-forever branch October 26, 2023 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants