Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2591696pxb; Tue, 13 Apr 2021 05:48:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNBkHE04O12FGVr42lxOY7eTp63PbtRoYr5t5vDDF9ZlDu+WdaqE/Bp5goch7sGbXwxuVH X-Received: by 2002:a17:903:2c1:b029:eb:3000:2984 with SMTP id s1-20020a17090302c1b02900eb30002984mr2480013plk.15.1618318110237; Tue, 13 Apr 2021 05:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618318110; cv=none; d=google.com; s=arc-20160816; b=vVG960cm62mBH6w0FAJHDkq+AQE6hnLGnXCi9o73HLNend+ILN2Hj8TAQuE9JjMhUs +CvVrqEC1ITXcsnqnEQCN0ZQTPmtCYOlriPgRJevEOsZeGWdITbIGE+Px8yQ+J2hksFW niKN4dy/SDr+macty5xar5emmbQYukYOzsg992kXbCyJLD0wuqGF4NeV1b/kv3qCbntI JV33zWthegunlGZl+S7W+xkl3d0US1Ngr4amQwOjBXxok17zmvGlInlajJWX/tAqueve BfHXTPAcpFAZJnJR6MUTW1bPRhAhJX3sp0xz62TBFFwplAgvfCfOZotouOoB1IE3OyTv 8KpQ== 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=19urU0/yV1nzHKj267g+ITYedV99nJPL1dZdc9b/o1g=; b=CNmjiZtO5u9YdVw+30XQ5oYivipwdYIUqqogGgDIBbQKf6RXXFl/60Ffa3X8XJmIWZ 0L05Eg2XSXcN5JfW05unJurMKnz2nzzoOgxA8yEBauYE6084/OSmifzLxRlWlBskmEju EQ4Mb0YPQwsnXRR32ESJuxVi4MlHXWb/3wxysDbIOwTUcUskJ2iP6d7smDTl3ioft5IL J/7k2CJ3v3BrcHx/NVtZEBJHmrkTlspy2WjvPi5tSTGVty+Ls6mmiSCHDKLz0oVLvq0O UvT529fwvjJDt3zzVoVidd89F0UXUFdLlVDatnYr9GUSuxk29+9zrZoNDA473g9/najn /7ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=adfHB69A; 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 o11si2964114pjq.166.2021.04.13.05.48.18; Tue, 13 Apr 2021 05:48:30 -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=adfHB69A; 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 S238175AbhDMHRK (ORCPT + 99 others); Tue, 13 Apr 2021 03:17:10 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:35704 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238136AbhDMHRK (ORCPT ); Tue, 13 Apr 2021 03:17:10 -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 E8D0440162; Tue, 13 Apr 2021 07:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618298211; bh=R6Ygbep4bPgdkk7o8eJrmZO+pnbepHJPMR0aZsJk8jw=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=adfHB69AL64gmDVgrBmR5srl27ChrTCA7E0urNnXZXF3bJlH4W+q8i2iN5dyCeHfS sV2cr9e6ulul9MPGND70ENnUW9JqoI66HDH0JRONcv3Y6sXGb1ItjfcLGkUF1qEnS0 dFWu6/uh7dkMVDFCKF6Yz4GpOomqSDTjsCI9d7m9FFpo52moB/8VUw5yK5C7Nl5Go3 9r2DK0r6oJph3c9QjAKbl40oi3qmShZNcvLUJu0wll84xmudVUDbsCUX9mCBc3lMux qmjvfZZKJzLj6Ea2oXJ+7gUhyXGxZql658jlTSKdJ/WZ2vdQJ+6OPJFyTnBe5Y3WRA x1rIR69NHC1fw== 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 1F1DCA022E; Tue, 13 Apr 2021 07:16:48 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Tue, 13 Apr 2021 11:16:47 +0400 Date: Tue, 13 Apr 2021 11:16:47 +0400 Message-Id: In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH 05/12] usb: dwc2: Add exit clock gating from session request interrupt 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 Added clock gating exit flow from session request interrupt handler according programming guide. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/core_intr.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c index c764407e7633..550c52c1a0c7 100644 --- a/drivers/usb/dwc2/core_intr.c +++ b/drivers/usb/dwc2/core_intr.c @@ -316,12 +316,19 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg) hsotg->lx_state); if (dwc2_is_device_mode(hsotg)) { - if (hsotg->lx_state == DWC2_L2 && hsotg->in_ppd) { - ret = dwc2_exit_partial_power_down(hsotg, 0, - true); - if (ret) - dev_err(hsotg->dev, - "exit power_down failed\n"); + if (hsotg->lx_state == DWC2_L2) { + if (hsotg->in_ppd) { + ret = dwc2_exit_partial_power_down(hsotg, 0, + true); + if (ret) + dev_err(hsotg->dev, + "exit power_down failed\n"); + } + + /* Exit gadget mode clock gating. */ + if (hsotg->params.power_down == + DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended) + dwc2_gadget_exit_clock_gating(hsotg, 0); } /* -- 2.25.1