Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2638820pxb; Tue, 13 Apr 2021 06:48:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfhQmH0uRb9r/2WRukrducBwt/Oor08zdPxIWVQO/PwRf/p3uZcWFaxN8NYgf56g5JTpn+ X-Received: by 2002:a63:7a07:: with SMTP id v7mr31816869pgc.26.1618321735662; Tue, 13 Apr 2021 06:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618321735; cv=none; d=google.com; s=arc-20160816; b=rfx4OgmD93rU6g/3LGIO8tZMqSnWUrnUTjXGSeuyJ41kSA9X1B/38moEbNGWTH3YhO digwL6/li9HbPFXvBOxIVxT2rzUts+cTA7xt7SIDcPFlX5atU49HrJMd0lvaRCPTMJlm 6SnJ4eYVN7JjbAflFP6Hi9AL+U83GhicKeO01esXRM3j+YFcYQHAMgOXuUpAHB3PWx7J ksuv+z2p4rVbwDtc9OaLLclXvx+s5GTu3tjTVahkN3snou8SAWXPBeGqcyVWpS5aL7Q2 BqSoZG2/cNFlCI3nDuzvbYelHTZyIDpQila21o/s9ZbUycdV6hn9JaZf+g/Sff50cFOl Rezw== 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=G2X7sS9BC8U8oUru+lOVm8SyVbBJEy0Kh2tHwQ7ZROg=; b=N5dYAvb9EdOTNfgGyQcY/4/zd1Ki7Q41vkFADx6WXTcFWI+cMAHRcsTEqNMcLMXVQa NZd/fZaEXtUVYYCuYRGAK4cESg96SZ/75J4HPBd6FkikoSsTtIJARg5NyCQlIbsaiy1I hsOF58lRk+1wWR0ITwdbGzMQLNoFA216APO3qTOzG3JY9Br4il3c3ulA03OrU0WOMANE ggC4EuKyryYJPh8OR6+KrB/Ml9i7MXd6IS5vps0dltm3fQMYVNK0cKhCR23rr6qz47jC 9VzvSEeGX5Wix8HLaRKlrY9Cym98uO+mVnXyuLoR6VuHKz11+/z4Vm+xQgHhBpIISHII vm5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b="CwL/0OSU"; 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 e17si16305189pgg.123.2021.04.13.06.48.42; Tue, 13 Apr 2021 06:48:55 -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="CwL/0OSU"; 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 S240736AbhDMHhI (ORCPT + 99 others); Tue, 13 Apr 2021 03:37:08 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:60522 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240497AbhDMHhB (ORCPT ); Tue, 13 Apr 2021 03:37:01 -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 4FA91C00BB; Tue, 13 Apr 2021 07:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618299401; bh=dKhq2iqRjrY0N9i7U4VKo0N5zELnYfh/gudC2BsyoPY=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=CwL/0OSU1z55QZ4bJIcb7kdUWokwGxr7dS43AXvMlfCC2lW3S00PyGjHFGVkBcadH GJBqz3V24hvCnYUkw2HnoC/Wt5XdH4NhfpMCZMrQc5IrfaFuyORI4zod4KT7/HsHMD Es2jPpwepXwsFp1XFNDJSzSktMgd4TqWaBaeFuDtcxSZQsV1500Z0HEMR2hvVqHfxU 9I5UICyWkkWTZOt+JYjiV70fHP/OSDSqw/4NXj9+Yxo6vBAYQXkzTqzqzSubnUUkJo /dledWB2x4+Py9gBJeBjgpSmcAR6GczyOQmLZ23+phhvNuntOHN7y7/pYe1lbvRnM9 6WZX7vcCcW7iA== 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 921E8A0099; Tue, 13 Apr 2021 07:36:38 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Tue, 13 Apr 2021 11:36:37 +0400 Date: Tue, 13 Apr 2021 11:36:37 +0400 In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH v2 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 Message-Id: <20210413073638.921E8A0099@mailhost.synopsys.com> 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 --- Changes in v2: - None 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