do not hold bt_lock while detaching bthub, as devices may need to aquire

it in order to detach cleanly.
This commit is contained in:
plunky 2008-06-26 14:17:27 +00:00
parent d769966488
commit d7fdc240c9

View File

@ -1,4 +1,4 @@
/* $NetBSD: hci_unit.c,v 1.11 2008/04/24 11:38:37 ad Exp $ */
/* $NetBSD: hci_unit.c,v 1.12 2008/06/26 14:17:27 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hci_unit.c,v 1.11 2008/04/24 11:38:37 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: hci_unit.c,v 1.12 2008/06/26 14:17:27 plunky Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -216,8 +216,14 @@ hci_disable(struct hci_unit *unit)
int acl;
if (unit->hci_bthub) {
config_detach(unit->hci_bthub, DETACH_FORCE);
device_t hub;
hub = unit->hci_bthub;
unit->hci_bthub = NULL;
mutex_exit(bt_lock);
config_detach(hub, DETACH_FORCE);
mutex_enter(bt_lock);
}
if (unit->hci_rxint) {