Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2409956rwo; Thu, 3 Aug 2023 09:00:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmBM9Dg0C/1Hw86itjwebn1eygBdSaonn/0+1iPL+w5W7ZrwxBXwfKo/wqrMzDe3Ky/1J7 X-Received: by 2002:a17:906:5a45:b0:99b:65fa:e30f with SMTP id my5-20020a1709065a4500b0099b65fae30fmr8008873ejc.1.1691078436236; Thu, 03 Aug 2023 09:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691078436; cv=none; d=google.com; s=arc-20160816; b=JvdgD6E+Sof2dTVj+ubI9R0plaQopLGGs+s20euyQthS85torWtzTHDjnMBeJak9aN M5Tlwz2GYZ2VtC2VxJwdeWkJG2RiLX/Z894X9uNfNbZVRWCj2dGnhXncllhNF9onBjoz Kt752fRzP369cpEyG3qVRf7hg7ZCkDSz+fb2SVY+sKic/wT/dm0qvSAatnIQQ/A9Zfoi V7azBsZKt1Cv07DDrLW9bZdnUKNwB+07aRCT1DAPy44SbdUewUZ1ID7kny3sN8XNg5dE d68AroO+JV+7HI2Or6Dp1VZh0WnRdvvEYQHl/DvV+Un6EBM/jib6nDrIHKY8VSSO9AGh 1Kxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jBLw4/arjgMDCeChj/cBOttA1d//sxwJd+B3d8OesgU=; fh=AAaMAmw9f6l9LnYHlgOGUzRGeGtRyp33gF4igO5hN38=; b=sv0QbTflFlynC8K6mNYVM7B/a7ZG6jDU2ncx9w47yduIj2RWHG2jGYmuv3A544UzWw foz1lNbOjCAmIUCzRDzfniCXKVB5bFv3Ksyj0HkSI2GfWp5i0Ez599bxQVnn4WOHgU0/ rPuBcwFxiQOZxgcJH1WDL/FkEfDdh9D3i/9jc5BctXRRMTVPR+0FBca196jdMh6KDwRV xIsiZuKHMkRvQzCh46G4xXwIaGjgq5P7e0GX5aqzqwIHWwMin9y+Y1uy82I9uE2wHRXu JhsWSWMAIvG8h6HIn2qfZdl8N2zmjYBE5B0x3C8D/yiL+WrnO1KXvVXQzx9fX15nCwqF aFqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p20-20020a170906141400b0099bcc0ad6fasi1870ejc.782.2023.08.03.09.00.01; Thu, 03 Aug 2023 09:00:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236876AbjHCPKH (ORCPT + 99 others); Thu, 3 Aug 2023 11:10:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233558AbjHCPKF (ORCPT ); Thu, 3 Aug 2023 11:10:05 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 79C5DE75 for ; Thu, 3 Aug 2023 08:10:02 -0700 (PDT) Received: (qmail 246372 invoked by uid 1000); 3 Aug 2023 11:10:01 -0400 Date: Thu, 3 Aug 2023 11:10:01 -0400 From: Alan Stern To: Dingyan Li <18500469033@163.com> Cc: Greg KH , Hans de Goede , Xiaofan Chen , Oliver Neukum , Tormod Volden , sebastian.reichel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Re: [PATCH] USB: add usbfs ioctl to get specific superspeedplus rates Message-ID: <51926ee6-ee81-4543-a1f7-338e65a26670@rowland.harvard.edu> References: <2023072105-lethargic-saddling-ad97@gregkh> <130b453c.5c8f.1897872ce54.Coremail.18500469033@163.com> <2023072159-carol-underfeed-43eb@gregkh> <781b3f95-96e7-af83-e089-887ec7f2d255@suse.com> <2023072546-denture-half-5ceb@gregkh> <2a82ba01-38dd-fad9-98b9-ac8591107921@redhat.com> <151a5748.3e99.189ba07b110.Coremail.18500469033@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <151a5748.3e99.189ba07b110.Coremail.18500469033@163.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 03, 2023 at 02:13:33PM +0800, Dingyan Li wrote: > > At 2023-07-26 22:39:32, "Hans de Goede" wrote: > >Right, so the reason why IOCTL USBDEVFS_GET_SPEED was added is so > >that a confined qemu process which gets just a fd for a /dev/bus/usb/ > >device passed by a more privileged process can still get the speed > >despite it not having sysfs access. This is necessary for correct > >pass-through of USB devices. > > > >Since USBDEVFS_GET_SPEED now no longer tells the full story I believe > >that the proposed USBDEVFS_GET_SSP_RATE ioctl makes sense. > > > >The current patch however misses moving the enum usb_ssp_rate > >declaration from include/linux/usb/ch9.h to > >include/uapi/linux/usb/ch9.h so that needs to be fixed in a version > >2. Assuming that with the above explanation of why this is necessary > >Greg and Alan are ok with adding the ioctl. > > > >Regards, > > > >Hans > > > > Hi Greg and Alan, > > Could you please share your opinions about Hans' justification? Instead of adding a new ioctl or modifying an existing one, how about increasing the set of constants in enum usb_device_speed? Then the existing ioctls could return the newly defined values when appropriate, with no other changes necessary. (This doesn't mean just moving the definition of usb_ssp_rate from one header file to the other. The usb_device_speed enumeration should be extended with the new members. Perhaps omitting USB_SSP_GEN_UNKNOWN since we already have USB_SPEED_SUPER_PLUS, or setting the first equal to the second.) I don't think there was ever a requirement in the API that the set of values in usb_device_speed could never increase (and in fact it has increased in the past). Such a requirement wouldn't make any sense, given how the USB-IF keeps defining newer and faster USB bus implementations. Hans, would that play well with libusb? Alan Stern