Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp204278rwo; Fri, 21 Jul 2023 10:31:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlFJ+OAHutVhc4ynB4vlAC4nbc+VpaG9RBFW8COFUf3V1LuiJN/z+G3ZxjFaqHwze4R+IbsF X-Received: by 2002:a17:907:75d5:b0:982:1936:ad27 with SMTP id jl21-20020a17090775d500b009821936ad27mr2154049ejc.11.1689960662931; Fri, 21 Jul 2023 10:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689960662; cv=none; d=google.com; s=arc-20160816; b=f/VVofHUxn1NhU1qn72awmEcLKxLUOM51viAq73XU5s6bEY2xDZcSthQPnrl5LKZYq BpcetqhOKWj86ZkiPBmSjIO4Ocv3roMh8gkojg+anzG8Z9R5/Imvx28wq+JXpq/RLg+h UCAsxY0z+d6azOAsvE/jYG4Ukv6y073nsvnOiisX8VhEN5VzjR4oOo9CZM+/DG+S+xNo lv97M4PpPNjW2A/6b5/vEpya9D+8R1vba2VKUoyyNF5z5OpCOo76l4hLI0k0rp+6uj7z hiobvZ+37yHGdhfMWPCD4VrcuwR2Al/SMPGfsCzXLG0pAf6x6YeU0apHAIbAlTm2o8ov rCXg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DmQpveEOXlTV3PdhOaUolu6nX398c5br50rWKYoA1RQ=; fh=xogeQZkfkS8OakHWjXP/LQVz1+FoTybHYOzmvelLmeY=; b=otRyNz3HqQw6RpzBahjTWZAW4qb1nGEOGHeX9bnq+7bfMeuni4Td6PJmMX6CZ3Napy /+JPAGmio2rHNI+IiX1kG0kQK7/oXkX65Lmc4wqdKRvRyK/Cn+KyxNoIn6AXkTLMRDpM 4xKeM2t3s+PvTl7Ees6RtW4hyk8B6nBUUSTFKXAEIZlNi6/m9mywYAaWt4UwslJBugkV XWm5oxFW0f44cT7NYEakGuGzgHq0r1BHYB6xderhdR/piEU2XW5lpmc7t3hZihKmgFS+ UzbfJrVdECoyfkc5uRki/GbvPD9vIyCVPjtxeR609cmSzw2m7TR2klrln7NSwVOx6ROA sRdw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a170906849100b0099b7211b395si503370ejx.36.2023.07.21.10.30.37; Fri, 21 Jul 2023 10:31:02 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230106AbjGUR1X (ORCPT + 99 others); Fri, 21 Jul 2023 13:27:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230228AbjGUR04 (ORCPT ); Fri, 21 Jul 2023 13:26:56 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 01D3A35A1 for ; Fri, 21 Jul 2023 10:26:22 -0700 (PDT) Received: (qmail 1762664 invoked by uid 1000); 21 Jul 2023 13:26:22 -0400 Date: Fri, 21 Jul 2023 13:26:22 -0400 From: Alan Stern To: Dingyan Li <18500469033@163.com> Cc: Greg KH , sebastian.reichel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Re: Re: [PATCH] USB: add usbfs ioctl to get specific superspeedplus rates Message-ID: <71130307-1c5c-468b-b876-799c434002cc@rowland.harvard.edu> References: <20230721084039.9728-1-18500469033@163.com> <2023072105-lethargic-saddling-ad97@gregkh> <130b453c.5c8f.1897872ce54.Coremail.18500469033@163.com> <2023072159-carol-underfeed-43eb@gregkh> <25f05926.7e4c.189791ece3b.Coremail.18500469033@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <25f05926.7e4c.189791ece3b.Coremail.18500469033@163.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 Fri, Jul 21, 2023 at 11:43:29PM +0800, Dingyan Li wrote: > Okay, got it. The motivation should come from real-world needs. > > Just like I mentioned above, currently in libusb ioctl USBDEVFS_GET_SPEED > is still used, especially where sysfs is not supported. My original idea > was exactly trying to add this new ioctl into libusb. So in order to get 20Gbps > speed, we need extra information. The basic workflow is like below: > > // This is pretty much how libusb does it, get 10Gbps at most > ret = ioctl(USBDEVFS_GET_SPEED) > if (ret ==?USB_SPEED_SUPER_PLUS) then > ?speed = 10Gbps > // With this new ioctl, we can get 20Gbps now > ret = ioctl(USBDEVFS_GET_SSP_RATE) > if (ret == USB_SSP_GEN_2x2) > speed = 20Gbps > > libusb can be a good place to document the usage of this new ioctl if?similar patch > can be accepted into it. And I can't think of other real-world users now. Of course, > like you've explained, it seems quite unnecessary when sysfs is supported. For what it's worth, many of the other ioctls in usbfs are documented (very incompletely) in Documentation/driver-api/usb/usb.rst. That's probably the best place to add any documentation for new APIs. Alan Stern