Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1427793pxf; Fri, 9 Apr 2021 08:11:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzWQUzqw2+PxVUOfCR96WCZ4rY7dxGRq6b0ZzN1T8CeMEgm32yXO9uhsCO5C13f0BKGvHJ X-Received: by 2002:a05:6402:1157:: with SMTP id g23mr18024878edw.303.1617981060597; Fri, 09 Apr 2021 08:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617981060; cv=none; d=google.com; s=arc-20160816; b=kGnjHKX9gOO9V9+C5ElUmITBkn3Mve52XUJm3oToWFS8VzuGy9e18vxyYgS99BqWSP 8ChvDPiAfI2oAZW/Slli57wcWNfNL19hCPer/9SCaVNV4lIVCyVlR1pRoxehZ6FuEoZw Sm70CjTU7pBgQl5s91hJ1yGuTaEPMr38O+XgSweIZ8npFyjBoLrHQCtaIkCcrRMEn/ND pUnKjEJRbJOpR8foVvK7M0hfsg8YbOWPgK2w1t++dprRp1Ot5aHcqU8v5ihC2EYN7xne roACSWSCgZ27dfA7mI2LTMmythLDNKOUUXNOMl9dGx8byaH94zg1b0FoMex85ZiO/xx0 XXgw== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=FD7SPvxehe3Wfb0kir6VteSjlAe2ssVc3bppfontmTk=; b=WYEa5nfRPE2eAQUgTXe8yrL097D39O636lwtLgQv3V8yiVFjnwvupQaMSuj2dO2kIP P4o7iE0wLMqpNYEhJ/QScAWuePitUXdOHPTvMN2i2/aRXY8bRHtK9yK05kZUWFWEv7qe VcvSQyLQMLrqw1u/uW7dZLTLzcnARRvpb3lPWx6wKyxG7XQ0ZgsbQ2x+QHjYNyQU5i5K OwmhL3GThIe8uoXVwmQRo/FB+GtJEg16wUu9gSZp9e2gm1J85/MKkXaCAZidGpIOb9Zg Dv5+S+T0pHbDWiRp/ym3dOT03QJHb6Oxm38oSZvmY26eNXs/ximHGtoWkof8VUQ450PE 7s0Q== 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 dk7si2277492ejb.285.2021.04.09.08.10.37; Fri, 09 Apr 2021 08:11:00 -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 S234087AbhDIPJ1 (ORCPT + 99 others); Fri, 9 Apr 2021 11:09:27 -0400 Received: from netrider.rowland.org ([192.131.102.5]:40409 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S233878AbhDIPJZ (ORCPT ); Fri, 9 Apr 2021 11:09:25 -0400 Received: (qmail 1334363 invoked by uid 1000); 9 Apr 2021 11:09:11 -0400 Date: Fri, 9 Apr 2021 11:09:11 -0400 From: Alan Stern To: Chunfeng Yun Cc: 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: [RFC PATCH] usb: core: reduce power-on-good delay time of root hub Message-ID: <20210409150911.GC1333284@rowland.harvard.edu> References: <1617935947-24045-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1617935947-24045-1-git-send-email-chunfeng.yun@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 09, 2021 at 10:39:07AM +0800, 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 > > Signed-off-by: Chunfeng Yun Acked-by: Alan Stern > --- > 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, > -- > 2.18.0 >