Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci call detach functions before stopping the interr...



details:   https://anonhg.NetBSD.org/src/rev/8aafe4b31d7d
branches:  trunk
changeset: 364612:8aafe4b31d7d
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Thu Mar 31 06:23:18 2022 +0000

description:
call detach functions before stopping the interrupt for atq

diffstat:

 sys/dev/pci/if_ixl.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (52 lines):

diff -r d23cc0e404c0 -r 8aafe4b31d7d sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Thu Mar 31 06:21:41 2022 +0000
+++ b/sys/dev/pci/if_ixl.c      Thu Mar 31 06:23:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ixl.c,v 1.81 2022/03/31 06:21:41 yamaguchi Exp $    */
+/*     $NetBSD: if_ixl.c,v 1.82 2022/03/31 06:23:18 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.81 2022/03/31 06:21:41 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.82 2022/03/31 06:23:18 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1455,12 +1455,17 @@
 
        ixl_stop(ifp, 1);
 
+       callout_halt(&sc->sc_stats_callout, NULL);
+       ixl_work_wait(sc->sc_workq, &sc->sc_stats_task);
+
+       /* detach the I/F before stop adminq due to callbacks */
+       ether_ifdetach(ifp);
+       if_detach(ifp);
+       ifmedia_fini(&sc->sc_media);
+       if_percpuq_destroy(sc->sc_ipq);
+
        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);
-
        ixl_work_wait(sc->sc_workq, &sc->sc_arq_task);
        ixl_work_wait(sc->sc_workq, &sc->sc_link_state_task);
 
@@ -1474,11 +1479,6 @@
                sc->sc_workq_txrx = NULL;
        }
 
-       if_percpuq_destroy(sc->sc_ipq);
-       ether_ifdetach(ifp);
-       if_detach(ifp);
-       ifmedia_fini(&sc->sc_media);
-
        ixl_teardown_interrupts(sc);
        ixl_teardown_stats(sc);
        ixl_teardown_sysctls(sc);



Home | Main Index | Thread Index | Old Index