mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Lothian <mike@fireburn.co.uk>
To: Shuai Liu <847807867@qq.com>
Cc: rust-for-linux@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, dakr@kernel.org,
	gregkh@linuxfoundation.org, colinbrauncl@gmail.com
Subject: Re: [PATCH v3 0/5] rust: usb: host-side abstractions for a bulk-endpoint driver
Date: Fri, 30 Oct 2026 07:57:58 +0000	[thread overview]
Message-ID: <20261030075758.356879-1-mike@fireburn.co.uk> (raw)
In-Reply-To: <tencent_A0D3062EB058E244877B87B4324B8DFC4406@qq.com>

Hi Shuai,

Thank you for reading it properly, both of those are real

On Fri, 30 Oct 2026, Shuai Liu wrote:
> set_alternate_setting() invalidates Endpoint<K> without the type
> system noticing

Right.  Binding the proof to the setting would mean threading a
generation through every Endpoint and checking it at transfer time, and
I haven't got a version of that I like yet, so v4 documents it: both
Endpoint and set_alternate_setting() now say that every Endpoint obtained
earlier must be looked up again after a switch.  If you have a shape for
the Altsetting token in mind I'd like to see it

> set_alternate_setting() with transfers in flight is undefined

v4 refuses it.  The window already knows about every queue URB registered
against it, so set_alternate_setting() returns EBUSY while any queue is
alive, and the doc says to drop the queues and build them again on the new
setting.  That puts the cancellation in the queue's Drop, which is where
you suggested

The one in-tree caller selects setting 0 once at bring-up, before any
queue exists, so it isn't affected

Mike

  reply	other threads:[~2026-10-30  7:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260826163101.4168-1-mike@fireburn.co.uk>
2026-08-26 16:30 ` [PATCH v3 1/5] rust: usb: add revocable typed interface I/O Mike Lothian
2026-08-26 18:59   ` Danilo Krummrich
2026-08-31 17:04     ` Mike Lothian
2026-08-31 17:10       ` Gary Guo
2026-08-26 16:30 ` [PATCH v3 2/5] rust: usb: add reusable URBs and persistent bulk queues Mike Lothian
2026-08-26 16:30 ` [PATCH v3 3/5] rust: usb: expose device descriptor fields and queue readiness Mike Lothian
2026-08-26 16:30 ` [PATCH v3 4/5] rust: usb: add a vendor-and-interface-info device id constructor Mike Lothian
2026-08-26 16:30 ` [PATCH v3 5/5] rust: usb: let a driver keep its interface usable while unbinding Mike Lothian
2026-10-30  2:34 ` [PATCH v3 0/5] rust: usb: host-side abstractions for a bulk-endpoint driver Shuai Liu
2026-10-30  7:57   ` Mike Lothian [this message]
2026-10-30  9:48     ` Shuai Liu

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=20261030075758.356879-1-mike@fireburn.co.uk \
    --to=mike@fireburn.co.uk \
    --cc=847807867@qq.com \
    --cc=colinbrauncl@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®