linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Keith Packard <keithp@keithp.com>
Cc: linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org,
	Johan Hedberg <johan.hedberg@intel.com>
Subject: Re: [PATCH] Revert "Bluetooth: Always enable management interface"
Date: Thu, 29 Mar 2012 04:25:41 +0200	[thread overview]
Message-ID: <1332987941.1870.176.camel@aeonflux> (raw)
In-Reply-To: <1332983958-2734-1-git-send-email-keithp@keithp.com>

Hi Keith,

> This reverts commit 4b95a24ce12c4545fd7d2e3075841dc3119d1d71.
> 
> My USB bluetooth device does not show up with this patch in place.
> 
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
> 
> This patch seems so innocuous, but when added to the kernel, it keeps
> my USB bluetooth device from appearing to user mode at all. With the
> mgmt interface enabled:
> 
> 	$ hcitool dev
> 	Devices:
> 
> With this patch reverted:
> 
> 	$ hcitool dev
> 	Devices:
> 		hci0	04:0C:CE:DF:7B:C9

so this is seriously strange and I don't have an explanation for it
right now. Something breaking on this level means that Bluetooth devices
are not even registered. And that would be an obvious bug to detect.

Can you check with hciconfig -a if the device is actually there, but
might have some weird flags set.

> I bisected to this revision, and then reverted it on top of version
> 
> 	v3.3-6972-ge22057c	e22057c8599373e5caef0bc42bdb95d2a361ab0d
> 
> (which is where I'm trying to move drm-intel-fixes to)
> 
> I think this is the third consecutive merge window that has broken my
> bluetooth interface in some way? At least I know enough to check
> now...
> 
>  net/bluetooth/hci_sock.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
> index 63afd23..d8b16cf 100644
> --- a/net/bluetooth/hci_sock.c
> +++ b/net/bluetooth/hci_sock.c
> @@ -50,6 +50,8 @@
>  #include <net/bluetooth/hci_core.h>
>  #include <net/bluetooth/hci_mon.h>
>  
> +static bool enable_mgmt;
> +
>  static atomic_t monitor_promisc = ATOMIC_INIT(0);
>  
>  /* ----- HCI socket interface ----- */
> @@ -649,7 +651,7 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
>  		break;
>  
>  	case HCI_CHANNEL_CONTROL:
> -		if (haddr.hci_dev != HCI_DEV_NONE) {
> +		if (haddr.hci_dev != HCI_DEV_NONE || !enable_mgmt) {
>  			err = -EINVAL;
>  			goto done;
>  		}

I have no idea on how this can break anything for you. Since tools like
hcitool and hciconfig use HCI_CHANNEL_RAW. This must be a nasty side
effect somewhere if this is really fix it for you.

Can you start your bluetoothd with -P mgmtops to check if this might be
causing some side effects.

Regards

Marcel



  parent reply	other threads:[~2012-03-29  2:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  1:19 [PATCH] Revert "Bluetooth: Always enable management interface" Keith Packard
2012-03-29  1:25 ` David Miller
2012-03-29  2:25 ` Marcel Holtmann [this message]
2012-03-29  2:28 ` Gustavo Padovan
2012-03-29  2:35   ` Keith Packard
2012-03-29  3:33     ` Marcel Holtmann
2012-03-29  4:39       ` David Miller
2012-03-29  4:40     ` David Miller
2012-03-30  6:54     ` Gustavo Padovan
2012-04-03 12:29       ` Gustavo Padovan
2012-04-05 22:24       ` Keith Packard
2012-04-06  1:01         ` Gustavo Padovan
2012-03-29  3:48   ` Keith Packard
2012-03-29  4:40   ` David Miller

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=1332987941.1870.176.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=johan.hedberg@intel.com \
    --cc=keithp@keithp.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@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).