Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10736147rwp; Fri, 21 Jul 2023 04:18:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlEsjfDNHcWQA/Nb4Qi3ymd2oquKqGIyiS0g69ieL0FiKIohUv9LyHg2gwMbL+ICfYJSBzug X-Received: by 2002:a05:6a00:2489:b0:67b:8602:aa1b with SMTP id c9-20020a056a00248900b0067b8602aa1bmr1635536pfv.27.1689938285622; Fri, 21 Jul 2023 04:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689938285; cv=none; d=google.com; s=arc-20160816; b=MQpQAjuAXUYEY3d2sUvZNTDQYenj2mgyewwIvQs51IcgLWTDRNTbPtb052wtQ38Vg4 XBMIUQg+dDPQxszTt9m3Dz0T4CCszLSNjjyh6W/tpbuytQhpN7e614CWYGy59J3EWi+U t+pDVqeI73LHHGkyi5cKB4G1OsOX+YA3zwrdo3sV1ME2uA5NKAFTQxwhVfIczPqxZMDJ zBnQAybsJMmfPvNAskO99OAbvuaH/MIXBvh5NbFjPjF3Qaq+DmwkZ+/EuEVp9JVp1uxr zKlfpbCSgE5k2XNIZFuQoEJKbluFNCAgTh6FYqP9Ew6fX71GbTYYP17G7jffNpV5UGWB YTMw== 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:dkim-signature; bh=GT4oCLlysQnzdsTbba5V9++z8hLygY3Yck9nrMzKBuo=; fh=IYka8XsVM/p0Ij4nNnjkcpgdY+nLOdZ5JseyDIjOfb4=; b=crelOC+C45oaloajmaYMfnaO6k58BjfXdIZEH8claSIvA1XG+/GbfyXzfRbn7aeRoq BUnEBNouRpE7DQmVMKkN/tNWqpKJcPPz2GNfh/NBn/4Z8RZZ+hxiFW2Kisi3ab7W8TJS scwKyvay/ZlyQrfVaY8S2Zsvre7R+ezCKAWBMK68g+c85X1IA/w0WjjsEmMyLHVrv3mu NiA+zgDXHGGziUDXMBh98uORMHR9kYkKRP5X6AFD2wpqYTRwGBMIWmfhZERys4UCgFLl A9fiX9ODkATmxxo5lS52JoM09J2zv0lThWVQgTNaDGSO/ZjhIr7DUZOyUZqbPY4fxnlC uuKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=shPjxjQ5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a056a00181100b0068622cf50d0si2976975pfa.343.2023.07.21.04.17.53; Fri, 21 Jul 2023 04:18:05 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=shPjxjQ5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231846AbjGULJU (ORCPT + 99 others); Fri, 21 Jul 2023 07:09:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231874AbjGULID (ORCPT ); Fri, 21 Jul 2023 07:08:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01E5D30E6; Fri, 21 Jul 2023 04:04:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 859B1619D9; Fri, 21 Jul 2023 11:04:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A693C433C8; Fri, 21 Jul 2023 11:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689937471; bh=kLm2U5Pu52hMweuu3JvWp8RIyfl+fqT5TzNBsbBd25s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=shPjxjQ5wh01SrsoFazMqcBR5iqM2AIV0qD4B/HKYJJToU2dCiKnberYbH0U5d+qk cUKnz2ERJRFo/ZMCV+Uj+8g7R+lHMMJZl1QeFsLddUu3qeBVBwQ8snFMQKjCbLdyCB cFEiD2vSZjAQ6+0HZHqmUIBXfBYCcRoDu1Nbc+p8= Date: Fri, 21 Jul 2023 13:04:29 +0200 From: Greg KH To: Dingyan Li <18500469033@163.com> Cc: stern@rowland.harvard.edu, sebastian.reichel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] USB: add usbfs ioctl to get specific superspeedplus rates Message-ID: <2023072105-lethargic-saddling-ad97@gregkh> References: <20230721084039.9728-1-18500469033@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230721084039.9728-1-18500469033@163.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 04:40:39PM +0800, Dingyan Li wrote: > The usbfs interface does not provide any way to get specific > superspeedplus rate, like Gen2x1, Gen1x2 or Gen2x2. Current > API include an USBDEVFS_GET_SPEED ioctl, but it can only return > general superspeedplus speed instead of any specific rates. > Therefore we can't tell whether it's a Gen2x2(20Gbps) device. > > This patch introduce a new ioctl USBDEVFS_GET_SSP_RATE to fix > it. Similar information is already available via sysfs, it's > good to add it for usbfs too. > > Signed-off-by: Dingyan Li <18500469033@163.com> > --- > drivers/usb/core/devio.c | 3 +++ > include/uapi/linux/usbdevice_fs.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c > index 1a16a8bdea60..2f57eb163360 100644 > --- a/drivers/usb/core/devio.c > +++ b/drivers/usb/core/devio.c > @@ -2783,6 +2783,9 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, > case USBDEVFS_GET_SPEED: > ret = ps->dev->speed; > break; > + case USBDEVFS_GET_SSP_RATE: > + ret = ps->dev->ssp_rate; > + break; Shouldn't this new ioctl be documented somewhere? What are the valid values it can return? What if it in't a superspeed device? Who is going to use this? And we have traditionally only been adding new information like this to sysfs, which was not around when usbfs was created. Why not just use that instead? Are you wanting to see all of the sysfs-provided information in usbfs also? thanks, greg k-h