Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3060038pxb; Mon, 1 Nov 2021 07:09:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOZ3FKRYS+uNUKkE8StCPZlkkFZuMftFSjtml7CffsmXcwSY8kzJb2JZeYayYQIg79TqpQ X-Received: by 2002:a05:6000:2c2:: with SMTP id o2mr38317486wry.194.1635775759332; Mon, 01 Nov 2021 07:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635775759; cv=none; d=google.com; s=arc-20160816; b=XpRIch1xrPgcNvX+Vmx6B9fj1WWDa+sIp7rEOb7oX3nhyVVdoeh7ui39L4wy+B1YVl iXQDIUKUbv+axVxLEhAnmLwT15UhkzAW1hUmkuv2yTr2VybuQQbk7SboYg6p/mI+jjqC h19NGqr7S+Z465vwxl0yhWiUxczm5YYnqkPNkZCNO2jL1HzpW3mFKZEpHNu0RiNir25L TQFsZmYRwksuAPchaZwxnvTQOT4XKe3MpjXPxXSMtPxfiesdGa4gJPPNFAzTQnciX21B bDmD2kFVeio58tciOahd8BhJpVEpWKmDuxM6a35CNDSUaS9ZKvoOiUSCetsaxp8k8tfW 0ucA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LF4ZBL5Jwoc2ESwzSEdRQYdqflKdzMsHGUApdsDKXm4=; b=Cu7C0vZqPfDruZNVA7KSj203+6IN61h5Tk1MX1QVArX3Mj+t9dypdQhYNPaHdqwNhq bNlqEHk1lKZNVytf5whb/V5REW4KOGOZYd6I15JN5T7gQIsF7gnazBcCKERMP9pMNrmC 8FEUI55Xv9Kuekw00J/DRZeJgoLPaf/A/fOZTJMG09m7Ny+5p2ll3pG+OYkULKUb4h2g 3fPIHUXqgR11BFJFFrSZTjjFdKHWZIg2o5AZ1Ng/cr+nfKtAO/9vDnS94FmZq7tvtjMC EbvsVbajizOCKO4oz1QwTMbQ/Bi5HMAqjpabm+SELAbLMCuBsVQ09XcPQVtWcwF0zsjL r5Zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si3125531edd.530.2021.11.01.07.08.52; Mon, 01 Nov 2021 07:09:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232302AbhKAOIt (ORCPT + 99 others); Mon, 1 Nov 2021 10:08:49 -0400 Received: from netrider.rowland.org ([192.131.102.5]:57455 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S229826AbhKAOIs (ORCPT ); Mon, 1 Nov 2021 10:08:48 -0400 Received: (qmail 1457560 invoked by uid 1000); 1 Nov 2021 10:06:13 -0400 Date: Mon, 1 Nov 2021 10:06:13 -0400 From: Alan Stern To: Mathias Nyman , "Walt Jr. Brake" Cc: Chunfeng Yun , Greg Kroah-Hartman , Matthias Brugger , Nishad Kamdar , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Eddie Hung Subject: Re: [PATCH v2] usb: core: reduce power-on-good delay time of root hub Message-ID: <20211101140613.GC1456700@rowland.harvard.edu> References: <1618017645-12259-1-git-send-email-chunfeng.yun@mediatek.com> <5e907ccd-40bb-2ece-fe05-1a65a74f3aa2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5e907ccd-40bb-2ece-fe05-1a65a74f3aa2@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 30, 2021 at 12:49:37PM +0800, Walt Jr. Brake wrote: > This patch make USB 3.1 device cannot be detected, and I report the bug [1] > to archlinux three month ago. Yesterday I try to fix it myself, and after I > revert this patch, compile the kernel and test, it works. > > [1] https://bugs.archlinux.org/task/71660?project=1&pagenum=2 > > > diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h > index 22ea1f4f2d66..73f4482d833a 100644 > --- a/drivers/usb/core/hub.h > +++ b/drivers/usb/core/hub.h > @@ -148,10 +148,8 @@ static inline unsigned hub_power_on_good_delay(struct > usb_hub *hub) > ?{ > ??????? unsigned delay = hub->descriptor->bPwrOn2PwrGood * 2; > > -?????? if (!hub->hdev->parent) /* root hub */ > -?????????????? return delay; > -?????? else /* Wait at least 100 msec for power to become stable */ > -?????????????? return max(delay, 100U); > +?????? /* Wait at least 100 msec for power to become stable */ > +?????? return max(delay, 100U); > ?} Mathias: It looks like the bPwrOn2PwrGood value in xhci-hcd's hub descriptor is too small for some USB 3.1 devices. Can you look into this? Alan Stern > On 10/4/2021 09:20, Chunfeng Yun wrote: > > Return the exactly delay time given by root hub descriptor, > > this helps to reduce resume time etc. > > > > Due to the root hub descriptor is usually provided by the host > > controller driver, if there is compatibility for a root hub, > > we can fix it easily without affect other root hub > > > > Acked-by: Alan Stern > > Signed-off-by: Chunfeng Yun > > --- > > v2: remove RFC tag, and add acked-by Alan > > --- > > drivers/usb/core/hub.h | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h > > index 73f4482d833a..22ea1f4f2d66 100644 > > --- a/drivers/usb/core/hub.h > > +++ b/drivers/usb/core/hub.h > > @@ -148,8 +148,10 @@ static inline unsigned hub_power_on_good_delay(struct usb_hub *hub) > > { > > unsigned delay = hub->descriptor->bPwrOn2PwrGood * 2; > > - /* Wait at least 100 msec for power to become stable */ > > - return max(delay, 100U); > > + if (!hub->hdev->parent) /* root hub */ > > + return delay; > > + else /* Wait at least 100 msec for power to become stable */ > > + return max(delay, 100U); > > } > > static inline int hub_port_debounce_be_connected(struct usb_hub *hub,