[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025092310-amiable-overflow-1614@gregkh>
Date: Tue, 23 Sep 2025 14:31:35 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Daniel Almeida <daniel.almeida@...labora.com>,
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 <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH 0/2] rust: usb: add initial USB abstractions
On Tue, Sep 23, 2025 at 02:29:00PM +0200, Alice Ryhl wrote:
> On Tue, Sep 23, 2025 at 2:05 PM Greg Kroah-Hartman
> <gregkh@...uxfoundation.org> wrote:
> >
> > On Mon, Aug 25, 2025 at 03:18:04PM -0300, Daniel Almeida wrote:
> > > This adds initial support for USB Rust drivers, not only because I see a
> > > widespread use of module_usb_driver() in media (which is a subsystem I
> > > aim to support) but also because I want to learn about USB in general
> > > and this is a nice opportunity to start doing so.
> > >
> > > I tried to keep things as consistent with pci.rs and platform.rs as
> > > possible and tested it by manually binding a device (i.e.: my Logitech
> > > mouse) to the sample driver via:
> > >
> > > /sys/bus/usb/drivers/rust_driver_usb/new_id
> > >
> > > This initial patch is therefore comprised of the same patterns that are
> > > known to work for pci and platform already.
> > >
> > > Physically disconnecting the device also worked, i.e.: nothing bad
> > > showed up in dmesg.
> > >
> > > Note that I did not touch MAINTAINERS at all. The objective is to
> > > kickstart the discussion of what to do there here in v1.
> >
> > I tried to apply these, but I get the following build error when adding
> > to the char-misc-testing tree:
> >
> > ld.lld: error: undefined symbol: usb_get_intf
> > >>> referenced by kernel.1a949e63ee2acc6a-cgu.0
> > >>> rust/kernel.o:(<kernel::usb::Interface as kernel::sync::aref::AlwaysRefCounted>::inc_ref) in archive vmlinux.a
> > >>> referenced by kernel.1a949e63ee2acc6a-cgu.0
> > >>> rust/kernel.o:(<kernel::sync::aref::ARef<kernel::usb::Interface> as core::convert::From<&kernel::usb::Interface<kernel::device::CoreInternal>>>::from) in archive vmlinux.a
> >
> > ld.lld: error: undefined symbol: usb_put_intf
> > >>> referenced by kernel.1a949e63ee2acc6a-cgu.0
> > >>> rust/kernel.o:(<kernel::usb::Interface as kernel::sync::aref::AlwaysRefCounted>::dec_ref) in archive vmlinux.a
> >
> > ld.lld: error: undefined symbol: usb_get_dev
> > >>> referenced by kernel.1a949e63ee2acc6a-cgu.0
> > >>> rust/kernel.o:(<kernel::usb::Device as kernel::sync::aref::AlwaysRefCounted>::inc_ref) in archive vmlinux.a
> > >>> referenced by kernel.1a949e63ee2acc6a-cgu.0
> > >>> rust/kernel.o:(<kernel::sync::aref::ARef<kernel::usb::Device> as core::convert::From<&kernel::usb::Device<kernel::device::CoreInternal>>>::from) in archive vmlinux.a
> >
> > ld.lld: error: undefined symbol: usb_put_dev
> > >>> referenced by kernel.1a949e63ee2acc6a-cgu.0
> > >>> rust/kernel.o:(<kernel::usb::Device as kernel::sync::aref::AlwaysRefCounted>::dec_ref) in archive vmlinux.a
> >
> >
> > Any hints?
>
> Did you enable CONFIG_USB?
Yes, CONFIG_USB=m
Powered by blists - more mailing lists