Re: [PATCH v2 2/2] iopoll: Do not use timekeeping in read_poll_timeout_atomic()

From: Tony Lindgren
Date: Thu May 11 2023 - 02:48:11 EST


Hi,

* Geert Uytterhoeven <geert+renesas@xxxxxxxxx> [230510 13:23]:
> read_poll_timeout_atomic() uses ktime_get() to implement the timeout
> feature, just like its non-atomic counterpart. However, there are
> several issues with this, due to its use in atomic contexts:
>
> 1. When called in the s2ram path (as typically done by clock or PM
> domain drivers), timekeeping may be suspended, triggering the
> WARN_ON(timekeeping_suspended) in ktime_get():

Maybe add a comment to read_poll_timeout_atomic() saying it can be
used also with timekeeping_suspended?

Otherwise a few years later it might get broken when somebody goes
to patch it without testing it with timekeeping_suspended :)

Other than that looks good to me:

Reviewed-by: Tony Lindgren <tony@xxxxxxxxxxx>