mbox series

[net-next,v1,0/2] add delay abstraction (sleep functions)

Message ID 20241001112512.4861-1-fujita.tomonori@gmail.com (mailing list archive)
Headers show
Series add delay abstraction (sleep functions) | expand

Message

FUJITA Tomonori Oct. 1, 2024, 11:25 a.m. UTC
Add an abstraction for sleep functions in `include/linux/delay.h` for
dealing with hardware delays. `delay.h` supports sleep and delay (busy
wait). This adds support for sleep functions used by QT2025 PHY driver
to sleep until a PHY becomes ready.

The old rust branch has the delay abstraction which supports msleep()
with a helper function which rounds a `Duration` up to the nearest
milliseconds.

This adds fsleep() support instead of msleep(). fsleep() can handle
various lengths of delay by internally calling an appropriate sleep
function including msleep().


FUJITA Tomonori (2):
  rust: add delay abstraction
  net: phy: qt2025: wait until PHY becomes ready

 drivers/net/phy/qt2025.rs       | 11 +++++++++--
 rust/bindings/bindings_helper.h |  1 +
 rust/helpers/delay.c            |  8 ++++++++
 rust/helpers/helpers.c          |  1 +
 rust/kernel/delay.rs            | 18 ++++++++++++++++++
 rust/kernel/lib.rs              |  1 +
 6 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 rust/helpers/delay.c
 create mode 100644 rust/kernel/delay.rs


base-commit: c824deb1a89755f70156b5cdaf569fca80698719

Comments

Alice Ryhl Oct. 1, 2024, 11:39 a.m. UTC | #1
On Tue, Oct 1, 2024 at 1:27 PM FUJITA Tomonori
<fujita.tomonori@gmail.com> wrote:
>
> Add an abstraction for sleep functions in `include/linux/delay.h` for
> dealing with hardware delays. `delay.h` supports sleep and delay (busy
> wait). This adds support for sleep functions used by QT2025 PHY driver
> to sleep until a PHY becomes ready.
>
> The old rust branch has the delay abstraction which supports msleep()
> with a helper function which rounds a `Duration` up to the nearest
> milliseconds.
>
> This adds fsleep() support instead of msleep(). fsleep() can handle
> various lengths of delay by internally calling an appropriate sleep
> function including msleep().

Add time keeping maintainers to CC.