From patchwork Wed May 23 13:26:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Petrosyan X-Patchwork-Id: 10421269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 69BF660327 for ; Wed, 23 May 2018 13:25:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 558B428FBE for ; Wed, 23 May 2018 13:25:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A30728FC6; Wed, 23 May 2018 13:25:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7414928FBE for ; Wed, 23 May 2018 13:25:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933004AbeEWNZ4 (ORCPT ); Wed, 23 May 2018 09:25:56 -0400 Received: from smtprelay.synopsys.com ([198.182.37.59]:54257 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932845AbeEWNZz (ORCPT ); Wed, 23 May 2018 09:25:55 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 101E11E0433 for ; Wed, 23 May 2018 15:25:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1527081954; bh=SFuJdDnH+0oFtMlysq+QkSFfqDx8tn5wCneRhEPLV/E=; h=Date:From:Subject:To:CC:From; b=bJYWxeOogKEirSBNSb5RZZuI5uHN3h/VUNU2EaLPjYUZ5OTtciST0bCMXWElKp68E W6ktsk3QwnZsYnNLbxH0vbMRtYnf4OcM4Casu7+O1dbuBmYkYODQXYEWEZKMvPBuMN qrBXxnaHb1/rFiNvMJ/eAYDimFtDf5sVk+PLWv5Vh6V6lLprGBiCDyAVcRxhpnrgf4 OCBd9Mv/vT9AlKsLFTaIUpBddCzG1b8Ife1ZIORY2ZE8hXHisCHYBegUdhDwJ84IAL 2MMp3sRgWJYTGZpYs9PxkGGxe2t3znrRFnkQprhtHwtTAq+2scy9DRSZhBKGSeRh5H l2SKuXN0NY13A== Received: from us01wehtc1.internal.synopsys.com (us01wehtc1.internal.synopsys.com [10.12.239.235]) by mailhost.synopsys.com (Postfix) with ESMTP id 5F0DF5605; Wed, 23 May 2018 06:25:53 -0700 (PDT) Received: from US01WEHTC3.internal.synopsys.com (10.15.84.232) by us01wehtc1.internal.synopsys.com (10.12.239.235) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 23 May 2018 06:25:53 -0700 Received: from arturp-ubuntu (10.13.184.19) by US01WEHTC3.internal.synopsys.com (10.15.84.231) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 23 May 2018 06:25:51 -0700 Received: by arturp-ubuntu (sSMTP sendmail emulation); Wed, 23 May 2018 09:26:08 -0400 Date: Wed, 23 May 2018 09:26:08 -0400 Message-ID: <158187bd06c39f2630a98f604e9ca228d693c95a.1527081875.git.arturp@synopsys.com> From: Artur Petrosyan Subject: [PATCH] usb: dwc2: Fix host exit from hibernation flow. To: Felipe Balbi , Greg Kroah-Hartman , Minas Harutyunyan , CC: John Youn , Artur Petrosyan MIME-Version: 1.0 X-Originating-IP: [10.13.184.19] Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case when a hub is connected to DWC2 host auto suspend occurs and host goes to hibernation. When any device connected to hub host hibernation exiting incorrectly. - Added dwc2_hcd_rem_wakeup() function call to exit from suspend state by remote wakeup. - Increase timeout value for port suspend bit to be set. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/hcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 1faefea16cec..736dcc816abf 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -5434,7 +5434,7 @@ int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) dwc2_writel(hprt0, hsotg->regs + HPRT0); /* Wait for the HPRT0.PrtSusp register field to be set */ - if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 300)) + if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 3000)) dev_warn(hsotg->dev, "Suspend wasn't generated\n"); /* @@ -5615,6 +5615,8 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, return ret; } + dwc2_hcd_rem_wakeup(hsotg); + hsotg->hibernated = 0; hsotg->bus_suspended = 0; hsotg->lx_state = DWC2_L0;