Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp498975pxb; Wed, 14 Apr 2021 22:42:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi2VP9RHmXnHxmACzEGU6BE1MhPD10Ua6Cqc9jTkF7no0xs7rPAoquSsEfYcvdPR6YEplf X-Received: by 2002:a17:90a:ec03:: with SMTP id l3mr1900738pjy.61.1618465351488; Wed, 14 Apr 2021 22:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618465351; cv=none; d=google.com; s=arc-20160816; b=RzOTVGXbeUEdhLqN1/ilGGld5HbwIUaVsvD20hwQ+3JMcL2wOMLsH/bxvbubz4wVH/ s4XrqNYdBtOrLNLw2pUDomCq+JGuUhxXAAaLUxAxBz8sVkAgM4XKgFFM/737vChsy7r+ WIv2FYhUkB4wOraFYmqdW7FWBG/wXTdz3zc4V+BydJ4Q4T8lGm9p1FHFimAs3TzAPCPo kfMBfQVSgOI/uqyf74/6eCAj9OdMaqevEf39rmYUkrJsATPYOxxI6Mm1fEcM+MT3xR9/ HKpHJtiaaBUPZz8Yo5c0wxeKkzBAss5b/SfR7GDPKavSJ6ngmTS4Kqc7PNwpGDQ7Tbco om/A== 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=yUckZFVLX5wyFxpKoYfecTNsZORJIOj5q9G4QRQMjjY=; b=DfnyXUG60Vc5DGgwZXh9fg1Yv61626/W78m01G2y9Wk9S5+oCL5PhgsEGK3Ki9xeBi CYArGdLKBYlVPxgpPF4TDqvWHE9mHeeUg3jORxUE09Laus/Rw0Z0BxZyvnE1ZuW+rA2O 1ozXc1pnLRiI8b1A64kyk+YJVr2rNfSTaXSYl3Ady8BLWCtRSd/qvNtDa/lhQtzYg8fB 0t16lONqIjpvBc/VdLbmWmlKPd8HdtfM+T6EigU6gApbz6khYeCOCyvyAs8R24qQMX7t 3ZSUy2pcMcK+UHaKJ/TQayyFWQmXfLvOV9kvVZeH1zdV8vCqWwFRk11PCGsbOlx+NsZC nyUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=X64+WLMk; 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 t3si1982473pfh.274.2021.04.14.22.42.19; Wed, 14 Apr 2021 22:42:31 -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=X64+WLMk; 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 S230378AbhDOFks (ORCPT + 99 others); Thu, 15 Apr 2021 01:40:48 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:53744 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230366AbhDOFkn (ORCPT ); Thu, 15 Apr 2021 01:40:43 -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 E7DD8C0619; Thu, 15 Apr 2021 05:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618465221; bh=qpaf+tMuC1nclK+sLtQgfWYIxBk6tVHsAlbEaJ06YeM=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=X64+WLMkkDO2RIGGRdFTTT1PgYTEwOjayyv60BDpM+Oa7bxzC5wBCQzxic06KURxF epHeEUSdfNcUqjbfH3IeoDomMD7HFZCxfgz5KDd0stfrS3SbzhVxuTspdJkkI75FD/ P677vIBf4z3OVJ6WlGco++kJ0ZdXgscMOgChaE5dK9PEiT5Is/mB77FK5b+uHzHYb8 GjoX5csDdfs8LGxxRnHTKc7LVXiOkp7yadLe3Vll827dhchX3/S5r+hMLxs7fbqzyi LcmiwnTPruYamWdt+1gsB2genWjjl+j1cI+zjKrU5nu8tFgqD+jF8xY4JD0RGNkZsw 1vYPcxDqKERnQ== 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 EBA62A005D; Thu, 15 Apr 2021 05:40:17 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Thu, 15 Apr 2021 09:40:16 +0400 Date: Thu, 15 Apr 2021 09:40:16 +0400 Message-Id: In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH 07/15] usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated. To: Felipe Balbi , Greg Kroah-Hartman , Minas Harutyunyan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: John Youn , Artur Petrosyan , Minas Harutyunyan Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When hibernation exit is performed the dwc2_hib_restore_common() function is called. In that function we wait until GINTSTS_RESTOREDONE bit is set. However, after the setting of that bit we get a lot of (dwc2_hsotg_irq:) interrupts which indicates that (GINTSTS.RstrDoneInt) restore done interrupt is asserted. To avoid restore done interrupt storm after restore is generated clear GINTSTS_RESTOREDONE bit in GINTSTS register. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index eccd96fa164e..576c262dba55 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -299,6 +299,12 @@ void dwc2_hib_restore_common(struct dwc2_hsotg *hsotg, int rem_wakeup, __func__); } else { dev_dbg(hsotg->dev, "restore done generated here\n"); + + /* + * To avoid restore done interrupt storm after restore is + * generated clear GINTSTS_RESTOREDONE bit. + */ + dwc2_writel(hsotg, GINTSTS_RESTOREDONE, GINTSTS); } } -- 2.25.1