[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z5z9LPzNuF2IdPGa@phenom.ffwll.local>
Date: Fri, 31 Jan 2025 17:41:16 +0100
From: Simona Vetter <simona.vetter@...ll.ch>
To: Danilo Krummrich <dakr@...nel.org>
Cc: Lyude Paul <lyude@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
Maíra Canal <mairacanal@...eup.net>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>
Subject: Re: [PATCH 2/2] rust/kernel: Add platform::ModuleDevice
On Fri, Jan 24, 2025 at 12:02:38PM +0100, Danilo Krummrich wrote:
> On Thu, Jan 23, 2025 at 07:33:28PM -0500, Lyude Paul wrote:
> > On Thu, 2025-01-23 at 07:23 +0100, Greg Kroah-Hartman wrote:
> > > On Wed, Jan 22, 2025 at 06:49:22PM -0500, Lyude Paul wrote:
> > >
> > > And modules are code, not data. Let's not start to even attempt to tie
> > > lifetimes of device structures to module code, that way lies madness and
> > > rolls back the work we did decades ago to split the two apart :)
> >
> > To make sure I'm understanding you properly, by "are code not data" you're
> > suggesting that resources (devices, driver registrations, etc.) should have
> > their lifetime entirely managed by the kernel and not as part of the module
> > data structure correct?
>
> I think that's two different things.
>
> Driver registrations are bound to the module lifetime and in Rust, where we have
> a structure that represents the module lifetime, driver registrations are part
> of the module structure. That's fine.
>
> Device are more of a concern here, since they ideally orginate from real
> hardware and hence shouldn't be bound to a module lifetime.
>
> I think a virtual device would need to be an exception though. What else, if not
> the module should define its lifetime?
Yeah for virtual devices this should be possible I think. We do have plans
for vkms to gain configfs support, and then maybe the current device
wouldn't be needed anymore and we'd just register the configfs when
loading the module.
-Sima
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Powered by blists - more mailing lists