racing condition in accepting incoming RFCOMM connection
Hi
It looks like there is a racing condition in accepting incoming RFCOMM connection. It happens to me in 90% cases when a headset originates connection to a voice gateway. If RFCOMM SAMB command frame comes in L2CAP data packet right after L2CAP Configuration Request packet and there is no active RFCOMM sessions yet then the kernel RFCOMM thread wakes up only one time and creates new session but does not process SAMB frame from second L2CAP data packet waiting in queue. Connection setup hangs. Headset is waiting for UA frame response but the kernel RFCOMM thread keeps sleeping. The kernel log for bad case is attached. I use the following environment:
Kernel: Linux 2.4.21 + patch-2.4.21-mh6, PowerPC.
Headsets: Motorola Model 98405H, BlueTrek-G2.
Voice gateway: Murata BlueModule, CSR BlueCore: BC02 (Hardware ID 8a) firmware version 526
A possible solution could be to force additional thread wakeup right after successful creation of new session in rfcomm_accept_connection(). The patch is attached.
Regards.
Dmitri
mailto: [email protected]
Marcel Holtmann
maintainerHi Dmitri,
Quoted 8 lines
It looks like there is a racing condition in accepting incoming RFCOMM connection. It happens to me in 90% cases when a headset originates connection to a voice gateway. If RFCOMM SAMB command frame comes in L2CAP data packet right after L2CAP Configuration Request packet and there is no active RFCOMM sessions yet then the kernel RFCOMM thread wakes up only one time and creates new session but does not process SAMB frame from second L2CAP data packet waiting in queue. Connection setup hangs. Headset is waiting for UA frame response but the kernel RFCOMM thread keeps sleeping.
Quoted 8 lines
The kernel log for bad case is attached. I use the following environment:
Kernel: Linux 2.4.21 + patch-2.4.21-mh6, PowerPC.
Headsets: Motorola Model 98405H, BlueTrek-G2.
Voice gateway: Murata BlueModule, CSR BlueCore: BC02 (Hardware ID 8a) firmware version 526
A possible solution could be to force additional thread wakeup right after successful creation of new session inrfcomm_accept_connection(). The patch is attached.
sounds reasonable to me. Anyone else noticed this behaviour?
Regards
Marcel
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel