Subject: Re: [PATCH v11 5/8] rust: time: Add wrapper for fsleep() function

From: Andreas Hindborg <[email-masked]>
Date: Sat, 22 Mar 2025 15:10:17 +0100

FUJITA Tomonori <[email-masked]> writes:

> Add a wrapper for fsleep(), flexible sleep functions in
> include/linux/delay.h which typically deals with hardware delays.
>
> The kernel supports several sleep functions to handle various lengths
> of delay. This adds fsleep(), automatically chooses the best sleep
> method based on a duration.
>
> sleep functions including fsleep() belongs to TIMERS, not
> TIMEKEEPING. They are maintained separately. rust/kernel/time.rs is an
> abstraction for TIMEKEEPING. To make Rust abstractions match the C
> side, add rust/kernel/time/delay.rs for this wrapper.
>
> fsleep() can only be used in a nonatomic context. This requirement is
> not checked by these abstractions, but it is intended that klint [1]
> or a similar tool will be used to check it in the future.
>
> Link: https://rust-for-linux.com/klint [1]
> Tested-by: Daniel Almeida <[email-masked]>
> Reviewed-by: Gary Guo <[email-masked]>
> Reviewed-by: Alice Ryhl <[email-masked]>
> Reviewed-by: Fiona Behrens <[email-masked]>
> Signed-off-by: FUJITA Tomonori <[email-masked]>

Reviewed-by: Andreas Hindborg <[email-masked]>

Best regards,
Andreas Hindborg