[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z5IYKJXuk1vcs4Xo@pollux.localdomain>
Date: Thu, 23 Jan 2025 11:21:28 +0100
From: Danilo Krummrich <dakr@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Lyude Paul <lyude@...hat.com>, 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 Thu, Jan 23, 2025 at 07:23:08AM +0100, Greg Kroah-Hartman wrote:
> On Wed, Jan 22, 2025 at 06:49:22PM -0500, Lyude Paul wrote:
> > A number of kernel modules work with virtual devices, where being virtual
> > implies that there's no physical device to actually be plugged into the
> > system. Because of that, such modules need to be able to manually
> > instantiate a kernel device themselves - which can then be probed in the
> > same manner as any other kernel device.
> >
> > This adds support for such a usecase by introducing another platform device
> > type, ModuleDevice. This type is interchangeable with normal platform
> > devices, with the one exception being that it controls the lifetime of the
> > registration of the device.
>
> Sorry, but a "virtual" device is NOT a platform device at all. Platform
> devices are things that are not on a real bus and are described by
> firmware somehow.
>
> The kernel has "virtual" devices today just fine, look at
> /sys/devices/virtual/ so why not just use that api instead of making up
> something new?
I think we briefly discussed this in another mail thread [1] for the example of
the vKMS driver [2] in the past.
In [1] you mentioned that with the virtual device API, things are a bit
inconvenient and that you want to follow up on this.
I can't speak for Lyude, but I assume that she would also be willing to help
out getting to a better solution than what drivers like vKMS currently do and
then have a Rust abstraction for that, but your previous reply didn't indicate
there's already one ready to grab.
[1] https://lore.kernel.org/lkml/2024071106-handed-oversleep-2377@gregkh/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/vkms/vkms_drv.c
Powered by blists - more mailing lists