Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/arch/xen/xen Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/bd6452928e67
branches:  netbsd-7
changeset: 799843:bd6452928e67
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Mar 06 18:52:06 2016 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #1125):
        sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.67
In xennet_xenbus_detach(), remove the event handler early (just after
xennet_stop()) so that we don't get events while slepping (e.g.
in softint_disestablish()) when some structures have already been
freed.
Problem reported and patch tested by Rohan Desai.

diffstat:

 sys/arch/xen/xen/if_xennet_xenbus.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 0c7eae6bc0ae -r bd6452928e67 sys/arch/xen/xen/if_xennet_xenbus.c
--- a/sys/arch/xen/xen/if_xennet_xenbus.c       Sun Mar 06 18:47:39 2016 +0000
+++ b/sys/arch/xen/xen/if_xennet_xenbus.c       Sun Mar 06 18:52:06 2016 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_xennet_xenbus.c,v 1.63 2014/08/10 16:44:35 tls Exp $      */
+/*      $NetBSD: if_xennet_xenbus.c,v 1.63.2.1 2016/03/06 18:52:06 martin Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -85,7 +85,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.63 2014/08/10 16:44:35 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.63.2.1 2016/03/06 18:52:06 martin Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -421,6 +421,7 @@
        DPRINTF(("%s: xennet_xenbus_detach\n", device_xname(self)));
        s0 = splnet();
        xennet_stop(ifp, 1);
+       event_remove_handler(sc->sc_evtchn, &xennet_handler, sc);
        /* wait for pending TX to complete, and collect pending RX packets */
        xennet_handler(sc);
        while (sc->sc_tx_ring.sring->rsp_prod != sc->sc_tx_ring.rsp_cons) {
@@ -456,7 +457,6 @@
        uvm_km_free(kernel_map, (vaddr_t)sc->sc_rx_ring.sring, PAGE_SIZE,
            UVM_KMF_WIRED);
        softint_disestablish(sc->sc_softintr);
-       event_remove_handler(sc->sc_evtchn, &xennet_handler, sc);
        splx(s0);
 
        pmf_device_deregister(self);



Home | Main Index | Thread Index | Old Index