]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fotg210-udc: Mask GRP2 interrupts we don't handle
authorFabian Vogt <fabian@ritter-vogt.de>
Wed, 24 Mar 2021 14:11:12 +0000 (15:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:59:29 +0000 (10:59 +0200)
[ Upstream commit 9aee3a23d6455200702f3a57e731fa11e8408667 ]

Currently it leaves unhandled interrupts unmasked, but those are never
acked. In the case of a "device idle" interrupt, this leads to an
effectively frozen system until plugging it in.

Fixes: b84a8dee23fd ("usb: gadget: add Faraday fotg210_udc driver")
Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de>
Link: https://lore.kernel.org/r/20210324141115.9384-5-fabian@ritter-vogt.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/udc/fotg210-udc.c

index 6e284332b11f2a0cc12fb0ae4875bfd3ee76f845..41cc5babd50d90f86d2713349ed8369e7c569cb9 100644 (file)
@@ -1030,6 +1030,12 @@ static void fotg210_init(struct fotg210_udc *fotg210)
        value &= ~DMCR_GLINT_EN;
        iowrite32(value, fotg210->reg + FOTG210_DMCR);
 
+       /* enable only grp2 irqs we handle */
+       iowrite32(~(DISGR2_DMA_ERROR | DISGR2_RX0BYTE_INT | DISGR2_TX0BYTE_INT
+                   | DISGR2_ISO_SEQ_ABORT_INT | DISGR2_ISO_SEQ_ERR_INT
+                   | DISGR2_RESM_INT | DISGR2_SUSP_INT | DISGR2_USBRST_INT),
+                 fotg210->reg + FOTG210_DMISGR2);
+
        /* disable all fifo interrupt */
        iowrite32(~(u32)0, fotg210->reg + FOTG210_DMISGR1);