All of lore.kernel.org
 help / color / mirror / Atom feed
From: Demi Marie Obenour <demi@invisiblethingslab.com>
To: "Alan Stern" <stern@rowland.harvard.edu>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: usbip doesn't work with userspace code that accesses USB devices
Date: Tue, 5 Mar 2024 13:03:40 -0500	[thread overview]
Message-ID: <Zedeo6_4ZwuHiT3T@itl-email> (raw)
In-Reply-To: <a95c7e71-a720-49ba-b503-6f20a86be38e@rowland.harvard.edu>

[-- Attachment #1: Type: text/plain, Size: 1958 bytes --]

On Mon, Mar 04, 2024 at 10:19:24PM -0500, Alan Stern wrote:
> On Tue, Mar 05, 2024 at 12:52:22AM +0100, Marek Marczykowski-Górecki wrote:
> > On Mon, Mar 04, 2024 at 11:46:04PM +0100, Marek Marczykowski-Górecki wrote:
> > > Terminology:
> > > 1. sys-usb - a VM where USB controller (a PCI device) lives; here
> > > usbip-host is attached to the device
> > > 2. testvm - target VM where usbip is connected; here vhci-hcd is used
> > > 3. qvm-usb - tool that connects the above two (equivalent of
> > > userspace part of standard usbip)
> > > 
> > > Specific steps:
> > > 1. Connect android phone - at this point it's only in sys-usb
> > > 2. Switch its mode to file transfer - observe reconnect in sys-usb
> > > 3. Use qvm-usb to attach it to the testvm
> > > 4. Call jmtpfs -d /mnt in testvm
> > 
> > Or maybe reset or something is involved here too?
> > 
> > After using qvm-usb to attach _and detach_ the device, it stays bound to
> > usbip-host driver (that's intentional). But then, even after re-binding
> > back to the "usb" driver, jmtpfs called in sys-usb directly fails the
> > same way, including failure to reset.
> > 
> > In fact, even without usbip involved at all, jmtpfs directly in sys-usb
> > works only once. The second attempt (without either physically reconnecting
> > the phone, or changing its more to "no data transfer" and back to "file
> > transfer") fails the same way. After terminating the first instance, I
> > see just this logged:
> > 
> >     [921332.525210] usb 2-1: reset high-speed USB device number 22 using xhci_hcd
> 
> If something doesn't work when usbip isn't involved, you definitely 
> shouldn't expect it to work when usbip _is_ involved.

With usbip, jmtpfs fails the _first_ time, instead of only the _second_
time.  This might be related: maybe the attachment of usbip acts like
the first attach?
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-03-05 18:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 20:01 usbip doesn't work with userspace code that accesses USB devices Demi Marie Obenour
2024-03-04 21:04 ` Greg KH
2024-03-04 22:46   ` Marek Marczykowski-Górecki
2024-03-04 23:52     ` Marek Marczykowski-Górecki
2024-03-05  0:06       ` Demi Marie Obenour
2024-03-05  0:33         ` Marek Marczykowski-Górecki
2024-03-05  3:19       ` Alan Stern
2024-03-05 18:03         ` Demi Marie Obenour [this message]
2024-03-04 22:58   ` Demi Marie Obenour

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=Zedeo6_4ZwuHiT3T@itl-email \
    --to=demi@invisiblethingslab.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marmarek@invisiblethingslab.com \
    --cc=stern@rowland.harvard.edu \
    /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.