summaryrefslogtreecommitdiff
path: root/sys/dev/fdt
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2019-02-01 00:51:08 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2019-02-01 00:51:08 +0000
commitcb20c53d3850ab77f563889e873745b4df31254c (patch)
tree518c31114d986c096095fe912b5d34fb6df55128 /sys/dev/fdt
parentff11b325fc4ca89b191e2e4ab1370655a4f28078 (diff)
Fix lost interrupts in fec(4). Apparently the tick that talks to the
phy to check the media status did not only ack the MII interrupt, but also all the others. Thus it could happen that the TX completion was not seen by the interrupt handler, leading to full TX queues. Also, the fec(4) interrupt handler acked more than it handles, thus possibly also acking the MII interrupt. Found with bluhm@ on his new arm64 regression setup. ok bluhm@
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r--sys/dev/fdt/if_fec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/fdt/if_fec.c b/sys/dev/fdt/if_fec.c
index f6ca5a9706c..efb02d0355b 100644
--- a/sys/dev/fdt/if_fec.c
+++ b/sys/dev/fdt/if_fec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_fec.c,v 1.6 2018/08/06 10:52:30 patrick Exp $ */
+/* $OpenBSD: if_fec.c,v 1.7 2019/02/01 00:51:07 patrick Exp $ */
/*
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
*
@@ -914,6 +914,7 @@ fec_intr(void *arg)
status = HREAD4(sc, ENET_EIR);
/* Acknowledge the interrupts we are about to handle. */
+ status &= (ENET_EIR_RXF | ENET_EIR_TXF);
HWRITE4(sc, ENET_EIR, status);
/*
@@ -1012,7 +1013,7 @@ fec_miibus_readreg(struct device *dev, int phy, int reg)
int r = 0;
struct fec_softc *sc = (struct fec_softc *)dev;
- HSET4(sc, ENET_EIR, ENET_EIR_MII);
+ HWRITE4(sc, ENET_EIR, ENET_EIR_MII);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, ENET_MMFR,
ENET_MMFR_ST | ENET_MMFR_OP_RD | ENET_MMFR_TA |
@@ -1030,7 +1031,7 @@ fec_miibus_writereg(struct device *dev, int phy, int reg, int val)
{
struct fec_softc *sc = (struct fec_softc *)dev;
- HSET4(sc, ENET_EIR, ENET_EIR_MII);
+ HWRITE4(sc, ENET_EIR, ENET_EIR_MII);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, ENET_MMFR,
ENET_MMFR_ST | ENET_MMFR_OP_WR | ENET_MMFR_TA |