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.
This commit is contained in:
dyoung 2009-05-03 00:31:12 +00:00
parent 1e54487f2a
commit 85d5fd7b83
1 changed files with 3 additions and 3 deletions

View File

@ -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 @@ pccbb_pci_callback(device_t self)
(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 */