All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Marcel Holtmann <marcel@holtmann.org>,
	Scott James Remnant <keybuk@chromium.org>
Cc: linux-bluetooth@vger.kernel.org, Peter Hurley <peter@hurleysoftware.com>
Subject: [PATCH 3/3] bluetooth: rfcomm: Defer session teardown after last dlc
Date: Thu, 13 Mar 2014 12:43:06 -0400	[thread overview]
Message-ID: <1394728986-5096-4-git-send-email-peter@hurleysoftware.com> (raw)
In-Reply-To: <1394728986-5096-1-git-send-email-peter@hurleysoftware.com>

Commit 9cf5b0ea3a7f1432c61029f7aaf4b8b338628884,
[Bluetooth] Disconnect L2CAP connection after last RFCOMM DLC,
immediately disconnects the session when closing the last dlc.
This commit predates the later addition of a session timer [1]
which sets up a timer to automatically close the session after the
last dlc is closed. This automatic behavior was further noted
noted in [2]:

    When the last RFCOMM data channel is closed, a timer is normally set
    up to disconnect the control channel at a later time.  If the control
    channel disconnect command is sent with the timer pending, the timer
    needs to be cancelled.

Rely on automatic session disconnect; this fulfills the responsibility
of closing the multiplexer while allowing the last dlc to be closed and
reopened without needing to handshake a new l2cap connection.

[1] commit 9e726b17422bade75fba94e625cd35fd1353e682
    Bluetooth: Fix rejected connection not disconnecting ACL link

[2] commit 79e654787c67f6b05f73366ff8ccac72ba7249e6
    Bluetooth: Clear RFCOMM session timer when disconnecting last channel

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 net/bluetooth/rfcomm/core.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 292322c..062a96c 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -1193,13 +1193,6 @@ static struct rfcomm_session *rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
 		case BT_DISCONN:
 			d->state = BT_CLOSED;
 			__rfcomm_dlc_close(d, 0);
-
-			if (list_empty(&s->dlcs)) {
-				s->state = BT_DISCONN;
-				rfcomm_send_disc(s, 0);
-				rfcomm_session_clear_timer(s);
-			}
-
 			break;
 		}
 	} else {
-- 
1.8.1.2

  parent reply	other threads:[~2014-03-13 16:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 21:44 rctest -c "Can't connect: Device or resource busy (16)" Scott James Remnant
2014-03-11 23:03 ` Marcel Holtmann
2014-03-11 23:37   ` Scott James Remnant
2014-03-12  2:14     ` Marcel Holtmann
2014-03-12  3:01       ` Peter Hurley
2014-03-12  3:27         ` Peter Hurley
2014-03-12  4:27         ` Peter Hurley
2014-03-12 17:18         ` Peter Hurley
2014-03-28 17:49           ` Scott James Remnant
2014-03-13 16:43       ` [PATCH 0/3] Fix RFCOMM connect/disconn races Peter Hurley
2014-03-13 16:43         ` [PATCH 1/3] bluetooth: rfcomm: Reply with DM after dlc disconnect Peter Hurley
2014-03-13 16:43         ` [PATCH 2/3] bluetooth: rfcomm: Create new session if closing old session Peter Hurley
2014-03-13 16:43         ` Peter Hurley [this message]
2014-04-02 20:04         ` [PATCH 0/3] Fix RFCOMM connect/disconn races Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394728986-5096-4-git-send-email-peter@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=keybuk@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.