From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA218C433ED for ; Sat, 10 Apr 2021 01:21:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 844C3610FB for ; Sat, 10 Apr 2021 01:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235396AbhDJBV0 (ORCPT ); Fri, 9 Apr 2021 21:21:26 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:43271 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S235215AbhDJBVZ (ORCPT ); Fri, 9 Apr 2021 21:21:25 -0400 X-UUID: 0552d5ee4a19427dba5c0f3cce0da988-20210410 X-UUID: 0552d5ee4a19427dba5c0f3cce0da988-20210410 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 786209695; Sat, 10 Apr 2021 09:21:07 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 10 Apr 2021 09:21:06 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 10 Apr 2021 09:21:05 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Alan Stern CC: Matthias Brugger , Chunfeng Yun , Nishad Kamdar , , , , , Eddie Hung Subject: [PATCH v2] usb: core: reduce power-on-good delay time of root hub Date: Sat, 10 Apr 2021 09:20:45 +0800 Message-ID: <1618017645-12259-1-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.18.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AB17C433B4 for ; Sat, 10 Apr 2021 01:26:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E166B610FB for ; Sat, 10 Apr 2021 01:26:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E166B610FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=rviBUSLQkU+2N+rba9AD70bHbXok24wsxqHQUujS0vs=; b=JCe7sMN4O2fuLnzes1nwvSyf2b Z+hxwh6apBABugyiXABJ/K1VBTkpDZt1UN3mD2cjLW9+zdy+EK6L4AdtTA+Bo5FWtfza7mCeX0VzF At6qV4uJMNRfND87TNmzzNWt3g2FIa8Dem0fIUGk8zAGQnK9ZhKDJm99VFf4Wzdk2918h8BM/zGyD NICG2FBgMIyN5uT1k7VDTefOIJqlM9AxnA9MncneOhR9pD62S7MkIilAl3JESIporaEQqu3dj6IMG 38hBIbzLARoKX3IdTlu6+rSSOiiq21AUyIQ7kDEwCxBULIlBuzU4mKO/tWao2qWg70pEf2EMEONrj FUQmEjOg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lV2NM-001sny-Hl; Sat, 10 Apr 2021 01:25:48 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lV2JK-001sfK-AF; Sat, 10 Apr 2021 01:22:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=eSV9W+d2HonQq+QA+as9ZChPqmr9dfCnLH6HIUPh0Xw=; b=3CzVEbR3wsZgCgGKEuMh5L+CJF 5OLyKV5ZxuUz+YeXOmiCdT4zg6HisKi27+O56vJUHh7GyOYu144xV3VttWOejuicn/m36F5S0F4I9 ZyfsucRnph2xr/5Pz8au2IE3X6rzAcxUL5/sg25Fvy//NYloRC9ndcgPQVJ3OVV0UyOyTSIHrSVYi S8x8/H5SDh1ES2cscEuhzvak7yFcEjfUwCxjTA1e4ZzrRNeUqt2DIMMrBxAxxMBFYwJUtaIez9mtc F05oeRYeymUEUmwBPK+PwV2t6WJ9DkHh6QLF3HhSlT+EeIko8ZRrf5mk2PD0zmdxb4YPu5axS9qpH MLC4XtTg==; Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lV2JF-004tXK-06; Sat, 10 Apr 2021 01:21:15 +0000 X-UUID: 43da90498b6d484b9bced8be62dc2da9-20210409 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=eSV9W+d2HonQq+QA+as9ZChPqmr9dfCnLH6HIUPh0Xw=; b=PUseswUG6+OTQcZkAfwYQoesy6+itdjeZ9k9eN+tEkUFVwZwzG9wIEFFXoL9n74aAHhXnzGdhXkVbdFXp4dw2zkrs8gabMfKEn0cRByP5+fE/bxcpB2HkbfU9/jEHw/lHbI706L6Kok1dLwbtSq3VoGBfT8+zqzF2Jrw6zE4H2E=; X-UUID: 43da90498b6d484b9bced8be62dc2da9-20210409 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 339507578; Fri, 09 Apr 2021 18:21:08 -0700 Received: from MTKMBS06N1.mediatek.inc (172.21.101.129) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 9 Apr 2021 18:21:07 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 10 Apr 2021 09:21:06 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 10 Apr 2021 09:21:05 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Alan Stern CC: Matthias Brugger , Chunfeng Yun , Nishad Kamdar , , , , , Eddie Hung Subject: [PATCH v2] usb: core: reduce power-on-good delay time of root hub Date: Sat, 10 Apr 2021 09:20:45 +0800 Message-ID: <1618017645-12259-1-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210409_182114_477780_2EFECE76 X-CRM114-Status: GOOD ( 12.07 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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, -- 2.18.0 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49E1CC433ED for ; Sat, 10 Apr 2021 01:30:55 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7E6F610D1 for ; Sat, 10 Apr 2021 01:30:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7E6F610D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=A/dUqNVtG5tL7g/B7idA5ErFEL5uIcfehDvuaMWQX5s=; b=U6tDpb1vx3DGE176nI38cLa/Oc vudMqVIU+2NYGM9H/AA0MvmZjaQT3mSdOJdadUatmz/PmZAwbBCiYjD9oX8jC08o2qkJpOjaVJXB7 FcAlq4a6+YqOP9Y7FgsB9W7o30zjeIo5Elnv84lpW9PF085yidhkpfmIaUx8vmhQf6XME7bNX/TTa iKgo2JARUeC9XeS9GN/xx1tYbCzh9tFxCEG8iK9Hcc5VDRq9A0AP73thl8IrZtc2JTpBrdTczrucP T78VZiqyyThpVZ/JZ+Yu/3H9DBDowiUWF59W/SdAxD0AB51E+u3rHzkS9jqQgGlZYS6060+EaSYCl s+MDDzHQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lV2OT-001srr-HG; Sat, 10 Apr 2021 01:26:37 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lV2JK-001sfK-AF; Sat, 10 Apr 2021 01:22:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=eSV9W+d2HonQq+QA+as9ZChPqmr9dfCnLH6HIUPh0Xw=; b=3CzVEbR3wsZgCgGKEuMh5L+CJF 5OLyKV5ZxuUz+YeXOmiCdT4zg6HisKi27+O56vJUHh7GyOYu144xV3VttWOejuicn/m36F5S0F4I9 ZyfsucRnph2xr/5Pz8au2IE3X6rzAcxUL5/sg25Fvy//NYloRC9ndcgPQVJ3OVV0UyOyTSIHrSVYi S8x8/H5SDh1ES2cscEuhzvak7yFcEjfUwCxjTA1e4ZzrRNeUqt2DIMMrBxAxxMBFYwJUtaIez9mtc F05oeRYeymUEUmwBPK+PwV2t6WJ9DkHh6QLF3HhSlT+EeIko8ZRrf5mk2PD0zmdxb4YPu5axS9qpH MLC4XtTg==; Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lV2JF-004tXK-06; Sat, 10 Apr 2021 01:21:15 +0000 X-UUID: 43da90498b6d484b9bced8be62dc2da9-20210409 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=eSV9W+d2HonQq+QA+as9ZChPqmr9dfCnLH6HIUPh0Xw=; b=PUseswUG6+OTQcZkAfwYQoesy6+itdjeZ9k9eN+tEkUFVwZwzG9wIEFFXoL9n74aAHhXnzGdhXkVbdFXp4dw2zkrs8gabMfKEn0cRByP5+fE/bxcpB2HkbfU9/jEHw/lHbI706L6Kok1dLwbtSq3VoGBfT8+zqzF2Jrw6zE4H2E=; X-UUID: 43da90498b6d484b9bced8be62dc2da9-20210409 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 339507578; Fri, 09 Apr 2021 18:21:08 -0700 Received: from MTKMBS06N1.mediatek.inc (172.21.101.129) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 9 Apr 2021 18:21:07 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 10 Apr 2021 09:21:06 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 10 Apr 2021 09:21:05 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Alan Stern CC: Matthias Brugger , Chunfeng Yun , Nishad Kamdar , , , , , Eddie Hung Subject: [PATCH v2] usb: core: reduce power-on-good delay time of root hub Date: Sat, 10 Apr 2021 09:20:45 +0800 Message-ID: <1618017645-12259-1-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210409_182114_477780_2EFECE76 X-CRM114-Status: GOOD ( 12.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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, -- 2.18.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel