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

i.MX timers can't handle timeouts in the past or too far into the future #21

Open
philipderrin opened this issue Feb 4, 2019 · 0 comments

Comments

@philipderrin
Copy link

The i.MX timer's set_timeout function converts absolute times to relative without checking that the time is in the future. This leads to an attempt to set a very large relative timeout instead of returning ETIME.

if (type == TIMEOUT_ABSOLUTE) {

Also, non-periodic relative timeouts that are too far into the future for a 32-bit timer should saturate to 0xffffffff so that the timeout is received early, rather than returning EINVAL.

The omap version of set_timeout handles both of these cases; I think the code can simply be copied from there.

static int set_timeout(void *data, uint64_t ns, timeout_type_t type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant