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=-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 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 BBE8EC433B4 for ; Fri, 16 Apr 2021 12:47:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91F7460FEE for ; Fri, 16 Apr 2021 12:47:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243632AbhDPMrm (ORCPT ); Fri, 16 Apr 2021 08:47:42 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:38416 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243085AbhDPMrf (ORCPT ); Fri, 16 Apr 2021 08:47:35 -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 AABBD40E1C; Fri, 16 Apr 2021 12:47:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618577230; bh=mLQKQ2urvcg7b5By6P/zbYGY78aG0gF+7Bqi25FQfyA=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=YiSGuLRVDUzQLKxoMIZxdcSn+jHSr/I7YvuCjf5LhRyBPii6jIaRdgLf8xnitc6MZ LXVySq8eW17WOaYli5qvPIXE7XadYblMIKrYUF3G1VGUixnnJlX2kYZx489DQyAHrZ YhcnQcylcsqnc+gsxwGKhWthoUDXYVV7V3GtwIxAhu/Nkm229lIpUA3XN6z0f8HcjM +98y6tJEEKANcONzsgXkvqupaK291e1hBISgdtDRM3HxxT4k0yvhCDMA546JBBUs+X BArx27MI2CY4ms77xi5cyKrwzJTpwBRMtdYm3yuaMoOjoxa9geJngHvsnL+qIH2IUR TOJAZ01vSHMNA== 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 5EEC2A005D; Fri, 16 Apr 2021 12:47:07 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Fri, 16 Apr 2021 16:47:06 +0400 Date: Fri, 16 Apr 2021 16:47:06 +0400 In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH v2 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 Message-Id: <20210416124707.5EEC2A005D@mailhost.synopsys.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- Changes in v2: - None 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; -- 2.25.1