From patchwork Thu Apr 15 05:39:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Petrosyan X-Patchwork-Id: 422158 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED 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 29E22C433ED for ; Thu, 15 Apr 2021 05:39:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0482611F1 for ; Thu, 15 Apr 2021 05:39:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230214AbhDOFkL (ORCPT ); Thu, 15 Apr 2021 01:40:11 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:53710 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbhDOFkK (ORCPT ); Thu, 15 Apr 2021 01:40:10 -0400 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 9A828C0619; Thu, 15 Apr 2021 05:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618465187; bh=LAuvakZevK94v8tt9XYT1Vjf9cbsK4oXGNWWW7dGB6U=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=JwTdhvqyrhj2Dpn9z2FzIHsuSx5rbdur0xiuXP3jZDYS866pbGVK0OM+ijcWtLd8a 7+OoCWH8MJv/Wz0qUxI7TT9Rpyy4T2feujhCaq++aym6us4DSOStgRClKjxKeDZtnX 6TC+h+hzEzF0Z+2mH9uI97d4F3nNhg+zhj4aVSzCLrJ+yBhsb+p8Vd535JQVRPFpwp a5+Oje340Nfk7YWEQ6mwLHEM9Pxk5BQuerQbM27TRBT5fTqXoNO+1GLC/I/7aADYF1 PCTSSPA+OmFrd5nZziJSvRLfRF0u2g0ACjC1mFH7hbXUf6n+y4hqX0bFcfQ8MphwbB ei0XVgQ8+7Rlg== Received: from razpc-HP (razpc-hp.internal.synopsys.com [10.116.126.207]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPSA id 68498A005D; Thu, 15 Apr 2021 05:39:44 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Thu, 15 Apr 2021 09:39:43 +0400 Date: Thu, 15 Apr 2021 09:39:43 +0400 Message-Id: <9ef7ec0b843fcf4f897bf19bfb35f5ce6761d76c.1618464534.git.Arthur.Petrosyan@synopsys.com> In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH 03/15] usb: dwc2: Fix host mode hibernation exit with remote wakeup flow. To: John Youn , Felipe Balbi , Greg Kroah-Hartman , Artur Petrosyan , Minas Harutyunyan , Vardan Mikayelyan , Grigor Tovmasyan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Artur Petrosyan Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Added setting "port_connect_status_change" flag to "1" in order to re-enumerate, because after exit from hibernation port connection status is not detected. Fixes: c5c403dc4336 ("usb: dwc2: Add host/device hibernation functions") Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index cda3f931195d..ff945c40ef8a 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -5650,7 +5650,15 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, return ret; } - dwc2_hcd_rem_wakeup(hsotg); + if (rem_wakeup) { + dwc2_hcd_rem_wakeup(hsotg); + /* + * Change "port_connect_status_change" flag to re-enumerate, + * because after exit from hibernation port connection status + * is not detected. + */ + hsotg->flags.b.port_connect_status_change = 1; + } hsotg->hibernated = 0; hsotg->bus_suspended = 0;