rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/8] rust: Add IO polling
@ 2024-10-16  3:52 FUJITA Tomonori
  2024-10-16  3:52 ` [PATCH net-next v3 1/8] rust: time: Add PartialEq/Eq/PartialOrd/Ord trait to Ktime FUJITA Tomonori
                   ` (8 more replies)
  0 siblings, 9 replies; 64+ messages in thread
From: FUJITA Tomonori @ 2024-10-16  3:52 UTC (permalink / raw)
  To: netdev
  Cc: rust-for-linux, andrew, hkallweit1, tmgross, ojeda, alex.gaynor,
	gary, bjorn3_gh, benno.lossin, a.hindborg, aliceryhl, anna-maria,
	frederic, tglx, arnd, jstultz, sboyd, linux-kernel

polls periodically until a condition is met or a timeout is reached.
By using the function, the 8th patch fixes QT2025 PHY driver to sleep
until the hardware becomes ready.

As a result of the past discussion, this introduces a new type
representing a span of time instead of using core::time::Duration or
time::Ktime.

Unlike the old rust branch, This adds a wrapper for fsleep() instead
of msleep(). fsleep() automatically chooses the best sleep method
based on a duration.

v3:
- Update time::Delta methods (use i64 for everything)
- Fix read_poll_timeout to show the proper debug info (file and line)
- Move fsleep to rust/kernel/time/delay.rs
- Round up delta for fsleep
- Access directly ktime_t instead of using ktime APIs
- Add Eq and Ord with PartialEq and PartialOrd
v2: https://lore.kernel.org/lkml/20241005122531.20298-1-fujita.tomonori@gmail.com/
- Introduce time::Delta instead of core::time::Duration
- Add some trait to Ktime for calculating timeout
- Use read_poll_timeout in QT2025 driver instead of using fsleep directly
v1: https://lore.kernel.org/netdev/20241001112512.4861-1-fujita.tomonori@gmail.com/

FUJITA Tomonori (8):
  rust: time: Add PartialEq/Eq/PartialOrd/Ord trait to Ktime
  rust: time: Introduce Delta type
  rust: time: Change output of Ktime's sub operation to Delta
  rust: time: Implement addition of Ktime and Delta
  rust: time: Add wrapper for fsleep function
  MAINTAINERS: rust: Add TIMEKEEPING and TIMER abstractions
  rust: Add read_poll_timeout functions
  net: phy: qt2025: Wait until PHY becomes ready

 MAINTAINERS               |  2 +
 drivers/net/phy/qt2025.rs | 10 +++-
 rust/helpers/helpers.c    |  2 +
 rust/helpers/kernel.c     | 13 +++++
 rust/helpers/time.c       |  8 ++++
 rust/kernel/error.rs      |  1 +
 rust/kernel/io.rs         |  5 ++
 rust/kernel/io/poll.rs    | 84 +++++++++++++++++++++++++++++++++
 rust/kernel/lib.rs        |  1 +
 rust/kernel/time.rs       | 99 ++++++++++++++++++++++++++++++++++++---
 rust/kernel/time/delay.rs | 31 ++++++++++++
 11 files changed, 249 insertions(+), 7 deletions(-)
 create mode 100644 rust/helpers/kernel.c
 create mode 100644 rust/helpers/time.c
 create mode 100644 rust/kernel/io.rs
 create mode 100644 rust/kernel/io/poll.rs
 create mode 100644 rust/kernel/time/delay.rs


base-commit: 068f3b34c5c2be5fe7923a9966c1c16f992a2f9c
-- 
2.43.0


^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2024-10-25 20:47 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-16  3:52 [PATCH net-next v3 0/8] rust: Add IO polling FUJITA Tomonori
2024-10-16  3:52 ` [PATCH net-next v3 1/8] rust: time: Add PartialEq/Eq/PartialOrd/Ord trait to Ktime FUJITA Tomonori
2024-10-16  8:22   ` Alice Ryhl
2024-10-16  3:52 ` [PATCH net-next v3 2/8] rust: time: Introduce Delta type FUJITA Tomonori
2024-10-16  8:23   ` Alice Ryhl
2024-10-17 11:15     ` FUJITA Tomonori
2024-10-17 10:17   ` Fiona Behrens
2024-10-17 11:24     ` FUJITA Tomonori
2024-10-18 13:49   ` Andrew Lunn
2024-10-18 14:31     ` Miguel Ojeda
2024-10-18 16:55       ` Andrew Lunn
2024-10-19 12:21         ` Miguel Ojeda
2024-10-19 12:41           ` Miguel Ojeda
2024-10-23 11:53             ` FUJITA Tomonori
2024-10-23 13:09               ` Miguel Ojeda
2024-10-19 18:41           ` Andrew Lunn
2024-10-20 13:05             ` Miguel Ojeda
2024-10-23 12:19               ` FUJITA Tomonori
2024-10-16  3:52 ` [PATCH net-next v3 3/8] rust: time: Change output of Ktime's sub operation to Delta FUJITA Tomonori
2024-10-16  8:25   ` Alice Ryhl
2024-10-16 19:47     ` Boqun Feng
2024-10-17  7:10     ` FUJITA Tomonori
2024-10-17  8:22       ` Alice Ryhl
2024-10-17 16:45       ` Miguel Ojeda
2024-10-23  1:58         ` FUJITA Tomonori
2024-10-16 20:03   ` Boqun Feng
2024-10-17  9:17     ` FUJITA Tomonori
2024-10-16  3:52 ` [PATCH net-next v3 4/8] rust: time: Implement addition of Ktime and Delta FUJITA Tomonori
2024-10-16  8:25   ` Alice Ryhl
2024-10-16 19:54   ` Boqun Feng
2024-10-17  9:31     ` FUJITA Tomonori
2024-10-17  9:33       ` Alice Ryhl
2024-10-17 16:33       ` Miguel Ojeda
2024-10-17 17:03         ` Boqun Feng
2024-10-17 18:10           ` Miguel Ojeda
2024-10-17 19:02             ` Boqun Feng
2024-10-17 18:58           ` Miguel Ojeda
2024-10-25 20:47             ` Boqun Feng
2024-10-23  6:51         ` FUJITA Tomonori
2024-10-23 10:59           ` Miguel Ojeda
2024-10-23 11:24             ` FUJITA Tomonori
2024-10-16  3:52 ` [PATCH net-next v3 5/8] rust: time: Add wrapper for fsleep function FUJITA Tomonori
2024-10-16  8:29   ` Alice Ryhl
2024-10-16  9:42     ` Miguel Ojeda
2024-10-24  0:22       ` FUJITA Tomonori
2024-10-24 17:26         ` Miguel Ojeda
2024-10-23 12:33     ` FUJITA Tomonori
2024-10-18 14:05   ` Andrew Lunn
2024-10-16  3:52 ` [PATCH net-next v3 6/8] MAINTAINERS: rust: Add TIMEKEEPING and TIMER abstractions FUJITA Tomonori
2024-10-16  3:52 ` [PATCH net-next v3 7/8] rust: Add read_poll_timeout functions FUJITA Tomonori
2024-10-16  8:37   ` Alice Ryhl
2024-10-18 14:16     ` FUJITA Tomonori
2024-10-16  8:45   ` Alice Ryhl
2024-10-16  8:52     ` Alice Ryhl
2024-10-16 11:05       ` Miguel Ojeda
2024-10-18  8:10       ` FUJITA Tomonori
2024-10-18  8:30         ` Alice Ryhl
2024-10-18 14:15           ` Andrew Lunn
2024-10-18 14:38             ` Miguel Ojeda
2024-10-18 14:21   ` Andrew Lunn
2024-10-16  3:52 ` [PATCH net-next v3 8/8] net: phy: qt2025: Wait until PHY becomes ready FUJITA Tomonori
2024-10-16 12:00   ` Alice Ryhl
2024-10-18 14:26 ` [PATCH net-next v3 0/8] rust: Add IO polling Andrew Lunn
2024-10-23  4:01   ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).