Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp344420pxb; Fri, 16 Apr 2021 07:08:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9f0FGiRKM1FD0wJce0pLcaSFxPwZGIRmvqp7+F/VYVJCnWM66kZ4yPDf1IFEsvV0numUS X-Received: by 2002:a17:906:3949:: with SMTP id g9mr8595616eje.7.1618582109187; Fri, 16 Apr 2021 07:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618582109; cv=none; d=google.com; s=arc-20160816; b=BoLq2w/5UZnam2SzXrhduqMRGRW/09xSHqV1tliC4HKYqd/aMfdp2nd7R4tXodH639 xQNO9Z1vIls41TUXebn96C+B3VZcS3AU8KPvOlsDqSfB/qqLw+vVg/UOlS1BXwMDUSjn hHevoJu3/V5OiJOfL7UXgNih01G/4e/F8sEtX5AkWlLxl1ZBoLSsDum0Dv9VqFRM36xX r4vUVhWXB1oFwSDVDospHdRnBv2nrgP4r9C9S2z8YeuK8BYLvJTfdc/URL1wzplS0dcc r3mTGv/qGSZtfddWpIRuN+1MG2A/EpdxKpw14S19bLExeVPzxaWajeY8/q4g3TbsiqpM F6Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:cc:to:subject:from:references :in-reply-to:date:dkim-signature; bh=9r878gNyY6ZQZHjCxyZ1/7+9iYu7wFy1pvl6JHo9WSc=; b=s2DZaeFyMkhmL0RaGiPBc8M1E+2G0JKYY5SXG42SMnl/e7QEh0q+PnAEvqXkDb0x7S XaW6Vqb24lnHhdPg/vv5/MZCbMmuQx6cLpej1T8ZUg71u/0hZ2jJpCjRcENiY21TzT4P rG4dGTXqguS7ifIe7gBnq6ilr+2YStpc4aYAfhhMLYBL34JYgGKzEXYxYCssZ3kTf9Eq kJ49Ozw3GD6l+SXH/EnoaGCJBiSg4GNAUTQWYW+N9OCllXedEZvwS/9NnayB/ZtHi2PV lLcWpjPriYYP2jd/aT9X6EQ/WgSFehnzIkrYFWcrrIs62jv1iR65dV+ux4WHwazgc3F0 aJug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=BFoO2Bfr; 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 q6si892355ejn.673.2021.04.16.07.08.05; Fri, 16 Apr 2021 07:08:29 -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=BFoO2Bfr; 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 S243705AbhDPMsY (ORCPT + 99 others); Fri, 16 Apr 2021 08:48:24 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:42280 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243684AbhDPMsX (ORCPT ); Fri, 16 Apr 2021 08:48:23 -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 BC6FEC06B9; Fri, 16 Apr 2021 12:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618577278; bh=QzqNN1TpnnJZcO/RBKPeEftrEV02egBMMrN3BOE/mQM=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=BFoO2BfrenU3EDAhdv53IFPveQpjJbnsaZgUvc+ZN540gFIPtVFeDUontVj+zmtHI g66VtL86UPNbAO9PRTqBsQwnsNXI1MIf0FQG7qU3Vpn6Vy8HgbwR6dNp3vujLajeaX lSe9a91S+LUan7FFtWQEwnhB2pXwXN7Zu0dnHvn1s9+6teq6G4CUZlEqJ5DD8S2OIA q58XRZ2GLXx6FQ6YBYucMThfnkWq5dZy4u4nAdge9e0o9r25RKBi09vLJEK8J71jiX wCjtMYVyYfVmwR+wUew6eG3tPVRJJ8p+bRAh7KO37TCXdmHKA/EU5rgQ6jUVi1CbBC Oh2Lm5uEfZ3AQ== 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 E47F3A005D; Fri, 16 Apr 2021 12:47:55 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Fri, 16 Apr 2021 16:47:54 +0400 Date: Fri, 16 Apr 2021 16:47:54 +0400 In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH v2 09/15] usb: dwc2: Move exit hibernation to dwc2_port_resume() function To: Felipe Balbi , Greg Kroah-Hartman , Minas Harutyunyan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: John Youn , Artur Petrosyan Message-Id: <20210416124755.E47F3A005D@mailhost.synopsys.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This move is done to call hibernation exit handler in "dwc2_port_resume()" function when core receives port resume. Otherwise it could be confusing to exit hibernation in "dwc2_hcd_hub_control()" function but other power saving modes in "dwc2_port_resume()" function. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/hcd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 43a2298b7d42..cc9ad6cf02d9 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -3383,6 +3383,11 @@ int dwc2_port_resume(struct dwc2_hsotg *hsotg) "exit partial_power_down failed.\n"); break; case DWC2_POWER_DOWN_PARAM_HIBERNATION: + /* Exit host hibernation. */ + ret = dwc2_exit_hibernation(hsotg, 0, 0, 1); + if (ret) + dev_err(hsotg->dev, "exit hibernation failed.\n"); + break; case DWC2_POWER_DOWN_PARAM_NONE: /* * If not hibernation nor partial power down are supported, @@ -3446,12 +3451,8 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq, dev_dbg(hsotg->dev, "ClearPortFeature USB_PORT_FEAT_SUSPEND\n"); - if (hsotg->bus_suspended) { - if (hsotg->hibernated) - dwc2_exit_hibernation(hsotg, 0, 0, 1); - else - dwc2_port_resume(hsotg); - } + if (hsotg->bus_suspended) + retval = dwc2_port_resume(hsotg); break; case USB_PORT_FEAT_POWER: -- 2.25.1