Skip to content

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

Open
@philipderrin

Description

@philipderrin

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions