Skip to content

Fix RFCOMM connect/disconn races

Peter Hurley linux-bluetooth 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bluetooth: rfcomm: Reply with DM after dlc disconnectnet/bluetooth/rfcomm/core.c+19 -30 replies
2/3bluetooth: rfcomm: Create new session if closing old sessionnet/bluetooth/rfcomm/core.c+3 -00 replies
3/3bluetooth: rfcomm: Defer session teardown after last dlcnet/bluetooth/rfcomm/core.c+0 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Fix RFCOMM connect/disconn races

Marcel,

This patch series fixes the observed errors when running rctest -r on one station and rctest -c on the other.

Please note that patch 2/3 is somewhat risky in that it allows multiple RFCOMM sessions between the same endpoints to co-exist, provided that all but one of the sessions is closing or is closed. I did test this, but there may be some subtlety I've overlooked.

[I note this because you may prefer the simpler and more bulletproof solution of returning -EBUSY from __rfcomm_dlc_open() in this situation; I can understand if you have lost patience for RFCOMM breakage.]

This series does not address the excessive latency from sending the DISC command to receiving the UA reply. I think a partial solution would be to skip the rfcomm thread and run rfcomm_process_sessions() directly from rfcomm_l2data_ready(); this would require some rework where sk->sk_data_ready() is called directly from contexts that aren't suitable for running rfcomm_process_sessions(). And this wouldn't address the USB polling latency at all.

Regards,

Peter Hurley (3):
bluetooth: rfcomm: Reply with DM after dlc disconnect
bluetooth: rfcomm: Create new session if closing old session
bluetooth: rfcomm: Defer session teardown after last dlc

 net/bluetooth/rfcomm/core.c | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)
Signature · 1 line
1.8.1.2