Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2627943pxj; Mon, 31 May 2021 06:55:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfxUfmSxLkupEdCK/AJ1GqZfspV6TpcKorTXLfd+cbkaYA7j2wUFtcxpCtPmP8EFe0nT5F X-Received: by 2002:a92:d1c3:: with SMTP id u3mr2267202ilg.190.1622469352904; Mon, 31 May 2021 06:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622469352; cv=none; d=google.com; s=arc-20160816; b=O7Yf+IhqL5eQzfAJzKSuPueMN7s8AY+t2+OXQ3HZX4YOiL6XKLx3afjtS0gLWJXOFx KM/Jo15oJelD6fYkVtVb401UM0BlwCFyb4UNm9CoZtcB9nSGcXS/8hnWySxo06BENJom 2P1QbAWFteMuVlkT8HbufFIQ1VIlSzy9U3iLJ0bl/viKlJzSMYzOGrYiI5EtDB8F0TOW NeCBa1GnnMe9gIMfbe9SqW3JLa+JxzsNfR5G5o7TgRE5c+yo6BCGvRLkkVWbUJCyQp3y Nnc7kIv+yPJq2iFxgDa9o04oRxUi6miySzS+E+rrZehPpmz2+Gb6zW7X9C2rLCvyNFrQ GufQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PyTNaN7Y4k0rdgnSbkr+Av+d3v0FVzWK5iGfKRynmZc=; b=XvPnDvtn2mqnBWRlkck5Z1E2F+j7YFpJEA/3b6G4eubcrolP+6iuZzFgMsBqTP5Rs3 RPUQMN5L8vk3k0MgykWuEpnLHj2kvBbaKrw56Op1gEsKhKvyn63QYMwluX9ceZM3FiHl jvPI4Zv+GN6QiXjssym7loiFnWckOJApMcmQOsdlitBa/aLdzsiYRcdgVDjoPIWYkYLa l2UbjO8QNgFG2FegRgeIiz+4Kw2u4YlATSISKUzqbmQC7qvcGIF7w8NYsOG60HzMWP59 fSLWQk+eSrvHG0MuUpgjpPJlyHlZ+tqDZsHF7JxGBt8A+yjXQztb3JhSgqpusiWBMv0C RG5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uQdh1sTL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k64si13774236iof.43.2021.05.31.06.55.39; Mon, 31 May 2021 06:55:52 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uQdh1sTL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232100AbhEaN43 (ORCPT + 99 others); Mon, 31 May 2021 09:56:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:44088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232277AbhEaNh0 (ORCPT ); Mon, 31 May 2021 09:37:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 42B7E613C1; Mon, 31 May 2021 13:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467571; bh=kNsR7JH7HUPqnQDYu7+mJD6fvOY6gA/unXCy4XOe1RU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uQdh1sTLKIrMD0kOp1OAbD6m9g1zp2p2/AWRIjoT8AnipqrtzK1Yi+1F17jVcoDbI 0vMh2JAhjH2PfdHt8ObkqW6k07ng8zZD0xgdycvz7CmU7c0X8Bu4JoSkrtaPBa7Od0 jCSmVKA4YaHanxoQVtfoLCFirCXVcERX+g8kN/pw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Chunfeng Yun Subject: [PATCH 4.19 116/116] usb: core: reduce power-on-good delay time of root hub Date: Mon, 31 May 2021 15:14:52 +0200 Message-Id: <20210531130644.055697545@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130640.131924542@linuxfoundation.org> References: <20210531130640.131924542@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunfeng Yun commit 90d28fb53d4a51299ff324dede015d5cb11b88a2 upstream. 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 Link: https://lore.kernel.org/r/1618017645-12259-1-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/hub.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/usb/core/hub.h +++ b/drivers/usb/core/hub.h @@ -146,8 +146,10 @@ static inline unsigned hub_power_on_good { 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,