OSDN Git Service

usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated.
authorArtur Petrosyan <Arthur.Petrosyan@synopsys.com>
Fri, 16 Apr 2021 12:47:38 +0000 (16:47 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Apr 2021 09:55:34 +0000 (11:55 +0200)
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.

Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
Link: https://lore.kernel.org/r/20210416124739.D6269A005D@mailhost.synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/core.c

index eccd96f..576c262 100644 (file)
@@ -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);
        }
 }