Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Oct 2008 15:42:28 -0700
From:      "Maksim Yevmenkin" <maksim.yevmenkin@gmail.com>
To:        vova@fbsd.ru
Cc:        freebsd-bluetooth@freebsd.org, usb@freebsd.org
Subject:   Re: Bluetooth audio - crash on USB bluetooth dongle disconnect - solved
Message-ID:  <bb4a86c70810031542y1f6d35f2yc2e0b38974a81ecd@mail.gmail.com>
In-Reply-To: <1223072464.4832.2.camel@localhost>
References:  <3a386af20809261420j535680e8pf44453dbf6f84b20@mail.gmail.com> <bb4a86c70809261504v45ffe1a8oaf26670a1032e86c@mail.gmail.com> <1223034512.1842.111.camel@localhost> <bb4a86c70810030945g3d870a1eqacc85233d9698a66@mail.gmail.com> <1223067257.2362.6.camel@localhost> <bb4a86c70810031418t5b9eef45p4d57b55f22c05715@mail.gmail.com> <1223072464.4832.2.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help

2008/10/3 Vladimir Grebenschikov <vova@fbsd.ru>:
> В Fri, 03/10/2008 в 14:18 -0700, Maksim Yevmenkin пишет:
>
>> 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.
>>
>> 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).
>
> Right guess, it does not called.
>
>> if not - then please try to call ubt_reset() from ubt_detach() just before
>> closing all the pipes.
>
> Yes, it fixes crash, patch below.

thanks for testing it! i have committed slightly different fix to head

===

Author: emax
Date: Fri Oct  3 22:40:42 2008
New Revision: 183576
URL: http://svn.freebsd.org/changeset/base/183576

Log:
 Abort transfers on all pipes before closing them. This fixes the crash
 when Bluetooth USB device is pulled out without stopping the stack first.

 Submitted by: Vladimir Grebenschikov vova at fbsd dot ru
 MFC after:    1 week

Modified:
 head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c

===

thanks,
max


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bb4a86c70810031542y1f6d35f2yc2e0b38974a81ecd>