From 85d5fd7b8317aed2e89dd7d07d64d5ca7ced8493 Mon Sep 17 00:00:00 2001 From: dyoung Date: Sun, 3 May 2009 00:31:12 +0000 Subject: 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. --- sys/dev/pci/pccbb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index b7088e14e74..55f58944ec4 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -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 -__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 */ -- cgit