Module Name:    src
Committed By:   dyoung
Date:           Sun May  3 00:31:12 UTC 2009

Modified Files:
        src/sys/dev/pci: pccbb.c

Log Message:
In pccbb_pci_callback(), set CBB_SPECMAPPED in sc_flags if we've
acquired bus space from bus_space_alloc(9) or from rbus_space_alloc(),
so that we use the appropriate routine to release the bus space in
pccbbdetach().  This stops panics during cbb(4) detachment (esp. at
shutdown) on some systems.

Thanks to Kurt Schreiner for testing the fix, Kurt, Patrick Welche,
Pouya D. Tafti, and Matt Green for reporting.


To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/sys/dev/pci/pccbb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pccbb.c
diff -u src/sys/dev/pci/pccbb.c:1.185 src/sys/dev/pci/pccbb.c:1.186
--- src/sys/dev/pci/pccbb.c:1.185	Thu Apr  2 00:09:33 2009
+++ src/sys/dev/pci/pccbb.c	Sun May  3 00:31:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pccbb.c,v 1.185 2009/04/02 00:09:33 dyoung Exp $	*/
+/*	$NetBSD: pccbb.c,v 1.186 2009/05/03 00:31:12 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.185 2009/04/02 00:09:33 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.186 2009/05/03 00:31:12 dyoung Exp $");
 
 /*
 #define CBB_DEBUG
@@ -643,7 +643,7 @@
 		    (unsigned long)pci_conf_read(pc,
 		    sc->sc_tag, PCI_SOCKBASE)));
 #endif
-		sc->sc_flags |= CBB_MEMHMAPPED;
+		sc->sc_flags |= CBB_MEMHMAPPED|CBB_SPECMAPPED;
 	}
 
 	/* clear data structure for child device interrupt handlers */

Reply via email to