linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: johan.hedberg@gmail.com
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 0/8] Bluetooth: SMP & disconnection fixes
Date: Mon, 18 Aug 2014 20:33:26 +0300	[thread overview]
Message-ID: <1408383214-16366-1-git-send-email-johan.hedberg@gmail.com> (raw)

Hi,

The previous patches for SMP disconnection (that already got applied) do
indeed fix the hci_conn_hold/drop ballance and do ensure that we
disconnect the link when the SMP code wants it. Unfortunately the
patches introduce a regression to a third use case which is the one
where we want to bring the link down when there are no more active users
for it.

It turns out that relying on connection users to diligently call
hci_conn_drop() isn't a reliable way to ensure that the connection goes
away. Firstly, we can't have hci_chan own such a reference (since it's
"always there") and secondly there might not be any users at all
(besides SMP) in which case there will be no-one to call hci_conn_drop.

A simpler solution is to just do a direct disonnect from smp.c with the
help of the hci_disconnect() function. This has the side effect of not
sending any SMP Failure PDU first, but the cases needing a disconnection
do not really need that PDU to be sent (i.e. SMP timeout or garbage
data).

The last three patches in this set unify hci_disconnect() usage to also
cover the Disconnect Device mgmt command and move clock offset reading
into the function to ensure all users have this feature at their
disposal.

Johan

----------------------------------------------------------------
Johan Hedberg (8):
      Bluetooth: Remove hci_conn_hold/drop from hci_chan
      Bluetooth: Set discon_timeout to 0 in l2cap_conn_del
      Bluetooth: Use hci_disconnect for immediate disconnection from SMP
      Bluetooth: Remove unused l2cap_conn_shutdown API
      Bluetooth: Fix SMP error and response to be mutually exclusive
      Bluetooth: Update hci_disconnect() to return an error value
      Bluetooth: Use hci_disconnect() for mgmt_disconnect_device()
      Bluetooth: Move clock offset reading into hci_disconnect()

 include/net/bluetooth/hci_core.h |  2 +-
 include/net/bluetooth/l2cap.h    |  4 ----
 net/bluetooth/hci_conn.c         | 41 ++++++++++++++----------------------
 net/bluetooth/l2cap_core.c       | 28 +++---------------------
 net/bluetooth/mgmt.c             |  6 +-----
 net/bluetooth/smp.c              | 17 ++++++---------
 6 files changed, 28 insertions(+), 70 deletions(-)



             reply	other threads:[~2014-08-18 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18 17:33 johan.hedberg [this message]
2014-08-18 17:33 ` [PATCH 1/8] Bluetooth: Remove hci_conn_hold/drop from hci_chan johan.hedberg
2014-08-18 17:33 ` [PATCH 2/8] Bluetooth: Set discon_timeout to 0 in l2cap_conn_del johan.hedberg
2014-08-18 17:33 ` [PATCH 3/8] Bluetooth: Use hci_disconnect for immediate disconnection from SMP johan.hedberg
2014-08-18 17:33 ` [PATCH 4/8] Bluetooth: Remove unused l2cap_conn_shutdown API johan.hedberg
2014-08-18 17:33 ` [PATCH 5/8] Bluetooth: Fix SMP error and response to be mutually exclusive johan.hedberg
2014-08-18 17:33 ` [PATCH 6/8] Bluetooth: Update hci_disconnect() to return an error value johan.hedberg
2014-08-18 17:33 ` [PATCH 7/8] Bluetooth: Use hci_disconnect() for mgmt_disconnect_device() johan.hedberg
2014-08-18 17:33 ` [PATCH 8/8] Bluetooth: Move clock offset reading into hci_disconnect() johan.hedberg
2014-08-18 21:09 ` [PATCH 0/8] Bluetooth: SMP & disconnection fixes 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=1408383214-16366-1-git-send-email-johan.hedberg@gmail.com \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).