[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFZN7C8P37RK.3IF24Z1YUVVOX@kernel.org>
Date: Tue, 27 Jan 2026 21:09:45 +0100
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Zhi Wang" <zhiw@...dia.com>
Cc: "Jason Gunthorpe" <jgg@...dia.com>, <rust-for-linux@...r.kernel.org>,
<linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<aliceryhl@...gle.com>, <bhelgaas@...gle.com>, <kwilczynski@...nel.org>,
<ojeda@...nel.org>, <alex.gaynor@...il.com>, <boqun.feng@...il.com>,
<gary@...yguo.net>, <bjorn3_gh@...tonmail.com>, <lossin@...nel.org>,
<a.hindborg@...nel.org>, <tmgross@...ch.edu>, <markus.probst@...teo.de>,
<helgaas@...nel.org>, <cjia@...dia.com>, <smitra@...dia.com>,
<ankita@...dia.com>, <aniketa@...dia.com>, <kwankhede@...dia.com>,
<targupta@...dia.com>, <acourbot@...dia.com>, <joelagnelf@...dia.com>,
<jhubbard@...dia.com>, <zhiwang@...nel.org>, <daniel.almeida@...labora.com>
Subject: Re: [PATCH v2 1/2] rust: introduce abstractions for fwctl
On Tue Jan 27, 2026 at 8:57 PM CET, Zhi Wang wrote:
> On Mon, 26 Jan 2026 14:19:12 -0400
> Jason Gunthorpe <jgg@...dia.com> wrote:
>> fwctl_unregister is not safe from any context, it must be called
>> while the Device is still bound.
>>
>
> The registration is wrapped in Devres<> in the sample driver, which
> guarantees that drop is called while the Device is still bound.
>
> I agree that the current abstraction itself does not strictly enforce this
> (e.g., if the object is moved out of Devres). I will investigate an
> approach to enforce this requirement in the next re-spin.
The code is fine, the Registration object can't be moved out of devres safely.
You just need to update the safety comment accordingly. :)
Powered by blists - more mailing lists