Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2714236pxj; Mon, 31 May 2021 08:55:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuFbj2EI6QrXFBDCsUx/bKdq5ZlRQ+2tQvDHyk+bFXm5Zerm5dHH0odCqBRcGWDfAgrfem X-Received: by 2002:a05:6e02:eac:: with SMTP id u12mr18084292ilj.177.1622476549904; Mon, 31 May 2021 08:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622476549; cv=none; d=google.com; s=arc-20160816; b=PzvNXSgDfNX++vn7PmeL3CH8rFB6jinq9xwhw9QhaSUcix6TKmJOWGAo7nqlMJ1bmc Mmk/yu8aUxs96Secl6MuN6zRx7kkdA+aOQhwzhGtI003NqRlvEPUGChM2gOP7NEQCFvW CkcgfJ9sJF62Csjdk38kiwALQOU7gMMoZF44kb1OOTpgpRfDiQzIFsrWp5/GJF8Nmi0C 1OKVJ+nbzVQmHk+7RNIFAygcgxDKACe3XKfyrkBt7TbLxcXLISgniw4y210VAC5PR5Hn PrdheINK8oC8/glFDPZINr0CjIC+Q7m7MHaUP22NW9w+0JTVnxRQ4sN6S/k4g11QaATO 4FzA== 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=weLFlOMjPLE1Zw+PyrhvA1uXSZ8aXteem8HzLQdoyFA=; b=ai/LUkcM5u80jjN2XVmOy+f8udCHHtqCWCksJMQNZ5qp5qP4JRi8fiooS+pFTNg0B6 y2j6dMC7jG/qO6edpt4JyNRhZkSsmIz/ueCjSb3keaVzn7E+1QAifBJ9YSxU/7VtdnhJ cBsJxRc/MDWu+mYcRHwOyC+T0LNB8L2fC/qDGMF9+7SnQJ9D+JT0zRcBB6dPh9/Z4xKf Wcyit0RKTAFNgOIpEn5NYTQxOxjNbj/jNJ0G3EcWMi2Z3zjOxpDsfG/24h/4eXBu7BS9 iX2xs/cMneB1cyW8WZqVxwKHFERN+ofHPQAIcesv+dQYLmn9o0CvhhYd1lhOoa95O4rl NnPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EvKr9cJI; 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 x9si13099872ilo.119.2021.05.31.08.55.36; Mon, 31 May 2021 08:55:49 -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=EvKr9cJI; 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 S234343AbhEaPzB (ORCPT + 99 others); Mon, 31 May 2021 11:55:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:56262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233989AbhEaO3g (ORCPT ); Mon, 31 May 2021 10:29:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CED0C61C29; Mon, 31 May 2021 13:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468914; bh=WEChJ6jb79usMwhfXxnCXY+Floj+im3Lq2Q0hut9XTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EvKr9cJI9Ic8HiVaAd8GVHqTGLJqJavm9iG5BXftCiom+yrvpNm+mpoNHd+dCq5AX xZXuQ9kouT59/JFQ4T1KMUhgK23WmIR7F2o4Oh6W3GU2Y9E9e4nbziwUzGeWe0NRSu ujFjUwitBmA4i3JENEpZX8rT6hcwDlL+fyto5ZcM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Chunfeng Yun Subject: [PATCH 5.4 177/177] usb: core: reduce power-on-good delay time of root hub Date: Mon, 31 May 2021 15:15:34 +0200 Message-Id: <20210531130654.044538261@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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 @@ -148,8 +148,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,