From patchwork Mon Oct 25 11:42:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12581519 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 522C5C433F5 for ; Mon, 25 Oct 2021 11:42:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 369B56044F for ; Mon, 25 Oct 2021 11:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233191AbhJYLox (ORCPT ); Mon, 25 Oct 2021 07:44:53 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:21537 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S233190AbhJYLot (ORCPT ); Mon, 25 Oct 2021 07:44:49 -0400 X-UUID: 4577476c31e343fe8032adcd60fde2fe-20211025 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=5Z+pVIUsnwczbSK4PAQNtN2qL8Rf6p3/4/bd0Nz7Kl8=; b=c+xauU6inVHKw+IUzOmb1CvG8W7jRQBoo8dKA1Cshc7thXUeBD3lOoH4aPKb7G+QMM5s4v2cEXvw3SlTyB3AZbBZ4sQmHpUH5GixA3vS2xPi0pkQ1iwl//yWqkCAxSKLwJ2u32iM+qurMF7Dgh6CjkZ1iRYMWHDuTA+U9zbsrDo=; X-UUID: 4577476c31e343fe8032adcd60fde2fe-20211025 Received: from mtkmbs10n1.mediatek.inc [(172.27.7.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1606625707; Mon, 25 Oct 2021 19:42:19 +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; Mon, 25 Oct 2021 19:42:20 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 25 Oct 2021 19:42:19 +0800 From: Chunfeng Yun To: Mathias Nyman CC: Greg Kroah-Hartman , Matthias Brugger , , , , , Chunfeng Yun , Yun-Chien Yu Subject: [RFC PATCH] usb: xhci: skip re-check pending port event if hibernated Date: Mon, 25 Oct 2021 19:42:09 +0800 Message-ID: <20211025114209.4047-1-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.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 f3dabd02382c..a7a2bf5bc208 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); }