From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26109430CFF for ; Mon, 6 Jul 2026 09:45:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783331151; cv=none; b=l69PtmOxS9UKGmJ4+xvifNLNrK8DiCmADOJfkgvY91gn1HlaOBrseOhBRPwO56zTSTx8FIPYVYMEMmvMwA7B40CjMwo8ajtuLsbFQoPkA3XvoPTpvFyxjrfqJ92/nReNXHkRHW+joTINO3cpUbFxUZJhcD7j7PT6VLwZxC11MdU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783331151; c=relaxed/simple; bh=z4ME+i1zwbwk/OvLpxkjwkYtIu4Ubp7pj7q23hgveLc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ou8rtc0H7S80wuuWgaCxw6EPyHvADvC1UaEmumpAS+vrTiwTK9/fKESjQBNuqIxr98DGDEI+56nqvvEZjnMOhrAfAAxMAyC+d2AdF910r7JplS77shx3Mv8chRKLWzdSYdH7W08R9MmR/W4CoCRccFQXygkBQ35uRETkfYD6zU4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=cbDdMPMl; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="cbDdMPMl" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-476d8e647e9so2375968f8f.0 for ; Mon, 06 Jul 2026 02:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1783331142; x=1783935942; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=bfNeQMc5HHOHbeivRIaOAaMk1zlvUrisd/hLb6wkCKs=; b=cbDdMPMl+Kq8222YH4wo77Fiyxnrq0vd0jsudkqQ58UaonzsAKg75/hhRsQjK65BK2 MruVztF+HPdb7KsUczumHe7tQssHveCG/LourN7F0j2RdgNMxVbHza2ttF5RPY1PNbGx n43VxqKoUxE8nlv9IHfAHwUEH9V3T/HC6qPO67OLQysNXsb8H7q4qZ9djNM2MN6i7A28 iEpJFB7nQ/2Hr4c3BjXxDw0Ma3HDchvt3l56KmrzJmsSATUw5oUw39FPBRFz+Vg8eccE Dbv6LqANmhAAOFFcJtK/ayy5F51NRZLNI+tRr0mwvutzuIF38XXyc9MuAht/IyMbl/z7 VB9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783331142; x=1783935942; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bfNeQMc5HHOHbeivRIaOAaMk1zlvUrisd/hLb6wkCKs=; b=T6SXkydpAF1c+44O7YYSr/29k9+L5y4crPYN+ssaxilKPwMZ12lVXkVh3Us7qemRFE hrUgT7B3+20Etju+oaPIBA7uV6JlnZP7cSNaVOt2GrnA5O/I/Y7dlKNFC2UNAxn4vYJH xjBhi/0tBN+3KNc4ryD0fHV+CTcmSXZbyjv9RFKVHSZR/IaehFgWGDeRuh4TCvIhgOYS EzqHud7kvuNH1gDSkYCWuCeaZWIDoONrE2vRe+PPjW2ies9PzepW41zroHrNbysjaFjJ 0HGaLF9ap7dYq2E8NaoQCAcU4qxU1/XMrapidgTiEgRk2ffyxNDTZMH9Cu6okqQxY9PB d8Ng== X-Forwarded-Encrypted: i=1; AHgh+RqWIaRj+cguShyNC6HDOMk88J2HcrFudF3hL4noLcySABcY0lvpq/UOHzcbS/oLHLvz9769+L6Zx91hSWE=@vger.kernel.org X-Gm-Message-State: AOJu0YySnQFW9mOFpgpmHcfizbWM5/R/t2CJS1Ac057etfWLI127oyQI rFeYP18EyW7B5LcSBgCRqoI49zKbUQJiTVUD2K46hrYGFQbU+K8bwuCYX06T//l1zCI= X-Gm-Gg: AfdE7cl565rI2yxVhWAW+7MSedai3J3+utkMdhKbz2mMsnnQEuMVcuzSI+28aptSVHA PNxQ2poB38tyyum8oEGxqFFBk6lV4XRukVFgMSCd1pN6dEFNEr5574/A7XbA77jvJshhvTT6BV3 aOwqPC247LlrQlff7KJ9aHgsgIxgb0f9iq4dt2NlCNPWk+J8dLp2Du7u89J2rAaH7XuFUeYWj/k PCtCNf+UROhc4ZZ5ReOWum9sZVp2PDIx4wuTSn8r6qGa2LQM+1cA1yow3yOsi0+V/BRlpy6K4Ac b6ZAq/Ec5P/FrAe+SxNvPN5xRb8EGI9pJJIuezymf0PIFGdkw5IVreH5Hk6iAc+Dtq0uBKzb6qP 5gWqJ9aRRJtJPkJctHRndjMkWiidWQbKU5ZwnByZiZ2wnlvq8wyb/NjKJxo4b58xLfxiVw7jGMI +fjJSzlm2O40ihdvzzzI4yVu6KuZpxiCDbHs+0teShuLG6o1D6z8NneL8= X-Received: by 2002:a5d:490f:0:b0:473:b63c:8a21 with SMTP id ffacd0b85a97d-47aac2095ebmr8664733f8f.18.1783331142538; Mon, 06 Jul 2026 02:45:42 -0700 (PDT) Received: from ?IPV6:2001:a61:136f:7201:4a82:7cef:c61f:a3f3? ([2001:a61:136f:7201:4a82:7cef:c61f:a3f3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0f213e8sm20582902f8f.34.2026.07.06.02.45.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jul 2026 02:45:42 -0700 (PDT) Message-ID: Date: Mon, 6 Jul 2026 11:45:38 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 10/11] rust: usb: keep usb::Device private and gate transfers on Interface To: Mike Lothian , rust-for-linux@vger.kernel.org Cc: linux-usb@vger.kernel.org, Greg Kroah-Hartman , Daniel Almeida , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Alexandre Courbot , linux-kernel@vger.kernel.org References: <20260617145946.1894-1-mike@fireburn.co.uk> <20260703030020.2694-1-mike@fireburn.co.uk> <20260703030020.2694-11-mike@fireburn.co.uk> Content-Language: en-US From: Oliver Neukum In-Reply-To: <20260703030020.2694-11-mike@fireburn.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 03.07.26 05:00, Mike Lothian wrote: > Address the v1 RFC review (Danilo Krummrich): > > - Do not make `usb::Device` public. Writing a `usb::Interface` driver should > not require naming the underlying `usb::Device` (cf. commit 22d693e45d4a > ("rust: usb: keep usb::Device private for now")), so the struct is > private again and the device-wide transfer operations are exposed on > the interface. Hi, I would say that this is just conceptually wrong. 1. drivers talk to the common control endpoint of the _device_ not their interface 2. drivers ought to be able to set a configuration (That's a device property) 3. Drivers need to be able to claim secondary interfaces (we have an API for that) 4. Devices and links (and functions) have states, not interfaces. These operations operate on the device level. Hiding that fact behind an interface (which may not even be accepted at that point) is just a layering violation. Even calling a device reset through an interface is strictly speaking wrong. We even have a driver that can ride piggyback on another driver's interface and use only control transfers to endpoint 0. This patch is fundamentally flawed because it operates on assumptions that are just not true. USB does device level operations. Just drop it. Regards Oliver