Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp758660lqs; Tue, 5 Mar 2024 16:08:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUY5lufVbFKTfifn8aqOD178EyVvaSbuqpm16GWZsFMh8seFiEFsU3Ejsh0CGFVmcVMyunDg9MHjmg0o9XNNiYHyE3Sz6sy2XjkXBmejw== X-Google-Smtp-Source: AGHT+IHsiwvd3mpPWUsoj7GWGFL/Ycu68yAPETNBFNX8M9COGKFMZNpTC8ne+JR3+XQFd5DnLcre X-Received: by 2002:a05:6a20:6d9e:b0:1a1:44c9:2d8d with SMTP id gl30-20020a056a206d9e00b001a144c92d8dmr2618508pzb.37.1709683702263; Tue, 05 Mar 2024 16:08:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709683702; cv=pass; d=google.com; s=arc-20160816; b=bSrqTZ1tAFJgscBy9xpM7VMksVmF47CGXAApyyv4eV9iXfS9y5iBAY7O/QWmaKU+MU jUu2VIWy4EtDWv2UEI5duZpK+EvWzZq4UsfKSmyYo2NtjrZHKFfxbqp+ThLaAlS+mVIf t/P7qg/B/S04rEWMykydTQ+oOZQMbz1ttipf2liO0SeVW4Lqn2b6uILzLNCk87yMcKNF tjYRwPC+Y3S/U+q6QhELNuWhcvhrO1Zh9p8jt8gwcrdeNt51tK+CPD2kkeWPJY1KBD3X WFKTzT6j+35556TVKTOV4wdWRcp/3KNJzaDd8LCBdqN56NqtSOFG5/Xu++FNPQj3cFQU j54Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=oJ89TjWV3yERdS8ie8KDxuv0wN9Nxj1Idl407UIe0hY=; fh=wWerbH4rGWDkPfIYGC4gQTyWX5jcO2HuqJRO49c2rF4=; b=VYppv6pEWOFUjFTXJCM7uv7JYbGtwg3Q73kUV08qCEX2KQtbNU2TmlqzAe34sPu4nz mBAwpg/KLI4OK1jtlekc9DJCjhkEcOMyZoFcsKb0j8duO0+Iz76d66Y5hdlqoVjnuSlo 7G5ceEohobBehf1eWTESiJlHJpfrFqPOvRGWWjXOu0enIA1vLmHGhF4ue/bDPBM65cTV xghIejlFGlmpVGRy9+q3WTKGjBkaq5MGf+CPDoGecZ1u7LVgeiEAtqxXe/nzdbhBkqhY uWwrej41jAfLFLl0CaYIqT88pntg/uShLCOC+vD0YvVaWbMu0S859uNscR18gn/1guz4 7FPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b=UX6+wXCy; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=da+EPSJG; arc=pass (i=1 dkim=pass dkdomain=invisiblethingslab.com dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-92805-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92805-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lm7-20020a056a003c8700b006e625aaa4ecsi3907331pfb.1.2024.03.05.16.08.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 16:08:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92805-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b=UX6+wXCy; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=da+EPSJG; arc=pass (i=1 dkim=pass dkdomain=invisiblethingslab.com dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-92805-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92805-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 418EA2890C5 for ; Tue, 5 Mar 2024 18:04:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C249D199BE; Tue, 5 Mar 2024 18:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=invisiblethingslab.com header.i=@invisiblethingslab.com header.b="UX6+wXCy"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="da+EPSJG" Received: from wfhigh5-smtp.messagingengine.com (wfhigh5-smtp.messagingengine.com [64.147.123.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61D6718EA2; Tue, 5 Mar 2024 18:04:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709661865; cv=none; b=UVOlbHVbDWA1S0GvcU8lTjHG0Bel52/TbGcFr/zPdIlLcp8uUIf90ivv8LHt/e4l1lJXSWMIXPKEw90qY8bFrQdfvZ/f0uBW/jIqI5yT/fOghq7AAQHyfJZbCnRq1RC+witBILOKOC9HvQ9R+z/crYIhwVoe3Uc+mq/p5+tUeJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709661865; c=relaxed/simple; bh=CzoUQeUuD/Op4J/bIDyyH8d27EUxkN3m+tfcHhz4KTg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pbXXacpNJDJpfAFQepFIA9Bb+JRRTwBnxpMI39PB6/TeHd0z55AIOdOd7Tm4r+s0PDm8IBW9NO0NNZpNASF7gD6247raFr13Xr90NfOxx486ogdhmV1DPtrJbsPGsgJnKWp15TqNVGwyE6133I/LuRiW+xddT7IL1TIKlsfdyDo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com; spf=none smtp.mailfrom=invisiblethingslab.com; dkim=pass (2048-bit key) header.d=invisiblethingslab.com header.i=@invisiblethingslab.com header.b=UX6+wXCy; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=da+EPSJG; arc=none smtp.client-ip=64.147.123.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=invisiblethingslab.com Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id 212DB18000C2; Tue, 5 Mar 2024 13:04:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 05 Mar 2024 13:04:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1709661861; x=1709748261; bh=oJ89TjWV3yERdS8ie8KDxuv0wN9Nxj1Idl407UIe0hY=; b= UX6+wXCyZgBfan+tiWIpzBz+pvCq2lZN6iT9Z87C13u6N26sZoeSxnONc7Zf0yyi daxVe0o3UopEDWaWpjNeXEFYBQCXW0mRYxEJQfwMP0Fnsq+Ug3Up2Re/kRduxnjp 7X3PkT0vTUMQqBej4OTZ/YsT4aPGN64QEU24r6yxuMLdrkUjFThAzZVibLZQaFyQ 8yK+xCjEB9g5ASQTJfYweECGBSMO+9t14mxZHIz2PYVHreViDONTnPJ3X5pSV0Hn cmMimkAH5pJI7zTunPndg89mmJEWI3Y4DDZEOrzQBmCaXUot9givnZJ0eTKz2f28 zpxumfNs3aJEaCvGniknPQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709661861; x=1709748261; bh=oJ89TjWV3yERdS8ie8KDxuv0wN9N xj1Idl407UIe0hY=; b=da+EPSJG5b9L2XMcD4+uIitqJst5ZjGiI41WKSjNrV8Q N8Gpp4OvgzWm5yrNwwgJVLDzqsqt8MD8h1bsJLYZCCPuZ4UqScZH8N6Ix35sNsMP y3Fo667ZgB8CN5v4tq7ReNNwBzgapDqxx0jmhnlQBpU6Ii6t7AEpLvBn+rP+IXaO MKVNT8xtd0ACJEaZ3ynLbEzA7N/deNAvf+jdoxDQ0ltrUR7PH8erjxy91CvTpnIe VSwMWZGvHdGg8JpOxt9zOy0AF1aJZ/EnNoDz5K+nmaeUfYoDhfTNPn3oeak2wHLM khwy9ssym4YzEL2ffkoDmhflO/m9wClF9fa9FC1B1g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheelgddutdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepffgvmhhi ucforghrihgvucfqsggvnhhouhhruceouggvmhhisehinhhvihhsihgslhgvthhhihhngh hslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepvdejteegkefhteduhffgteffgeff gfduvdfghfffieefieekkedtheegteehffelnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepuggvmhhisehinhhvihhsihgslhgvthhhihhnghhs lhgrsgdrtghomh X-ME-Proxy: Feedback-ID: iac594737:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Mar 2024 13:04:20 -0500 (EST) Date: Tue, 5 Mar 2024 13:03:40 -0500 From: Demi Marie Obenour To: Alan Stern , Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= Cc: Greg KH , linux-usb@vger.kernel.org, Linux Kernel Mailing List Subject: Re: usbip doesn't work with userspace code that accesses USB devices Message-ID: References: <2024030406-kilogram-raving-33c5@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WuauqmvHY1lzItxJ" Content-Disposition: inline In-Reply-To: --WuauqmvHY1lzItxJ Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Tue, 5 Mar 2024 13:03:40 -0500 From: Demi Marie Obenour To: Alan Stern , Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= Cc: Greg KH , linux-usb@vger.kernel.org, Linux Kernel Mailing List Subject: Re: usbip doesn't work with userspace code that accesses USB devices 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=C3=B3recki= wrote: > > On Mon, Mar 04, 2024 at 11:46:04PM +0100, Marek Marczykowski-G=C3=B3rec= ki 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) > > >=20 > > > 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 > >=20 > > Or maybe reset or something is involved here too? > >=20 > > 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. > >=20 > > In fact, even without usbip involved at all, jmtpfs directly in sys-usb > > works only once. The second attempt (without either physically reconnec= ting > > 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: > >=20 > > [921332.525210] usb 2-1: reset high-speed USB device number 22 usin= g xhci_hcd >=20 > If something doesn't work when usbip isn't involved, you definitely=20 > 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? --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab --WuauqmvHY1lzItxJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEdodNnxM2uiJZBxxxsoi1X/+cIsEFAmXnXqIACgkQsoi1X/+c IsEpUBAA127He3YTnKqeYWZB6BxzbpxCSINki6Do6SVOuC/ndGalKTj0bbDdwvDp jNjDudUSCdqqF8J30g9Ey4IEMtmbncLW0MJrOq9lErLdvu7W39w8DWANwdhtex43 IeayIECk6A9IV8M0aJOp6RDXHyxDBDMqkCfLPYQZkczIxAHd5Wvg2Nav0w4C2QBp lwNWrQ2OaieLgYkYCwsziUu6JF94KyvvEguQqRlR3uSEdvb/JSbeVKladc3FZZ6s uFM1qdILr21unwQ8OC/CxfN4e8ZIcoOfRfBddPJPl7EsaPG+rI4ydgCEmCXxEUXS b+80iYTpCcCq+8FIcLjuFT4isaxxy5rllF+Jc21eMXTVXqOWvcjd9lY2wPwbp2mp Za1QbjyXyI/csuEUIOeBWRl4TXZYPQCBGebyHAxjw/JEicmdcc+YiLI4+lsFUDJ9 rjkAF8nMcqrQtVD+bXUnGaURmd2nHvxNdWRX5BAV2+DX4GMSSl+0ihh/Gx+fDGpZ bmdRraVID6vtqM0GfzfS5b+rAMBRrhItbgH+UobxoGfhf22yBmUfIXR1kUx/YYia FZ9x6svH37F/6czpwpdKJFQHrrPO7wQYNsEhQMMJHEaqSvC6fhBK2mCxKtyIodmA b4ugE/zCnk+LLlloDMui4jlmYhOycnhccuyr0daRquzduKKo+bc= =x6n7 -----END PGP SIGNATURE----- --WuauqmvHY1lzItxJ--