From owner-freebsd-usb@FreeBSD.ORG Fri Oct 3 22:21:09 2008 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BB9D106568A; Fri, 3 Oct 2008 22:21:09 +0000 (UTC) (envelope-from vova@sw.ru) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) by mx1.freebsd.org (Postfix) with ESMTP id 696458FC1A; Fri, 3 Oct 2008 22:21:08 +0000 (UTC) (envelope-from vova@sw.ru) Received: from vbook.fbsd.ru ([77.232.23.6]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id m93ML5xM015743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Oct 2008 02:21:06 +0400 (MSD) Received: from vova by vbook.fbsd.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Klt1E-0001N2-BI; Sat, 04 Oct 2008 02:21:04 +0400 From: Vladimir Grebenschikov To: Maksim Yevmenkin In-Reply-To: References: <3a386af20809261420j535680e8pf44453dbf6f84b20@mail.gmail.com> <1223034512.1842.111.camel@localhost> <1223067257.2362.6.camel@localhost> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Organization: SWsoft Date: Sat, 04 Oct 2008 02:21:04 +0400 Message-Id: <1223072464.4832.2.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: freebsd-bluetooth@freebsd.org, usb@freebsd.org, Federico Lorenzi Subject: Re: Bluetooth audio - crash on USB bluetooth dongle disconnect - solved X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2008 22:21:09 -0000 =F7 Fri, 03/10/2008 =D7 14:18 -0700, Maksim Yevmenkin =D0=C9=DB=C5=D4: > one thing that is different from interrupt and bulk transfers is that > ng_ubt(4) always has multiple outstanding incoming isoc transfers. > when device is simply pulled out, there is not much driver can do. if > i enable debugging i can see my transfer completion routine called > with ioerror status or something like that. so, i suspect this is a > cleanup issue. i'm not sure who supposed to do the cleanup in this > case driver or stack. >=20 > in any case, can you verify that ubt_reset() is called when device is > pulled out? (it should be called as part of hook disconnect).=20 Right guess, it does not called. > if not - then please try to call ubt_reset() from ubt_detach() just befor= e > closing all the pipes. Yes, it fixes crash, patch below. Index: netgraph/bluetooth/drivers/ubt/ng_ubt.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/ncvs/src/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c,v retrieving revision 1.35 diff -u -r1.35 ng_ubt.c --- netgraph/bluetooth/drivers/ubt/ng_ubt.c 29 Jul 2008 00:17:53 -0000 1.35 +++ netgraph/bluetooth/drivers/ubt/ng_ubt.c 3 Oct 2008 22:13:46 -0000 @@ -803,6 +803,9 @@ struct ubt_softc *sc =3D device_get_softc(self); int i; =20 + /* Reset queues and pipes */ + ubt_reset(sc); +=09 /* Destroy Netgraph node */ if (sc->sc_node !=3D NULL) { NG_NODE_SET_PRIVATE(sc->sc_node, NULL); > thanks, > max --=20 Vladimir B. Grebenschikov vova@fbsd.ru