Mask off MAC management counter interrupts. The driver doesn't know how
authorjmatthew <jmatthew@openbsd.org>
Thu, 25 Apr 2024 08:51:37 +0000 (08:51 +0000)
committerjmatthew <jmatthew@openbsd.org>
Thu, 25 Apr 2024 08:51:37 +0000 (08:51 +0000)
to handle these, so if they're enabled, they will cause an interrupt
storm.

ok patrick@ jsg@ stsp@

sys/dev/ic/dwqe.c
sys/dev/ic/dwqereg.h

index 0467a4c..3e9f656 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dwqe.c,v 1.18 2024/03/29 08:19:40 stsp Exp $  */
+/*     $OpenBSD: dwqe.c,v 1.19 2024/04/25 08:51:37 jmatthew Exp $      */
 /*
  * Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org>
  * Copyright (c) 2017, 2022 Patrick Wildt <patrick@blueri.se>
@@ -213,6 +213,8 @@ dwqe_attach(struct dwqe_softc *sc)
        /* Disable interrupts. */
        dwqe_write(sc, GMAC_INT_EN, 0);
        dwqe_write(sc, GMAC_CHAN_INTR_ENA(0), 0);
+       dwqe_write(sc, GMAC_MMC_RX_INT_MASK, 0xffffffff); 
+       dwqe_write(sc, GMAC_MMC_TX_INT_MASK, 0xffffffff); 
 
        return 0;
 }
index bc6de32..7f44de4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dwqereg.h,v 1.5 2023/11/11 16:32:56 stsp Exp $        */
+/*     $OpenBSD: dwqereg.h,v 1.6 2024/04/25 08:51:37 jmatthew Exp $    */
 /*
  * Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org>
  * Copyright (c) 2017, 2022 Patrick Wildt <patrick@blueri.se>
@@ -83,6 +83,8 @@
 #define GMAC_MAC_MDIO_DATA     0x0204
 #define GMAC_MAC_ADDR0_HI      0x0300
 #define GMAC_MAC_ADDR0_LO      0x0304
+#define GMAC_MMC_RX_INT_MASK   0x070c
+#define GMAC_MMC_TX_INT_MASK   0x0710
 
 #define GMAC_MTL_OPERATION_MODE        0x0c00
 #define  GMAC_MTL_FRPE                 (1 << 15)