[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251021071146.2357069-1-fujita.tomonori@gmail.com>
Date: Tue, 21 Oct 2025 16:11:44 +0900
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: dakr@...nel.org,
aliceryhl@...gle.com,
daniel.almeida@...labora.com,
a.hindborg@...nel.org,
alex.gaynor@...il.com,
ojeda@...nel.org
Cc: anna-maria@...utronix.de,
bjorn3_gh@...tonmail.com,
boqun.feng@...il.com,
frederic@...nel.org,
gary@...yguo.net,
jstultz@...gle.com,
linux-kernel@...r.kernel.org,
lossin@...nel.org,
lyude@...hat.com,
rust-for-linux@...r.kernel.org,
sboyd@...nel.org,
tglx@...utronix.de,
tmgross@...ch.edu
Subject: [PATCH v2 0/2] Add read_poll_count_atomic support
Add read_poll_count_atomic function which polls periodically until a
condition is met, an error occurs, or the attempt limit is reached.
This helper is used to wait for a condition in atomic context,
mirroring the C's read_poll_timeout_atomic().
In atomic context, the timekeeping infrastructure is unavailable, so
reliable time-based timeouts cannot be implemented. So instead, the
helper accepts a maximum number of attempts and busy-waits (udelay +
cpu_relax) between tries.
v1: https://lore.kernel.org/lkml/20250821035710.3692455-1-fujita.tomonori@gmail.com/
- use the attempt limit instead of timeout
- rename the function to read_poll_count_atomic
- add the comment about C's udelay behavior.
FUJITA Tomonori (2):
rust: add udelay() function
rust: Add read_poll_count_atomic function
rust/helpers/time.c | 5 +++
rust/kernel/io/poll.rs | 80 ++++++++++++++++++++++++++++++++++++++-
rust/kernel/time/delay.rs | 37 ++++++++++++++++++
3 files changed, 121 insertions(+), 1 deletion(-)
base-commit: e6901808a3b28d8bdabfa98a618b2eab6f8798e8
--
2.43.0
Powered by blists - more mailing lists