Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/xen/xen In xennet_xenbus_detach(), remove the event...
details: https://anonhg.NetBSD.org/src/rev/a5bf0c50a491
branches: trunk
changeset: 343601:a5bf0c50a491
user: bouyer <bouyer%NetBSD.org@localhost>
date: Tue Feb 16 08:41:32 2016 +0000
description:
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 6bdbdf25b8b6 -r a5bf0c50a491 sys/arch/xen/xen/if_xennet_xenbus.c
--- a/sys/arch/xen/xen/if_xennet_xenbus.c Tue Feb 16 07:51:13 2016 +0000
+++ b/sys/arch/xen/xen/if_xennet_xenbus.c Tue Feb 16 08:41:32 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xennet_xenbus.c,v 1.66 2016/02/09 08:32:10 ozaki-r Exp $ */
+/* $NetBSD: if_xennet_xenbus.c,v 1.67 2016/02/16 08:41:32 bouyer Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -85,7 +85,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.66 2016/02/09 08:32:10 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.67 2016/02/16 08:41:32 bouyer Exp $");
#include "opt_xen.h"
#include "opt_nfs_boot.h"
@@ -422,6 +422,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) {
@@ -457,7 +458,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