RFCOMM not releasing properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Raspbian |
New
|
Undecided
|
Unassigned |
Bug Description
I'm using stock raspian updated to lastest version on a raspberry pi 2 (1GB) device, together with a Inateck BTA-CSR4B5 bluetooth adapter.
The goal is to do serial communication over bluetooth.
Device are paired and I can achieve the communication properly with commands :
sudo rfcomm listen rfcomm0 1
upon deconnection (e.g. from the remote side), issueing the same command again fails to allow the remote side to reconnect.
If I first type :
sudo hciconfig hci0 reset
and then reissue the rfcomm listen command, it starts working again...
However, from time to time, this stops working completely, I get an error message :
Can't bind RFCOMM socket: Address already in use
and the result of dmesg shows the following :
[ 82.996877] ------------[ cut here ]------------
[ 82.996931] WARNING: CPU: 0 PID: 32 at drivers/
[ 82.996944] Modules linked in: rfcomm snd_bcm2835 snd_pcm snd_seq snd_seq_device snd_timer snd ecb btusb evdev joydev bluetooth rfkill uio_pdrv_genirq uio
[ 82.997044] CPU: 0 PID: 32 Comm: kworker/0:1 Not tainted 3.18.8-v7+ #764
[ 82.997066] Workqueue: events release_one_tty
[ 82.997111] [<80016070>] (unwind_backtrace) from [<80012938>] (show_stack+
[ 82.997142] [<80012938>] (show_stack) from [<8051b1f0>] (dump_stack+
[ 82.997216] [<8051b1f0>] (dump_stack) from [<800243e8>] (warn_slowpath_
[ 82.997246] [<800243e8>] (warn_slowpath_
[ 82.997277] [<800244c8>] (warn_slowpath_
[ 82.997335] [<80322b48>] (tty_port_
[ 82.997395] [<80322b9c>] (tty_port_put) from [<7f159f10>] (rfcomm_
[ 82.997452] [<7f159f10>] (rfcomm_tty_cleanup [rfcomm]) from [<80318fd0>] (release_
[ 82.997482] [<80318fd0>] (release_one_tty) from [<80039a50>] (process_
[ 82.997510] [<80039a50>] (process_one_work) from [<8003a494>] (worker_
[ 82.997535] [<8003a494>] (worker_thread) from [<8003ebc4>] (kthread+0xe0/0xfc)
[ 82.997586] [<8003ebc4>] (kthread) from [<8000eb88>] (ret_from_
[ 82.997603] ---[ end trace 0d5fd4688197372d ]---
which looks like there is a crash in some destuctor (old C++ souvenirs...)
rfcomm -a
shows
rfcomm0: 00:1A:7D:DA:71:13 -> 40:2C:F4:DB:C9:73 channel 1 closed [reuse-dlc release-on-hup ]
This is quite reproducible, and while googling around, I found a few links that show similar things :
https:/
I'm quite new to bug repports and be happy to provide missing information that could help spotting and solving this.
Regards
it seems that a proposed patch (not sure this is related, but I would think so)
https:/ /groups. google. com/forum/ #!topic ... GQKKO37epg
is not applied in current raspian version :
https:/ /github. com/raspberrypi /linux/ bl ... tty_port.c
where the reported (supposed ?) buggy source code is the unpatched version