All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Hindborg <a.hindborg@kernel.org>
To: "Danilo Krummrich" <dakr@kernel.org>
Cc: "Alexandre Courbot" <acourbot@nvidia.com>,
	 "Stephen Rothwell" <sfr@canb.auug.org.au>,
	 "FUJITA Tomonori" <fujita.tomonori@gmail.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	 "Linux Next Mailing List" <linux-next@vger.kernel.org>
Subject: Re: linux-next: manual merge of the rust-timekeeping tree with the drm-nova tree
Date: Tue, 24 Jun 2025 21:02:43 +0200	[thread overview]
Message-ID: <87ikkl2ca4.fsf@kernel.org> (raw)
In-Reply-To: <aFqXKKAxQp0yxUvL@pollux> (Danilo Krummrich's message of "Tue, 24 Jun 2025 14:16:40 +0200")

"Danilo Krummrich" <dakr@kernel.org> writes:

> On Tue, Jun 24, 2025 at 09:03:48PM +0900, Alexandre Courbot wrote:
>> On Tue Jun 24, 2025 at 8:48 PM JST, Andreas Hindborg wrote:
>> > For the Nova people: You might consider if it makes sense to take a
>> > `kernel::time::Delta<C>` for the timeout.
>>
>> It probably does now that it is available. I'm willing to do it this
>> cycle if we can find a way to not break the build. Should we have a tag
>> to merge into nova-next or something?
>
> I'm not sure about the generic in Delta mentioned by Andreas above, but the
> Detla type did land in the last merge window, so it's available in the nova
> tree already.

Sorry, that is my mistake. `Delta` does not take any generics, I was
thinking of `Instant`, it takes the clock.

Anyway, I dropped the patch renaming `as_*` [1], so now the resolution would
be:

diff --git a/drivers/gpu/nova-core/util.rs b/drivers/gpu/nova-core/util.rs
index 5cafe0797cd6..01a920085438 100644
--- a/drivers/gpu/nova-core/util.rs
+++ b/drivers/gpu/nova-core/util.rs
@@ -3,7 +3,7 @@
 use core::time::Duration;
 
 use kernel::prelude::*;
-use kernel::time::Instant;
+use kernel::time::{Instant, Monotonic};
 
 pub(crate) const fn to_lowercase_bytes<const N: usize>(s: &str) -> [u8; N] {
     let src = s.as_bytes();
@@ -35,7 +35,7 @@ pub(crate) const fn const_bytes_to_str(bytes: &[u8]) -> &str {
 /// TODO[DLAY]: replace with `read_poll_timeout` once it is available.
 /// (https://lore.kernel.org/lkml/20250220070611.214262-8-fujita.tomonori@gmail.com/)
 pub(crate) fn wait_on<R, F: Fn() -> Option<R>>(timeout: Duration, cond: F) -> Result<R> {
-    let start_time = Instant::now();
+    let start_time = Instant::<Monotonic>::now();
 
     loop {
         if let Some(ret) = cond() {


Best regards,
Andreas Hindborg


[1] https://lore.kernel.org/all/87wm912sjg.fsf@kernel.org


  reply	other threads:[~2025-06-24 19:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <iuo4BpdTglZkpW9Xyy1ehjFspmj3ay0q7iejyeOShBG0HLZmIrhzIpi0eG_wBv71ZPPCgh2lcn2BOsrFHOegfg==@protonmail.internalid>
2025-06-24  9:51 ` linux-next: manual merge of the rust-timekeeping tree with the drm-nova tree Stephen Rothwell
2025-06-24 11:48   ` Andreas Hindborg
2025-06-24 12:03     ` Alexandre Courbot
2025-06-24 12:16       ` Danilo Krummrich
2025-06-24 19:02         ` Andreas Hindborg [this message]
2025-06-25  6:13           ` Stephen Rothwell
2025-06-26  7:05             ` Stephen Rothwell
2025-08-01  7:18   ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ikkl2ca4.fsf@kernel.org \
    --to=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.