Sun Sep 27 19:48:57 2009 UTC ()
Don't disestablish a soft interrupt which has not been established.


(bouyer)
diff -r1.29 -r1.30 src/sys/arch/xen/xen/xennetback_xenbus.c

cvs diff -r1.29 -r1.30 src/sys/arch/xen/xen/xennetback_xenbus.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/xennetback_xenbus.c 2009/09/25 23:11:57 1.29
+++ src/sys/arch/xen/xen/xennetback_xenbus.c 2009/09/27 19:48:57 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xennetback_xenbus.c,v 1.29 2009/09/25 23:11:57 bouyer Exp $ */ 1/* $NetBSD: xennetback_xenbus.c,v 1.30 2009/09/27 19:48:57 bouyer Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Manuel Bouyer. 4 * Copyright (c) 2006 Manuel Bouyer.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -370,27 +370,30 @@ xennetback_xenbus_destroy(void *arg) @@ -370,27 +370,30 @@ xennetback_xenbus_destroy(void *arg)
370{ 370{
371 struct xnetback_instance *xneti = arg; 371 struct xnetback_instance *xneti = arg;
372 struct gnttab_unmap_grant_ref op; 372 struct gnttab_unmap_grant_ref op;
373 int err; 373 int err;
374 374
375#if 0 375#if 0
376 if (xneti->xni_status == CONNECTED) { 376 if (xneti->xni_status == CONNECTED) {
377 return EBUSY; 377 return EBUSY;
378 } 378 }
379#endif 379#endif
380 aprint_verbose_ifnet(&xneti->xni_if, "disconnecting\n"); 380 aprint_verbose_ifnet(&xneti->xni_if, "disconnecting\n");
381 hypervisor_mask_event(xneti->xni_evtchn); 381 hypervisor_mask_event(xneti->xni_evtchn);
382 event_remove_handler(xneti->xni_evtchn, xennetback_evthandler, xneti); 382 event_remove_handler(xneti->xni_evtchn, xennetback_evthandler, xneti);
383 softint_disestablish(xneti->xni_softintr); 383 if (xneti->xni_softintr) {
 384 softint_disestablish(xneti->xni_softintr);
 385 xneti->xni_softintr = NULL;
 386 }
384 387
385 SLIST_REMOVE(&xnetback_instances, 388 SLIST_REMOVE(&xnetback_instances,
386 xneti, xnetback_instance, next); 389 xneti, xnetback_instance, next);
387 390
388 ether_ifdetach(&xneti->xni_if); 391 ether_ifdetach(&xneti->xni_if);
389 if_detach(&xneti->xni_if); 392 if_detach(&xneti->xni_if);
390 393
391 if (xneti->xni_txring.sring) { 394 if (xneti->xni_txring.sring) {
392 op.host_addr = xneti->xni_tx_ring_va; 395 op.host_addr = xneti->xni_tx_ring_va;
393 op.handle = xneti->xni_tx_ring_handle; 396 op.handle = xneti->xni_tx_ring_handle;
394 op.dev_bus_addr = 0; 397 op.dev_bus_addr = 0;
395 err = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, 398 err = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref,
396 &op, 1); 399 &op, 1);