Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp498837pxb; Wed, 14 Apr 2021 22:42:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiulRXXM3tPUWpsyNyqwimlGaJ6LxASOEPwtglNnrkQFAiIhmbnUU9nwHLT7FLKkIYV0iP X-Received: by 2002:a17:90a:f2ca:: with SMTP id gt10mr2000248pjb.231.1618465335375; Wed, 14 Apr 2021 22:42:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618465335; cv=none; d=google.com; s=arc-20160816; b=W9HgkYygkhBtgQ7KTj539n/s7q2jjWIZrzal+Z/URn/gJgzD5NmOmiq61oVL+xdTb5 G3Q2GriaM4pyWDz5b9WjnnFhJQPymXzM483BqLYlNmkdrf58wRyTBX772beDs1SvHV/p Xil7xRZpDMjLUrLBYEXPoE0VLRibnbv7xZX1nDo/XzHbZDkDxbufphGhWfKlhP5CcjAj eAPhobR5xCElJd0WZRxcuaF2iChlt/lcHeWNUH0phke2ydOGwea3T4E8+opnooQHWP2L FP+st9PUuqDGSGsnTLMmTxp49x0W/H5KFI3+WtW+LUA3y98tEJh2+M16j1tNwkyhSSn0 /8Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:from:references:in-reply-to :message-id:date:dkim-signature; bh=HObNr0bRrlepwZxo138MCsPwyWtl1dvkY6jgP2L0x7Y=; b=IKbph7OMw96GM2ImPaqlik7IpwnIR2czbKefsME/E8EUZ+x7ZBF2MPGdWTx+NW/9Hs rttJNynY9VPirqLOhJC8a6P/RbyfjcCF6j1GMX3sizX+uRawZru8601KcJwnoPkDTUEn hZvLTeHlhXlTANGECqXqvdxSApyUe34RfgcBjWnyx9WBMf/4IU0ezrfwW2g+or967Fwf 50WdDdole6dmRmuNIcqGNhIZFh0BslG9Nyz9/VK9uNvsJ393h3pW3CqfKKHluMep8hAR W305sW1bSrY+8e1T8i90eFMdSfLn/S946LujyCF8eApRosb95+E2FBzN7pYMAB0NA2ru Foqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=mGQpHIWr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si2059319pgp.127.2021.04.14.22.42.03; Wed, 14 Apr 2021 22:42:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=mGQpHIWr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230479AbhDOFlY (ORCPT + 99 others); Thu, 15 Apr 2021 01:41:24 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:53780 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbhDOFlX (ORCPT ); Thu, 15 Apr 2021 01:41:23 -0400 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (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 248AAC0619; Thu, 15 Apr 2021 05:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618465261; bh=d87QjhQf/cs9tD6ioQrtQbqw59Z9zhbJBKqLhxDVfus=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=mGQpHIWrv83OyuZKlCGghm8+EYtOoh/04NVLNzYbtNCdwxZ5zZ24b5b3VJ9cTS0js eGa1PRIL1ebm2Q5EwMpQI/ru8oHK1M/LHR9XEiF1QzRLi7h2r4H+dlnEGbX1EI1oJY 3AuwiZApHzlQY2uUyijl7GT6ExEjykVovNuNQBd0+QU0erAf6qjDA2hI8NVbREtgJ7 B+T4ttpVvLO5Pk6INQ+TjuXE3pxCDAgPqLh8Siz7PBoOGKZfi5K8jG41RFy/0Rd3bS kskUmBuxLO0xekKDHbAJ9zQTOAoqoB0AnKhqbs3Iq6qiKEDKMgP0nBqFqhM4OS22No 2TLYoLIaZy3Qw== 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 2DC7EA005C; Thu, 15 Apr 2021 05:40:58 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Thu, 15 Apr 2021 09:40:56 +0400 Date: Thu, 15 Apr 2021 09:40:56 +0400 Message-Id: <59963c145b78ce9677ae66c33f84720480bf6882.1618464534.git.Arthur.Petrosyan@synopsys.com> In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH 12/15] usb: dwc2: Add hibernation exiting flow by system resume To: Felipe Balbi , Greg Kroah-Hartman , Minas Harutyunyan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: John Youn , Artur Petrosyan Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adds a new flow of exiting hibernation when PC is resumed from suspend state. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index db8eb1940d17..c92307775863 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -4470,6 +4470,16 @@ static int _dwc2_hcd_resume(struct usb_hcd *hcd) set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); break; case DWC2_POWER_DOWN_PARAM_HIBERNATION: + ret = dwc2_exit_hibernation(hsotg, 0, 0, 1); + if (ret) + dev_err(hsotg->dev, "exit hibernation failed.\n"); + + /* + * Set HW accessible bit before powering on the controller + * since an interrupt may rise. + */ + set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + break; case DWC2_POWER_DOWN_PARAM_NONE: /* * If not hibernation nor partial power down are supported, -- 2.25.1