All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "David Airlie" <airlied@redhat.com>
Cc: "Dave Airlie via B4 Relay"
	<devnull+airlied.redhat.com@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"FUJITA Tomonori" <fujita.tomonori@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	<nova-gpu@lists.linux.dev>, <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v4 2/2] gpu: nova-core: add support for GPU timer block. (v4)
Date: Sun, 08 Nov 2026 22:51:31 +0900	[thread overview]
Message-ID: <DMPVN025DBS8.1HVI0U45RAS5J@nvidia.com> (raw)
In-Reply-To: <DMO7FUYY05LK.123ZPLIW24C2S@nvidia.com>

On Fri Nov 6, 2026 at 11:41 PM JST, Alexandre Courbot wrote:
<...>
>> nsec_lo/hi are now used in the register from_nsec for both tu102 and
>> gh100 registers.
>>
>>> I'd ignore Sashiko's suggestion as it looks like it is trying to
>>> reconcile the code against the comment instead of the other way around.
>>
>> I just fixed things to truncate and used wrapping_sub, to be honest
>> being careful here is probably the wrong answer, my local review bot
>> pointed out some wierdness can occur in 2043 with the current scheme,
>> so let's just keep it simple, wrapping subtract, and feed the result
>> to the hardware which is what the other driver does and what nouveau
>> did.
>
> The other drivers do what they do, but here again do we understand what
> happens when we write a wrapped value into the timer registers?

I checked what OpenRM does and it doesn't appear to wrap. Actually
`tmrSetCurrentTime_GH100` has the following line:

    NV_ASSERT_OR_RETURN(secTimerNs < osTimeNs, NV_ERR_INVALID_STATE);

meaning it expects the OS/GPU time delta to be positive. The error it
returns in that case is ignored by the caller, so nothing gets
programmed. In the absence of a better alternative I guess we should do
the same thing, i.e. the `checked_sub` and return early (but the
returned error should be just logged and ignored).

Nouveau AFAICT does not write `NV_PGC6_SCI_SYS_TIMER_OFFSET_*` at all.

      reply	other threads:[~2026-11-08 13:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  3:07 [PATCH v4 0/2] nova-core: add initial support for gpu timer (v4) Dave Airlie
2026-11-05  3:07 ` Dave Airlie via B4 Relay
2026-11-05  3:07 ` [PATCH v4 1/2] rust: time: expose as_nanos for clock sources Dave Airlie
2026-11-05  3:07   ` Dave Airlie via B4 Relay
2026-11-05 14:21   ` Alexandre Courbot
2026-11-05  3:07 ` [PATCH v4 2/2] gpu: nova-core: add support for GPU timer block. (v4) Dave Airlie
2026-11-05  3:07   ` Dave Airlie via B4 Relay
2026-11-05  3:21   ` sashiko-bot
2026-11-05 14:43   ` Alexandre Courbot
2026-11-06  5:31     ` David Airlie
2026-11-06 14:41       ` Alexandre Courbot
2026-11-08 13:51         ` Alexandre Courbot [this message]

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=DMPVN025DBS8.1HVI0U45RAS5J@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=airlied@redhat.com \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=devnull+airlied.redhat.com@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=nova-gpu@lists.linux.dev \
    /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.