Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp828388imm; Fri, 17 Aug 2018 07:20:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPza8Q5Cg5qDlPMH0MdyPd0gYrWnrGtMWNwGcsYwrz+lB0JOgtnVwPYO9qoveDQhYqNkLgcQ X-Received: by 2002:a62:98d6:: with SMTP id d83-v6mr37139725pfk.186.1534515643789; Fri, 17 Aug 2018 07:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534515643; cv=none; d=google.com; s=arc-20160816; b=kvULZ/0DdjfApNxIS+GcxSisl/NdSVT3FqCKiR6p/b6ACPrgELXzJz2smG0XdhegRw zrc/cxLwyVqBk9NrPoDSTxWZA+doZ/DTwuATVikByEoyFiYUGLLQ/1U8aNNH8F/r1yy8 TJaJEyxvdIHkKJK0Q+qOlcpDNEEfKiQJGmtRF0xHI3nbzQGvXowp7UTCP8P6JIzty9OA WDmZZi4wSK2d9c/lan02C8J2RLMe94b+z2u/Lj2vZsZnntDc87M+/06QAR2dxLKytU1m 83D37STCe0YCt4is9Y+BTaNfeiXyhTEJY8lZ2q9yA8Mv+IBuEobfE/IGf0wpLWs0YREa aQxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=dJHTjeShlLSV9KRczEp9H/wOXhFscIQNV/DFggLGfa0=; b=Jao2c+UeTn/9+svBzCmfMOYvOSDkeyxeWGEbclSZDr7NnIs+k52pC1XiBlM4F42gSJ 6DsNQUG76YBZA2k61YD8pJ16PttEhxSIWOJBg2klyqg44EogGQ1HwYdRJ6xAp+v9Gozp Zk29/MOu71d7qu3ZxCQxkQeCgOVQ9DR1OmyUQqOhZu44jd7vHJIn7UKgK4MahyVwxw75 HYNLHvN6ohPuVSfcY7c3GIiXJ1A32iMnRH7kaTfgPlVD0xcn+RvD1qiV711wLAn2OQsa O6EMRR7vAhgT20vbsEsxYpEhhgaR5oECuBTr522okFqyYlz05N6Wj0J4I1YNBt/wMF/Z q1sw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf12-v6si2431578plb.176.2018.08.17.07.20.27; Fri, 17 Aug 2018 07:20:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727333AbeHQRWx (ORCPT + 99 others); Fri, 17 Aug 2018 13:22:53 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:60928 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726356AbeHQRWx (ORCPT ); Fri, 17 Aug 2018 13:22:53 -0400 Received: (qmail 1614 invoked by uid 2102); 17 Aug 2018 10:19:19 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 17 Aug 2018 10:19:19 -0400 Date: Fri, 17 Aug 2018 10:19:19 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Zeng Tao cc: gregkh@linuxfoundation.org, , , , , , , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "Rafael J. Wysocki" , Marc Zyngier , Kai-Heng Feng , Thymo van Beers , Frederic Weisbecker , Konrad Rzeszutek Wilk , David Rientjes , , , Subject: Re: [PATCH v2] usb: hub: try old enumeration scheme first for high speed devices In-Reply-To: <1534503120-1226-1-git-send-email-prime.zeng@hisilicon.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 17 Aug 2018, Zeng Tao wrote: > The new scheme is required just to support legacy low and full-speed > devices. For high speed devices, it will slower the enumeration speed. > So in this patch we try the "old" enumeration scheme first for high speed > devices, and this is what Windows does since Windows 8. > > Signed-off-by: Zeng Tao > --- > Changes in v2: > 1. As suggested by Alan, mention in the commit log that this change is > follow what the Window does. > 2. As suggested by Roger, update the kernel-parameter description. > --- > Documentation/admin-guide/kernel-parameters.txt | 3 ++- > drivers/usb/core/hub.c | 5 ++++- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 533ff5c..95db23c 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -4453,7 +4453,8 @@ > > usbcore.old_scheme_first= > [USB] Start with the old device initialization > - scheme (default 0 = off). > + scheme, applies only to low and full-speed devices > + (default 0 = off). > > usbcore.usbfs_memory_mb= > [USB] Memory limit (in MB) for buffers allocated by > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index 1fb2668..d265b19 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -2661,10 +2661,13 @@ static bool use_new_scheme(struct usb_device *udev, int retry, > int old_scheme_first_port = > port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME; > > + int quick_enumeration = (udev->speed == USB_SPEED_HIGH); Minor style point: the preceding blank line should be eliminated. > + > if (udev->speed >= USB_SPEED_SUPER) > return false; > > - return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first); > + return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first > + || quick_enumeration); > } > > /* Is a USB 3.0 port in the Inactive or Compliance Mode state? Aside from that: Acked-by: Alan Stern