From patchwork Thu Dec 9 07:22:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12695456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 631BDC433EF for ; Thu, 9 Dec 2021 07:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=YGH2SbTsWVIREQcT+zJeMZAf6L4L+MCRqCMme4m4okM=; b=IbELf/CiN6FhF9 tQkkDAYE2mzl9Kme784V5S0AhsJuay2DGOik8B/Mj/BoB/5WUF9Ji7NJfm12GY6Yuc3ZssUzJg7wv 9XHn5HTt8grD3fTgTmYwIx2nviEjZPS+k4I+X4aMIdv0XsnHJL7Hu9VOC76Mn9abI1OTKG+GqukbA BHeIbJ0SE1eED7aj1NCgot/tIYbeRnzXhusCTGErjxgSQ3YV+TO7Km38OQJFAsBZnFhFu8Dv1oZjq mG3OrHKMWPMno2sjlsQf2QVZHztiqKg5xNd4WIxc4VJ4gAbaWQjlxuC4r3rr+mkfMFznS9O7UPSNl 1+3GxSZratKMJ43CrN1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvDlA-00F8am-1u; Thu, 09 Dec 2021 07:22:32 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvDl4-00F8ZH-EZ; Thu, 09 Dec 2021 07:22:29 +0000 X-UUID: ddc741205b664e25a51a39c8b68b9cfb-20211209 X-UUID: ddc741205b664e25a51a39c8b68b9cfb-20211209 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1426974652; Thu, 09 Dec 2021 00:22:22 -0700 Received: from mtkmbs10n1.mediatek.inc (172.21.101.34) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Dec 2021 23:22:20 -0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Thu, 9 Dec 2021 15:22:19 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 9 Dec 2021 15:22:18 +0800 From: Chunfeng Yun To: Mathias Nyman CC: Chunfeng Yun , Greg Kroah-Hartman , Matthias Brugger , , , , , "Eddie Hung" , Yun-Chien Yu Subject: [PATCH] usb: xhci: skip re-check pending port event if hibernated Date: Thu, 9 Dec 2021 15:22:18 +0800 Message-ID: <20211209072218.21651-1-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211208_232226_517011_629FFC5B X-CRM114-Status: GOOD ( 11.02 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When xHCI controller hibernated, the root hub lost power, if controller support Port Power Control (PPC), PP is not set at xhci_resume() and set by hub_reset_resume() later, so no need check pending port event. If PPC is not supported, device is disconneced, seems do not send out U3 LFPS wake signal, no need re-check again and drop 120ms delay to save resume time. Reported-by: Yun-Chien Yu Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 902f410874e8..686d8e6f03f6 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1235,7 +1235,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) * the first wake signalling failed, give it that chance. */ pending_portevent = xhci_pending_portevent(xhci); - if (!pending_portevent) { + if (!pending_portevent && !hibernated) { msleep(120); pending_portevent = xhci_pending_portevent(xhci); }