From 2bbed9a65ba55c7d04ead3390236101b897cb99b Mon Sep 17 00:00:00 2001 From: jmatthew Date: Thu, 4 Jan 2024 07:08:47 +0000 Subject: [PATCH] fix up barriers in bnxt_down() - use barriers for all interrupts and for the rx refill timeouts. tested by hrvoje ok bluhm@ --- sys/dev/pci/if_bnxt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/if_bnxt.c b/sys/dev/pci/if_bnxt.c index 6e9c5b616f8..f60b3ade1c3 100644 --- a/sys/dev/pci/if_bnxt.c +++ b/sys/dev/pci/if_bnxt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnxt.c,v 1.39 2023/11/10 15:51:20 bluhm Exp $ */ +/* $OpenBSD: if_bnxt.c,v 1.40 2024/01/04 07:08:47 jmatthew Exp $ */ /*- * Broadcom NetXtreme-C/E network driver. * @@ -1158,12 +1158,16 @@ bnxt_down(struct bnxt_softc *sc) CLR(ifp->if_flags, IFF_RUNNING); + intr_barrier(sc->sc_ih); + for (i = 0; i < sc->sc_nqueues; i++) { ifq_clr_oactive(ifp->if_ifqs[i]); ifq_barrier(ifp->if_ifqs[i]); - /* intr barrier? */ - timeout_del(&sc->sc_queues[i].q_rx.rx_refill); + timeout_del_barrier(&sc->sc_queues[i].q_rx.rx_refill); + + if (sc->sc_intrmap != NULL) + intr_barrier(sc->sc_queues[i].q_ihc); } bnxt_hwrm_free_filter(sc, &sc->sc_vnic); -- 2.20.1