summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authoryamaguchi <yamaguchi@NetBSD.org>2022-03-31 06:21:41 +0000
committeryamaguchi <yamaguchi@NetBSD.org>2022-03-31 06:21:41 +0000
commitf2ed9b642ad9c826fa5bb62cc2e94691f70cd366 (patch)
tree172dab175e72e8b5671165e1857343fba5e9a45c /sys
parent18cea8e67c0f4b4e9893fc97f55f6285373bc911 (diff)
Use xc_barrier to wait for finish of the interrupt handler
poited out by riastradh@n.o, thanks.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_ixl.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/pci/if_ixl.c b/sys/dev/pci/if_ixl.c
index 5de5bef7af9..cb04ab68d82 100644
--- a/sys/dev/pci/if_ixl.c
+++ b/sys/dev/pci/if_ixl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ixl.c,v 1.80 2022/03/31 06:20:14 yamaguchi Exp $ */
+/* $NetBSD: if_ixl.c,v 1.81 2022/03/31 06:21:41 yamaguchi Exp $ */
/*
* Copyright (c) 2013-2015, Intel Corporation
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.80 2022/03/31 06:20:14 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.81 2022/03/31 06:21:41 yamaguchi Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -95,6 +95,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.80 2022/03/31 06:20:14 yamaguchi Exp $"
#include <sys/pcq.h>
#include <sys/syslog.h>
#include <sys/workqueue.h>
+#include <sys/xcall.h>
#include <sys/bus.h>
@@ -989,6 +990,14 @@ ixl_lookup(const struct pci_attach_args *pa)
return NULL;
}
+static void
+ixl_intr_barrier(void)
+{
+
+ /* wait for finish of all handler */
+ xc_barrier(0);
+}
+
static int
ixl_match(device_t parent, cfdata_t match, void *aux)
{
@@ -1447,14 +1456,11 @@ ixl_detach(device_t self, int flags)
ixl_stop(ifp, 1);
ixl_disable_other_intr(sc);
+ ixl_intr_barrier();
callout_halt(&sc->sc_stats_callout, NULL);
ixl_work_wait(sc->sc_workq, &sc->sc_stats_task);
- /* wait for ATQ handler */
- mutex_enter(&sc->sc_atq_lock);
- mutex_exit(&sc->sc_atq_lock);
-
ixl_work_wait(sc->sc_workq, &sc->sc_arq_task);
ixl_work_wait(sc->sc_workq, &sc->sc_link_state_task);