Linux bluetooth development
 help / color / mirror / Atom feed
From: johan.hedberg@gmail.com
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 0/2] Bluetooth: Fix hci_dev_open race condition
Date: Tue,  1 Oct 2013 14:10:26 +0300	[thread overview]
Message-ID: <1380625828-19538-1-git-send-email-johan.hedberg@gmail.com> (raw)

Hi,

There was recently a bug reported regarding the setup stage getting
called twice (Subject: [PATCH v5 1/2] Bluetooth: btmrvl: add setup
handler). There was an initial patch proposal to get an understanding of
what exactly is happening, but the initial fix itself was not the one we
want upstream.

After considering the various options we decided to simply ensure that
the HCIDEVUP ioctl calling path needs to ensure that the req_workqueue
is flushed before calling hci_dev_open. However, this requires some
refactoring and hence two patches instead of one.

I was able to test this with BlueZ 4.101 and Intel HW to see that the
Intel setup handler doesn't get called twice, but it would still be good
to test this with the setup that was used for the initial report.

Johan

----------------------------------------------------------------
Johan Hedberg (2):
      Bluetooth: Refactor hci_dev_open to a separate hci_dev_do_open function
      Bluetooth: Fix workqueue synchronization in hci_dev_open

 net/bluetooth/hci_core.c | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)


             reply	other threads:[~2013-10-01 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01 11:10 johan.hedberg [this message]
2013-10-01 11:10 ` [PATCH 1/2] Bluetooth: Refactor hci_dev_open to a separate hci_dev_do_open function johan.hedberg
2013-10-01 12:56   ` Marcel Holtmann
2013-10-01 11:10 ` [PATCH 2/2] Bluetooth: Fix workqueue synchronization in hci_dev_open johan.hedberg
2013-10-01 12:57   ` 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=1380625828-19538-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