All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eliot Courtney" <ecourtney@nvidia.com>
To: "Gary Guo" <gary@garyguo.net>,
	"Eliot Courtney" <ecourtney@nvidia.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>
Cc: Zhi Wang <zhiw@nvidia.com>, Alistair Popple <apopple@nvidia.com>,
	Joel Fernandes <joelagnelf@nvidia.com>,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v4 2/9] gpu: nova-core: gsp: add mechanism to wait for space on command queue
Date: Tue, 03 Mar 2026 12:07:52 +0900	[thread overview]
Message-ID: <DGSTDZOHHCML.2B2UJOY4LLRR2@nvidia.com> (raw)
In-Reply-To: <DGSD13LEUEZK.DXHNXLIRVY24@garyguo.net>

On Mon Mar 2, 2026 at 11:18 PM JST, Gary Guo wrote:
> On Mon Mar 2, 2026 at 11:42 AM GMT, Eliot Courtney wrote:
>> Add a timeout to `allocate_command` which waits for space on the GSP
>> command queue. It uses a similar timeout to nouveau.
>>
>> This lets `send_command` wait for space to free up in the command queue.
>> This is required to support continuation records which can fill up the
>> queue.
>
> Any reason that this isn't implemented as a `poll_allocate_command` which just
> returns a `EAGAIN`, and then a wrapper function that just waits for space to be
> ready when it got one? This way the logic is cleaner.

This kind of structure is what I originally did (see 
https://lore.kernel.org/all/DGHRDFE9M6P7.L7JEOCLL3VS9@nvidia.com/)
although it wasn't quite as nice since `allocate_command` takes
&mut self and isn't callable from `read_poll_timeout`. Alex suggested
merging these into one as it simplifies a few things. But maybe I am
missing some better way to do it.

WARNING: multiple messages have this Message-ID (diff)
From: "Eliot Courtney" <ecourtney@nvidia.com>
To: "Gary Guo" <gary@garyguo.net>,
	"Eliot Courtney" <ecourtney@nvidia.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>
Cc: "Zhi Wang" <zhiw@nvidia.com>,
	"Alistair Popple" <apopple@nvidia.com>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	<nouveau@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH v4 2/9] gpu: nova-core: gsp: add mechanism to wait for space on command queue
Date: Tue, 03 Mar 2026 12:07:52 +0900	[thread overview]
Message-ID: <DGSTDZOHHCML.2B2UJOY4LLRR2@nvidia.com> (raw)
In-Reply-To: <DGSD13LEUEZK.DXHNXLIRVY24@garyguo.net>

On Mon Mar 2, 2026 at 11:18 PM JST, Gary Guo wrote:
> On Mon Mar 2, 2026 at 11:42 AM GMT, Eliot Courtney wrote:
>> Add a timeout to `allocate_command` which waits for space on the GSP
>> command queue. It uses a similar timeout to nouveau.
>>
>> This lets `send_command` wait for space to free up in the command queue.
>> This is required to support continuation records which can fill up the
>> queue.
>
> Any reason that this isn't implemented as a `poll_allocate_command` which just
> returns a `EAGAIN`, and then a wrapper function that just waits for space to be
> ready when it got one? This way the logic is cleaner.

This kind of structure is what I originally did (see 
https://lore.kernel.org/all/DGHRDFE9M6P7.L7JEOCLL3VS9@nvidia.com/)
although it wasn't quite as nice since `allocate_command` takes
&mut self and isn't callable from `read_poll_timeout`. Alex suggested
merging these into one as it simplifies a few things. But maybe I am
missing some better way to do it.

  reply	other threads:[~2026-03-03  3:08 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 11:42 [PATCH v4 0/9] gpu: nova-core: gsp: add continuation record support Eliot Courtney
2026-03-02 11:42 ` Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 1/9] gpu: nova-core: gsp: sort MsgFunction variants alphabetically Eliot Courtney
2026-03-02 11:42   ` Eliot Courtney
2026-03-02 13:47   ` Gary Guo
2026-03-02 13:47     ` Gary Guo
2026-03-02 14:49     ` Alexandre Courbot
2026-03-02 14:49       ` Alexandre Courbot
2026-03-02 11:42 ` [PATCH v4 2/9] gpu: nova-core: gsp: add mechanism to wait for space on command queue Eliot Courtney
2026-03-02 11:42   ` Eliot Courtney
2026-03-02 14:18   ` Gary Guo
2026-03-02 14:18     ` Gary Guo
2026-03-03  3:07     ` Eliot Courtney [this message]
2026-03-03  3:07       ` Eliot Courtney
2026-03-03  7:48       ` Alexandre Courbot
2026-03-03  7:48         ` Alexandre Courbot
2026-03-02 11:42 ` [PATCH v4 3/9] rust: add EMSGSIZE error code Eliot Courtney
2026-03-02 11:42   ` Eliot Courtney
2026-03-02 14:19   ` Gary Guo
2026-03-02 14:19     ` Gary Guo
2026-03-02 11:42 ` [PATCH v4 4/9] gpu: nova-core: gsp: add checking oversized commands Eliot Courtney
2026-03-02 11:42   ` Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 5/9] gpu: nova-core: gsp: clarify invariant on command queue Eliot Courtney
2026-03-02 11:42   ` Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 6/9] gpu: nova-core: gsp: unconditionally call variable payload handling Eliot Courtney
2026-03-02 11:42   ` Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 7/9] gpu: nova-core: gsp: add command_size helper Eliot Courtney
2026-03-02 11:42   ` Eliot Courtney
2026-03-02 14:22   ` Gary Guo
2026-03-02 14:22     ` Gary Guo
2026-03-03  3:12     ` Eliot Courtney
2026-03-03  3:12       ` Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 8/9] gpu: nova-core: gsp: support large RPCs via continuation record Eliot Courtney
2026-03-02 11:42   ` Eliot Courtney
2026-03-02 13:06   ` Alexandre Courbot
2026-03-02 13:06     ` Alexandre Courbot
2026-03-03  4:27     ` Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 9/9] gpu: nova-core: gsp: add tests for continuation records Eliot Courtney
2026-03-02 11:42   ` Eliot Courtney

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=DGSTDZOHHCML.2B2UJOY4LLRR2@nvidia.com \
    --to=ecourtney@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tmgross@umich.edu \
    --cc=zhiw@nvidia.com \
    /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.