Skip to content

legacy timeout ticks mishandled #30860

@pabigot

Description

@pabigot

This provides an issue backing #30842 which by inspection is correct and appears to be high priority. With legacy timeouts Z_TIMEOUT_TICKS converts the tick count to a timeout which is expressed in milliseconds, not ticks.

Ticks should be assigned directly to timeout value in case of
CONFIG_LEGACY_TIMEOUT_API=y, just as they were before referenced patch.

Fixes: 7a815d5 ("kernel: sched: Use k_ticks_t in z_tick_sleep")

Tested with:

	LOG_INF("uptime: %d", (int) k_uptime_get());
	k_sleep(K_SECONDS(1));
	LOG_INF("uptime: %d", (int) k_uptime_get());

in ztest framework.

Before this PR:

I: uptime: 2070400
I: uptime: 2080500

after:

I: uptime: 207040
I: uptime: 208050

Metadata

Metadata

Labels

bugThe issue is a bug, or the PR is fixing a bugpriority: highHigh impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions