Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp345480pxb; Fri, 16 Apr 2021 07:09:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCbJ/lf78RKGJATnw7sit5WP0/lYb3AleheMDhGDKLocX8W8Ev82tjHoeLxXwoKPqPbXh0 X-Received: by 2002:aa7:d48a:: with SMTP id b10mr4854256edr.202.1618582185725; Fri, 16 Apr 2021 07:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618582185; cv=none; d=google.com; s=arc-20160816; b=O7c6xJuAV3FwSI50DsqJNccgS9H5afOqHbAIgmCvXqtyZLAUe8hd10YRMzsFtPSywN J1JjX1+Co4dEfvFuc9QX54DohELn8kZZN/EzrB/QHY541EWYLdvUkNfjA+c/R0FCpEOB TDFqCInRP3DkCclHg36uLo+R1oKZuKI2VT59UrdydBVebz3gqs+NYZTBY6ntU3wSDdUH pNVcN8B+/Vvf57qHW9yiQUe1ku1Uavjs3J+HXdbR/oXNBCYItqhxRaTVA1reE3q4CD7d Ed6Lx9iaF+ujgUM8RBEKAkie3s3Bqc4YJhIxyiq/1DVHxqsmja5zCuxg9y3XRVkJyfZO yTTA== 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=yUckZFVLX5wyFxpKoYfecTNsZORJIOj5q9G4QRQMjjY=; b=PRJcqUs0nq6h+TMTyn+MtU7PuTP/dCgx10c7evHKePhA6yMz7pfx46lUrNlkGLcCsa x+JCWjDdsv/xzO80oGfFOlq/VvWDj9pFCadtzOr9KhaKWUsZ3YQqzLmd1NMmIAjRrDKI wdIEkeppiBPcqkSeNPWXwwDiYhCfRG3rESlA17tDhTjJR4S7i+xeBAizT97oxp+eVt1D NFGNfesIgnPH1NfO3e/uZsh+aH+0HKVToJ3kMuTDL19HNaMr5ewur7aR+PL9INyVPTyh XlNoVil/Ta7fTxdsKeydo9g0STYumpYAeIEHbVgbuPsz6RGopLK7aOUF6+5pRMAXL6yo 165A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=TbkfQBEv; 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 e16si4608763edz.7.2021.04.16.07.09.17; Fri, 16 Apr 2021 07:09:45 -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=TbkfQBEv; 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 S243659AbhDPMsJ (ORCPT + 99 others); Fri, 16 Apr 2021 08:48:09 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:38442 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243210AbhDPMsH (ORCPT ); Fri, 16 Apr 2021 08:48:07 -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 B70AC40E1C; Fri, 16 Apr 2021 12:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618577262; bh=qpaf+tMuC1nclK+sLtQgfWYIxBk6tVHsAlbEaJ06YeM=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=TbkfQBEv7GH3Cc6yenAHyky23RYsWm7GCjW98q5F9RWUcNZQjY9s8EtZf9NfrEjai CYecdLHtgdtQPu2bO988DeJJXo7lAHrC2U9iM3z5YKRshFoo0fOpoXufF2ONvhrg5O QE9HUamcQVXhz9n/6BT9zy6NgPrLX6GC3IL7kie1kYMeHmMW7nMdwOu8XbaF+PMo/z y1tgPs4icLhpSwQu5QB97QAAxj7bG4bKgUIju1A63/8t30cOM/WZ5Prur2QrcTlLeE ouPQy1wk3i/C6ZXHS+4s+N64C9FjoXRhlW+7YcqF0XZEmTlOTj8k2nmfrPSbhxZQiH UZZ7epruoqd3A== 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 D6269A005D; Fri, 16 Apr 2021 12:47:39 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Fri, 16 Apr 2021 16:47:38 +0400 Date: Fri, 16 Apr 2021 16:47:38 +0400 In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH v2 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 Message-Id: <20210416124739.D6269A005D@mailhost.synopsys.com> 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