All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Michael Schmitt <tcwardrobe@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: 057c:3800 BlueFRITZ! Bluetooth Stick broken since 2.6.something
Date: Fri, 18 Nov 2011 22:30:19 +0200	[thread overview]
Message-ID: <20111118203019.GA24250@x220.ger.corp.intel.com> (raw)
In-Reply-To: <4EC68909.40108@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

HI Michael,

On Fri, Nov 18, 2011, Michael Schmitt wrote:
> Thanks for the input. But do you know why the device works with
> older kernel / userland?>

Probably because the list of supported commands wasn't previously
requested as part of the adapter init sequence, or because the kernel
code didn't actually wait for all commands to complete before notifying
success to user space (I know the latter is at least true since I
submitted a patch for it).

> So, and what do we do from here on?

Well, the attached patch will at least make sure that the failure of
this command is correctly detected so you get an immediate error instead
of a timeout. The next step is to decide whether to do a quirk for your
specific adapter or to make it a general rule that errors for this
particular HCI command are ignored (for that we'd need feedback from the
real kernel experts like Marcel and Gustavo).

Johan

[-- Attachment #2: 0001-Bluetooth-Fix-request-completion-for-command-status-.patch --]
[-- Type: text/plain, Size: 1019 bytes --]

>From e8cc224c3d8b6ea5b956efb33cdc3569fc782d4c Mon Sep 17 00:00:00 2001
From: Johan Hedberg <johan.hedberg@intel.com>
Date: Fri, 18 Nov 2011 22:21:48 +0200
Subject: [PATCH] Bluetooth: Fix request completion for command status events

If a HCI command triggered by hci_request() fails at the command status
phase we need to properly inform the request tracking code of the
completion of the request.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/hci_event.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index dfe6fbc..236f895 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2055,6 +2055,9 @@ static inline void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb)
 
 	opcode = __le16_to_cpu(ev->opcode);
 
+	if (ev->status != 0)
+		hci_req_complete(hdev, opcode, ev->status);
+
 	switch (opcode) {
 	case HCI_OP_INQUIRY:
 		hci_cs_inquiry(hdev, ev->status);
-- 
1.7.7.2


  reply	other threads:[~2011-11-18 20:30 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 15:28 057c:3800 BlueFRITZ! Bluetooth Stick broken since 2.6.something Michael Schmitt
2011-11-18 15:36 ` Johan Hedberg
2011-11-18 15:49   ` Michael Schmitt
2011-11-18 16:21     ` Johan Hedberg
2011-11-18 16:34       ` Michael Schmitt
2011-11-18 20:30         ` Johan Hedberg [this message]
2011-11-20 15:27           ` Michael Schmitt
2011-11-27 10:04             ` Michael Schmitt
2011-11-28  8:42               ` Andrei Emeltchenko
2011-11-21  8:57       ` Andrei Emeltchenko
2011-11-21  9:12         ` Andrei Emeltchenko
2011-11-21  9:13         ` Marcel Holtmann
2011-11-21 10:22           ` Andrei Emeltchenko
2011-11-21 13:03             ` Marcel Holtmann
2011-11-21 10:35           ` Johan Hedberg
2011-11-21 13:04             ` Marcel Holtmann
2011-11-21 15:21               ` Johan Hedberg
2011-11-18 16:17   ` Michael Schmitt
2013-07-18 13:26 Jörg Esser
2013-07-18 14:13 ` Marcel Holtmann
2013-07-19  6:26   ` Jörg Esser
2013-07-19 13:49     ` Marcel Holtmann
2013-07-19 16:20       ` Johan Hedberg
2013-07-22  7:10         ` Jörg Esser
2013-07-22 14:22           ` Marcel Holtmann
2013-07-23 23:39             ` Johan Hedberg
2013-07-25  9:10               ` Jörg Esser
2013-07-25 10:55                 ` Gustavo Padovan
2013-07-25 14:51                   ` Marcel Holtmann
2013-07-25 14:40                 ` 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=20111118203019.GA24250@x220.ger.corp.intel.com \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=tcwardrobe@gmail.com \
    /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.