[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DE7WH5KQP268.1GXMZM78VIESE@kernel.org>
Date: Fri, 14 Nov 2025 08:55:07 +1100
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Alice Ryhl" <aliceryhl@...gle.com>
Cc: "Tejun Heo" <tj@...nel.org>, "Miguel Ojeda" <ojeda@...nel.org>, "Lai
Jiangshan" <jiangshanlai@...il.com>, "Boqun Feng" <boqun.feng@...il.com>,
"Gary Guo" <gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Andreas Hindborg" <a.hindborg@...nel.org>,
"Trevor Gross" <tmgross@...ch.edu>, "Daniel Almeida"
<daniel.almeida@...labora.com>, "John Hubbard" <jhubbard@...dia.com>,
"Philipp Stanner" <phasta@...nel.org>, "Tamir Duberstein"
<tamird@...il.com>, <rust-for-linux@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, "Benno Lossin" <lossin@...nel.org>
Subject: Re: [PATCH v2 2/2] rust: workqueue: add creation of workqueues
On Thu Nov 13, 2025 at 9:01 PM AEDT, Alice Ryhl wrote:
> Creating workqueues is needed by various GPU drivers.
Indeed, and of course lots of other drivers need this as well. :)
> Not only does it give you better control over execution, it also allows
> devices to ensure that all tasks have exited before the device is unbound (or
> similar) by running the workqueue destructor.
Exactly, but for this case we should fence the workqueue with devres, such that
we can guarantee a scope for a &Device<Bound> for all work items scheduled on
such a workqueue, i.e. provide a &Device<Bound> in run().
Otherwise drivers have to either access device resources with try_access() or
get themselves a &Device<Bound> with the unsafe Device::as_bound() method from
within the run() callback.
Powered by blists - more mailing lists