From: sashiko-bot@kernel.org
To: "Danilo Krummrich" <dakr@kernel.org>
Cc: linux-pci@vger.kernel.org, linux-serial@vger.kernel.org,
linux-usb@vger.kernel.org, ojeda@kernel.org, gary@garyguo.net
Subject: Re: [PATCH 6/7] rust: usb: remove the disconnect() callback
Date: Thu, 12 Nov 2026 01:50:52 +0000 [thread overview]
Message-ID: <sashiko-outbox-210101@kernel.org> (raw)
In-Reply-To: <20261112005455.1224352-7-dakr@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] rust: usb: missing Sync impl for Interface<Bound> breaks
Driver::Data
--
commit 92376533106fabfcec7a799d05c1ddbb68a85c37
Author: Danilo Krummrich <dakr@kernel.org>
rust: usb: remove the disconnect() callback
This commit removes the usb::Driver::disconnect() callback and updates
the trait documentation and USB sample driver to perform device teardown
in Drop or PinnedDrop instead.
> diff --git a/rust/kernel/usb.rs b/rust/kernel/usb.rs
> index 993760ff332b8..2126378abc959 100644
> --- a/rust/kernel/usb.rs
> +++ b/rust/kernel/usb.rs
[ ... ]
> @@ -291,6 +271,10 @@ pub trait Driver {
> type IdInfo: 'static;
>
> /// The type of the driver's bus device private data.
> + ///
> + /// Device teardown should be performed in [`Drop`] or [`PinnedDrop`](pin_init::PinnedDrop)
> + /// for this type. The `'bound` lifetime allows the data to retain device resources and an
> + /// [`Interface<device::Bound>`] reference for use during teardown.
> type Data<'bound>: Send + 'bound;
[Severity: Medium]
Can a driver store &'bound Interface<device::Bound> in Driver::Data<'bound>
when Interface<device::Bound> does not implement Sync?
Interface<Ctx> wraps Opaque<bindings::usb_interface> and only implements
Sync for the default Interface<device::Normal> parameter (whereas Sync for
device::Bound was implemented on the private usb::Device type instead).
Because Interface<device::Bound> is !Sync, &'bound Interface<device::Bound>
is !Send and fails to satisfy the Data<'bound>: Send bound at compile time.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112005455.1224352-1-dakr@kernel.org?part=6
next prev parent reply other threads:[~2026-11-12 1:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 0:52 [PATCH 0/7] rust: treewide: remove driver unbind callbacks Danilo Krummrich
2026-11-12 0:52 ` [PATCH 1/7] rust: pci: remove the unbind() callback Danilo Krummrich
2026-11-12 1:19 ` sashiko-bot
2026-11-12 0:52 ` [PATCH 2/7] rust: platform: " Danilo Krummrich
2026-11-12 1:07 ` sashiko-bot
2026-11-12 0:52 ` [PATCH 3/7] rust: auxiliary: " Danilo Krummrich
2026-11-12 1:05 ` sashiko-bot
2026-11-12 0:52 ` [PATCH 4/7] rust: serdev: " Danilo Krummrich
2026-11-12 1:47 ` sashiko-bot
2026-11-12 0:52 ` [PATCH 5/7] rust: i2c: " Danilo Krummrich
2026-11-12 1:19 ` sashiko-bot
2026-11-12 0:53 ` [PATCH 6/7] rust: usb: remove the disconnect() callback Danilo Krummrich
2026-11-12 1:50 ` sashiko-bot [this message]
2026-11-12 0:53 ` [PATCH 7/7] rust: driver: document teardown through destructors Danilo Krummrich
2026-11-12 1:08 ` sashiko-bot
2026-11-12 9:47 ` [PATCH 0/7] rust: treewide: remove driver unbind callbacks Gary Guo
2026-11-12 14:37 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-210101@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-pci@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.