Re: [PATCH] Revert "Bluetooth: Align minimum encryption key size for LE and BR/EDR connections"

2019-06-12 Thread Johan Hedberg
Hi,

On 12 Jun 2019, at 12.38, Bastien Nocera  wrote:
> 
> On Wed, 2019-06-12 at 09:07 +0200, Greg Kroah-Hartman wrote:
>> On Tue, Jun 11, 2019 at 11:36:26PM +0200, Marcel Holtmann wrote:
>>> Hi Vasily,
>>> 
 Can we get this revert merged into stable branches? Bluetooth HID
 has
 been broken for many devices for quite a while now and RFC patch
 that
 fixes the breakage hasn't seen any movement for almost a month.
>>> 
>>> lets send the RFC patch upstream since it got enough feedback that
>>> it fixes the issue.
>> 
>> According to Hans, the workaround did not work.
> 
> Is it possible that those folks were running Fedora, and using a
> version of bluetoothd without a fix for using dbus-broker as the D-Bus
> daemon implementation?
> 
> I backported the fix in an update last week:
> https://bugzilla.redhat.com/show_bug.cgi?id=1711594

I don’t know if that’s the case, but at least based on the comment here:

https://bugzilla.kernel.org/show_bug.cgi?id=203643#c10

it looks like there’s still a race with controllers that do support reading the 
encryption key size. The peer device may send an L2CAP Connect Request before 
we’ve completed reading the key size, in which case we’d still reject the 
request. For making this work again I’m not aware of any other quick solution 
than a revert.

Johan



Re: linux-next: Signed-off-by missing for commits in the net-next tree

2018-04-01 Thread Johan Hedberg
Hi,

On Mon, Apr 02, 2018, Stephen Rothwell wrote:
>   45a42bc9cc65 ("Bluetooth: hci_bcm: Remove DMI quirk for the MINIX Z83-4")
>   f9b95db0165a ("Bluetooth: btrsi: remove unused including ")
>   96e58d368fa6 ("Bluetooth: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY for 
> BTUSB_QCA_ROME")
>   9ea471320e13 ("Bluetooth: Mark expected switch fall-throughs")
> 
> are missing a Signed-off-by from their committer.

I think this is because I fixed up a missing author name in "Bluetooth:
hci_bcm: Remove DMI quirk for the MINIX Z83-4" and did a push --force,
whereas these patches were originally committed by Marcel. Should I be
adding my signed-off-by to all affected patches when doing such rebases?

Johan


Re: linux-next: Signed-off-by missing for commits in the net-next tree

2018-04-01 Thread Johan Hedberg
Hi,

On Mon, Apr 02, 2018, Stephen Rothwell wrote:
>   45a42bc9cc65 ("Bluetooth: hci_bcm: Remove DMI quirk for the MINIX Z83-4")
>   f9b95db0165a ("Bluetooth: btrsi: remove unused including ")
>   96e58d368fa6 ("Bluetooth: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY for 
> BTUSB_QCA_ROME")
>   9ea471320e13 ("Bluetooth: Mark expected switch fall-throughs")
> 
> are missing a Signed-off-by from their committer.

I think this is because I fixed up a missing author name in "Bluetooth:
hci_bcm: Remove DMI quirk for the MINIX Z83-4" and did a push --force,
whereas these patches were originally committed by Marcel. Should I be
adding my signed-off-by to all affected patches when doing such rebases?

Johan


Re: linux-next: Signed-off-by missing for commit in the bluetooth tree

2017-12-29 Thread Johan Hedberg
Hi,

On Sat, Dec 30, 2017, Stephen Rothwell wrote:
> On Sat, 30 Dec 2017 10:25:52 +1100 Stephen Rothwell  
> wrote:
> > Commit
> > 
> >   0a03f98b98c2 ("Bluetooth: Add a new 04ca:3015 QCA_ROME device")
> > 
> > is missing a Signed-off-by from its .
>   ^
> committer

It was me who originally committed and pushed this to the bluetooth-next
tree, and the commit does have a signed-off-by from me. However, it
looks like Marcel did some reshuffling/rebasing of the tree and now the
commit shows him in the committer field.

Johan


Re: linux-next: Signed-off-by missing for commit in the bluetooth tree

2017-12-29 Thread Johan Hedberg
Hi,

On Sat, Dec 30, 2017, Stephen Rothwell wrote:
> On Sat, 30 Dec 2017 10:25:52 +1100 Stephen Rothwell  
> wrote:
> > Commit
> > 
> >   0a03f98b98c2 ("Bluetooth: Add a new 04ca:3015 QCA_ROME device")
> > 
> > is missing a Signed-off-by from its .
>   ^
> committer

It was me who originally committed and pushed this to the bluetooth-next
tree, and the commit does have a signed-off-by from me. However, it
looks like Marcel did some reshuffling/rebasing of the tree and now the
commit shows him in the committer field.

Johan


Re: [PATCH v2] Bluetooth: btusb: add ID for LiteOn 04ca:3016

2017-07-31 Thread Johan Hedberg
Hi Brian,

On Mon, Jul 31, 2017, Brian Norris wrote:
> Contains a QCA6174A-5 chipset, with USB BT. Let's support loading
> firmware on it.
> 
> From usb-devices:
> T:  Bus=02 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
> D:  Ver= 2.01 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
> P:  Vendor=04ca ProdID=3016 Rev=00.01
> C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
> I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> 
> Signed-off-by: Brian Norris 
> ---
> v2:
>  * include usb-devices info in commit message
> 
>  drivers/bluetooth/btusb.c | 1 +
>  1 file changed, 1 insertion(+)

Applied to bluetooth-next. Thanks.

Johan


Re: [PATCH v2] Bluetooth: btusb: add ID for LiteOn 04ca:3016

2017-07-31 Thread Johan Hedberg
Hi Brian,

On Mon, Jul 31, 2017, Brian Norris wrote:
> Contains a QCA6174A-5 chipset, with USB BT. Let's support loading
> firmware on it.
> 
> From usb-devices:
> T:  Bus=02 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
> D:  Ver= 2.01 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
> P:  Vendor=04ca ProdID=3016 Rev=00.01
> C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
> I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> 
> Signed-off-by: Brian Norris 
> ---
> v2:
>  * include usb-devices info in commit message
> 
>  drivers/bluetooth/btusb.c | 1 +
>  1 file changed, 1 insertion(+)

Applied to bluetooth-next. Thanks.

Johan


Re: [PATCH] Bluetooth: btusb: add ID for LiteOn 04ca:3016

2017-07-30 Thread Johan Hedberg
Hi Brian,

On Fri, Jul 28, 2017, Brian Norris wrote:
> Contains a QCA6174A-5 chipset, with USB BT. Let's support loading
> firmware on it.
> 
> Signed-off-by: Brian Norris 
> ---
>  drivers/bluetooth/btusb.c | 1 +
>  1 file changed, 1 insertion(+)

Could you also include the relevant usb-devices output for this device
in the commit message? We've followed that convention for all new USB
IDs added to btusb.

Johan


Re: [PATCH] Bluetooth: btusb: add ID for LiteOn 04ca:3016

2017-07-30 Thread Johan Hedberg
Hi Brian,

On Fri, Jul 28, 2017, Brian Norris wrote:
> Contains a QCA6174A-5 chipset, with USB BT. Let's support loading
> firmware on it.
> 
> Signed-off-by: Brian Norris 
> ---
>  drivers/bluetooth/btusb.c | 1 +
>  1 file changed, 1 insertion(+)

Could you also include the relevant usb-devices output for this device
in the commit message? We've followed that convention for all new USB
IDs added to btusb.

Johan


Re: [PATCH] bluetooth.h: __ variants of u8 and friends are not neccessary inside kernel

2016-10-06 Thread Johan Hedberg
Hi,

On Thu, Oct 06, 2016, Joe Perches wrote:
> On Thu, 2016-10-06 at 09:02 +0200, Pavel Machek wrote:
> > I believe you are wrong. bit addressability does not matter, cpu can
> > definitely get the bit values.
> > 
> > u8 foo:1;
> > u8 bar:1;
> > u8 baz:1;
> > 
> > should take 1 byte, where
> > 
> > bool foo, bar, baz;
> > 
> > will take more like 3.
> 
> Definitely true.
> 
> There is only one single bitfield foo here though
> so what you wrote doesn't apply.

What's in the tree is a left-over from times when there were multiple
bit fields in this struct. By the time others were removed and there was
only one left no-one has apparently bothered to update it to a bool or
single u8.

Johan


Re: [PATCH] bluetooth.h: __ variants of u8 and friends are not neccessary inside kernel

2016-10-06 Thread Johan Hedberg
Hi,

On Thu, Oct 06, 2016, Joe Perches wrote:
> On Thu, 2016-10-06 at 09:02 +0200, Pavel Machek wrote:
> > I believe you are wrong. bit addressability does not matter, cpu can
> > definitely get the bit values.
> > 
> > u8 foo:1;
> > u8 bar:1;
> > u8 baz:1;
> > 
> > should take 1 byte, where
> > 
> > bool foo, bar, baz;
> > 
> > will take more like 3.
> 
> Definitely true.
> 
> There is only one single bitfield foo here though
> so what you wrote doesn't apply.

What's in the tree is a left-over from times when there were multiple
bit fields in this struct. By the time others were removed and there was
only one left no-one has apparently bothered to update it to a bool or
single u8.

Johan


Re: Memory (skb) leak in kernel 4.8-rc2

2016-08-20 Thread Johan Hedberg
Hi Marcel,

On Sat, Aug 20, 2016, Marcel Holtmann wrote:
> > I am seeing two skb leaks in the BT sub-system for kernel 4.8-rc2. I
> > only recently re-enabled kmemleak, but I do not think I saw these
> > leaks in 4.7.
> > 
> > The first leak is at btusb_recv_intr+0x12b/0x170 [btusb]. This
> > address refers to the call to bt_skb_alloc() in routine
> > btusb_recv_intr().
> 
> do you have a backtrace for this one? Also which hardware is this?
> 
> > The second leak is at hci_event_packet+0xb8/0x30b0 [bluetooth]. The
> > backtrace for this address is
> > 
> > 0x13d38 is in hci_event_packet (net/bluetooth/hci_event.c:5254).
> > 5249 * various handlers may modify the original one through
> > 5250 * skb_pull() calls, etc.
> > 5251 */
> > 5252if (req_complete_skb || event == HCI_EV_CMD_STATUS ||
> > 5253event == HCI_EV_CMD_COMPLETE)
> > 5254orig_skb = skb_clone(skb, GFP_KERNEL);
> > 5255
> > 5256skb_pull(skb, HCI_EVENT_HDR_SIZE);
> > 5257
> > 5258switch (event) {
> > 
> > I am unable to unload module bluetooth to verify that the second
> > leak is not a false positive; however, the one in btusb is a real
> > memory leak.
> 
> I can not see a leak. Maybe Johan has an idea.

Unfortunately I don't have any ideas either - there is no exit path from
hci_event_packet() after orig_skb has been allocated that would not
result in kfree_skb(orig_skb) being called first.

Johan


Re: Memory (skb) leak in kernel 4.8-rc2

2016-08-20 Thread Johan Hedberg
Hi Marcel,

On Sat, Aug 20, 2016, Marcel Holtmann wrote:
> > I am seeing two skb leaks in the BT sub-system for kernel 4.8-rc2. I
> > only recently re-enabled kmemleak, but I do not think I saw these
> > leaks in 4.7.
> > 
> > The first leak is at btusb_recv_intr+0x12b/0x170 [btusb]. This
> > address refers to the call to bt_skb_alloc() in routine
> > btusb_recv_intr().
> 
> do you have a backtrace for this one? Also which hardware is this?
> 
> > The second leak is at hci_event_packet+0xb8/0x30b0 [bluetooth]. The
> > backtrace for this address is
> > 
> > 0x13d38 is in hci_event_packet (net/bluetooth/hci_event.c:5254).
> > 5249 * various handlers may modify the original one through
> > 5250 * skb_pull() calls, etc.
> > 5251 */
> > 5252if (req_complete_skb || event == HCI_EV_CMD_STATUS ||
> > 5253event == HCI_EV_CMD_COMPLETE)
> > 5254orig_skb = skb_clone(skb, GFP_KERNEL);
> > 5255
> > 5256skb_pull(skb, HCI_EVENT_HDR_SIZE);
> > 5257
> > 5258switch (event) {
> > 
> > I am unable to unload module bluetooth to verify that the second
> > leak is not a false positive; however, the one in btusb is a real
> > memory leak.
> 
> I can not see a leak. Maybe Johan has an idea.

Unfortunately I don't have any ideas either - there is no exit path from
hci_event_packet() after orig_skb has been allocated that would not
result in kfree_skb(orig_skb) being called first.

Johan


Re: [PATCH 1/1] Bluetooth: add printf format attribute to hci_set_[fh]w_info()

2016-08-15 Thread Johan Hedberg
Hi Nicolas,

On Fri, Jul 29, 2016, Nicolas Iooss wrote:
> Commit 5177a83827cd ("Bluetooth: Add debugfs fields for hardware and
> firmware info") introduced hci_set_hw_info() and hci_set_fw_info().
> These functions use kvasprintf_const() but are not marked with a
> __printf attribute.  Adding such an attribute helps detecting issues
> related to printf-formatting at build time.
> 
> Signed-off-by: Nicolas Iooss 
> ---
>  include/net/bluetooth/hci_core.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to bluetooth-next. Thanks.

Johan


Re: [PATCH 1/1] Bluetooth: add printf format attribute to hci_set_[fh]w_info()

2016-08-15 Thread Johan Hedberg
Hi Nicolas,

On Fri, Jul 29, 2016, Nicolas Iooss wrote:
> Commit 5177a83827cd ("Bluetooth: Add debugfs fields for hardware and
> firmware info") introduced hci_set_hw_info() and hci_set_fw_info().
> These functions use kvasprintf_const() but are not marked with a
> __printf attribute.  Adding such an attribute helps detecting issues
> related to printf-formatting at build time.
> 
> Signed-off-by: Nicolas Iooss 
> ---
>  include/net/bluetooth/hci_core.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to bluetooth-next. Thanks.

Johan


Re: [PATCH v4 01/16] bluetooth: Switch SMP to crypto_cipher_encrypt_one()

2016-06-24 Thread Johan Hedberg
On Thu, Jun 23, 2016, Andy Lutomirski wrote:
> SMP does ECB crypto on stack buffers.  This is complicated and
> fragile, and it will not work if the stack is virtually allocated.
> 
> Switch to the crypto_cipher interface, which is simpler and safer.
> 
> Cc: Marcel Holtmann <mar...@holtmann.org>
> Cc: Gustavo Padovan <gust...@padovan.org>
> Cc: Johan Hedberg <johan.hedb...@gmail.com>
> Cc: "David S. Miller" <da...@davemloft.net>
> Cc: linux-blueto...@vger.kernel.org
> Cc: Herbert Xu <herb...@gondor.apana.org.au>
> Cc: net...@vger.kernel.org
> Signed-off-by: Andy Lutomirski <l...@kernel.org>
> ---
>  net/bluetooth/smp.c | 67 
> ++-------
>  1 file changed, 28 insertions(+), 39 deletions(-)

Acked-and-tested-by: Johan Hedberg <johan.hedb...@intel.com>

Johan


Re: [PATCH v4 01/16] bluetooth: Switch SMP to crypto_cipher_encrypt_one()

2016-06-24 Thread Johan Hedberg
On Thu, Jun 23, 2016, Andy Lutomirski wrote:
> SMP does ECB crypto on stack buffers.  This is complicated and
> fragile, and it will not work if the stack is virtually allocated.
> 
> Switch to the crypto_cipher interface, which is simpler and safer.
> 
> Cc: Marcel Holtmann 
> Cc: Gustavo Padovan 
> Cc: Johan Hedberg 
> Cc: "David S. Miller" 
> Cc: linux-blueto...@vger.kernel.org
> Cc: Herbert Xu 
> Cc: net...@vger.kernel.org
> Signed-off-by: Andy Lutomirski 
> ---
>  net/bluetooth/smp.c | 67 
> ++---
>  1 file changed, 28 insertions(+), 39 deletions(-)

Acked-and-tested-by: Johan Hedberg 

Johan


Re: [PATCH] Bluetooth: Use hci_conn_hash_lookup_le

2016-05-02 Thread Johan Hedberg
Hi,

On Fri, Apr 29, 2016, Julia Lawall wrote:
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -4773,7 +4773,8 @@ static int get_conn_info(struct sock *sk, struct 
> hci_dev *hdev, void *data,
>   conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK,
>  >addr.bdaddr);
>   else
> - conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, >addr.bdaddr);
> + conn = hci_conn_hash_lookup_le(hdev, >addr.bdaddr,
> +cp->addr.type);

I don't think is is correct. There are two possible domains for address
types: the user space-facing interface that has three values: BR/EDR, LE
public & LE random, and the internal one which maps to HCI that has two
values: random or public. You'd need to convert from the former to the
latter when making the lookup call, i.e:

conn = hci_conn_hash_lookup_le(hdev, >addr.bdaddr,
   le_addr_type(cp->addr.type));


Johan


Re: [PATCH] Bluetooth: Use hci_conn_hash_lookup_le

2016-05-02 Thread Johan Hedberg
Hi,

On Fri, Apr 29, 2016, Julia Lawall wrote:
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -4773,7 +4773,8 @@ static int get_conn_info(struct sock *sk, struct 
> hci_dev *hdev, void *data,
>   conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK,
>  >addr.bdaddr);
>   else
> - conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, >addr.bdaddr);
> + conn = hci_conn_hash_lookup_le(hdev, >addr.bdaddr,
> +cp->addr.type);

I don't think is is correct. There are two possible domains for address
types: the user space-facing interface that has three values: BR/EDR, LE
public & LE random, and the internal one which maps to HCI that has two
values: random or public. You'd need to convert from the former to the
latter when making the lookup call, i.e:

conn = hci_conn_hash_lookup_le(hdev, >addr.bdaddr,
   le_addr_type(cp->addr.type));


Johan


Re: [PATCH] Bluetooth: hci_core: Avoid mixing up req_complete and req_complete_skb

2016-02-19 Thread Johan Hedberg
Hi Douglas,

On Fri, Feb 19, 2016, Douglas Anderson wrote:
> In commit 44d271377479 ("Bluetooth: Compress the size of struct
> hci_ctrl") we squashed down the size of the structure by using a union
> with the assumption that all users would use the flag to determine
> whether we had a req_complete or a req_complete_skb.
> 
> Unfortunately we had a case in hci_req_cmd_complete() where we weren't
> looking at the flag.  This can result in a situation where we might be
> storing a hci_req_complete_skb_t in a hci_req_complete_t variable, or
> vice versa.
> 
> During some testing I found at least one case where the function
> hci_req_sync_complete() was called improperly because the kernel thought
> that it didn't require an SKB.  Looking through the stack in kgdb I
> found that it was called by hci_event_packet() and that
> hci_event_packet() had both of its locals "req_complete" and
> "req_complete_skb" pointing to the same place: both to
> hci_req_sync_complete().
> 
> Let's make sure we always check the flag.
> 
> For more details on debugging done, see <http://crbug.com/588288>.
> 
> Fixes: 44d271377479 ("Bluetooth: Compress the size of struct hci_ctrl")
> Signed-off-by: Douglas Anderson <diand...@chromium.org>
> ---
> Testing was done on a Chrome OS device on kernel 3.14 w/
> bluetooth-next backports.  Since I couldn't reliably reproduce the
> problem, I simply confirmed that existing functionality worked.
> 
>  net/bluetooth/hci_core.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

Good catch.

Acked-by: Johan Hedberg <johan.hedb...@intel.com>

Marcel, I think we want to send this through our stable tree to 4.5-rc
(where the patch introducing the bug is).

Johan


Re: [PATCH] Bluetooth: hci_core: Avoid mixing up req_complete and req_complete_skb

2016-02-19 Thread Johan Hedberg
Hi Douglas,

On Fri, Feb 19, 2016, Douglas Anderson wrote:
> In commit 44d271377479 ("Bluetooth: Compress the size of struct
> hci_ctrl") we squashed down the size of the structure by using a union
> with the assumption that all users would use the flag to determine
> whether we had a req_complete or a req_complete_skb.
> 
> Unfortunately we had a case in hci_req_cmd_complete() where we weren't
> looking at the flag.  This can result in a situation where we might be
> storing a hci_req_complete_skb_t in a hci_req_complete_t variable, or
> vice versa.
> 
> During some testing I found at least one case where the function
> hci_req_sync_complete() was called improperly because the kernel thought
> that it didn't require an SKB.  Looking through the stack in kgdb I
> found that it was called by hci_event_packet() and that
> hci_event_packet() had both of its locals "req_complete" and
> "req_complete_skb" pointing to the same place: both to
> hci_req_sync_complete().
> 
> Let's make sure we always check the flag.
> 
> For more details on debugging done, see <http://crbug.com/588288>.
> 
> Fixes: 44d271377479 ("Bluetooth: Compress the size of struct hci_ctrl")
> Signed-off-by: Douglas Anderson 
> ---
> Testing was done on a Chrome OS device on kernel 3.14 w/
> bluetooth-next backports.  Since I couldn't reliably reproduce the
> problem, I simply confirmed that existing functionality worked.
> 
>  net/bluetooth/hci_core.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

Good catch.

Acked-by: Johan Hedberg 

Marcel, I think we want to send this through our stable tree to 4.5-rc
(where the patch introducing the bug is).

Johan


Re: [PATCH] bluetooth:Fix error checking in the function hci_disconn_complete_evt

2015-08-24 Thread Johan Hedberg
Hi Nicholas,

On Wed, Aug 19, 2015, Nicholas Krause wrote:
> This fixes error checking in the function hci_disconn_complete_evt
> to properly check if it's call to the function hci_remove_link_key
> returns NULL to signal it has not correctly removed the link key
> on the passed hci_dev structure pointer and if so jump to the goto
> label unlock to unlock the caller's passed hci_dev structure pointer
> as this function cannot continue its intended work after this failed
> 
> Signed-off-by: Nicholas Krause 
> ---
>  net/bluetooth/hci_event.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 32363c2..5174649 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -2448,8 +2448,10 @@ static void hci_disconn_complete_evt(struct hci_dev 
> *hdev, struct sk_buff *skb)
>   reason, mgmt_connected);
>  
>   if (conn->type == ACL_LINK) {
> - if (test_bit(HCI_CONN_FLUSH_KEY, >flags))
> - hci_remove_link_key(hdev, >dst);
> + if (test_bit(HCI_CONN_FLUSH_KEY, >flags)) {
> + if (!hci_remove_link_key(hdev, >dst))
> + goto unlock;
> + }
>  
>   hci_update_page_scan(hdev);
>   }

This doesn't look correct to me. The only scenario where
hci_remove_link_key() may fail is if there was no existing key (it'll
return -ENOENT then). This is a perfectly normal thing that will occur
for a disconnection of a non-paired device, so any other cleanups like
hci_update_page_scan() should still go ahead.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] bluetooth:Fix error checking in the function hci_disconn_complete_evt

2015-08-24 Thread Johan Hedberg
Hi Nicholas,

On Wed, Aug 19, 2015, Nicholas Krause wrote:
 This fixes error checking in the function hci_disconn_complete_evt
 to properly check if it's call to the function hci_remove_link_key
 returns NULL to signal it has not correctly removed the link key
 on the passed hci_dev structure pointer and if so jump to the goto
 label unlock to unlock the caller's passed hci_dev structure pointer
 as this function cannot continue its intended work after this failed
 
 Signed-off-by: Nicholas Krause xerofo...@gmail.com
 ---
  net/bluetooth/hci_event.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
 index 32363c2..5174649 100644
 --- a/net/bluetooth/hci_event.c
 +++ b/net/bluetooth/hci_event.c
 @@ -2448,8 +2448,10 @@ static void hci_disconn_complete_evt(struct hci_dev 
 *hdev, struct sk_buff *skb)
   reason, mgmt_connected);
  
   if (conn-type == ACL_LINK) {
 - if (test_bit(HCI_CONN_FLUSH_KEY, conn-flags))
 - hci_remove_link_key(hdev, conn-dst);
 + if (test_bit(HCI_CONN_FLUSH_KEY, conn-flags)) {
 + if (!hci_remove_link_key(hdev, conn-dst))
 + goto unlock;
 + }
  
   hci_update_page_scan(hdev);
   }

This doesn't look correct to me. The only scenario where
hci_remove_link_key() may fail is if there was no existing key (it'll
return -ENOENT then). This is a perfectly normal thing that will occur
for a disconnection of a non-paired device, so any other cleanups like
hci_update_page_scan() should still go ahead.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [V4.0] Regression: Support for Bluetooth Adapter dropped.

2015-02-27 Thread Johan Hedberg
Hi Jörg,

On Fri, Feb 27, 2015, Jörg Otte wrote:
> Bluetooth has ever been working on my Notebook. I successfully
> use Bluetooth mouse and Obex file transfer for years. And with
> Kernel V4.00 the Adapter is no longer recognized.
> 
> It is an Intel 8087:07da.
> 
> The first bad commit is:
> commit d0ac9eb72b6dceae318c15ee82ef2aaee233666d
> Author: Marcel Holtmann 
> Date:   Wed Jan 28 19:41:43 2015 -0800
> 
> Bluetooth: btusb: Ignore unknown Intel devices with generic descriptor
> 
> Can you please revert that commit?

I don't think a revert is necessary. There's already a patch available
that should fix this:

http://marc.info/?l=linux-bluetooth=142464845203372=2

It should hopefully be making it to 4.0-rc2 or latest 4.0-rc3 (it's in
davem's networking tree at the moment but not yet in Linus's tree).

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [V4.0] Regression: Support for Bluetooth Adapter dropped.

2015-02-27 Thread Johan Hedberg
Hi Jörg,

On Fri, Feb 27, 2015, Jörg Otte wrote:
 Bluetooth has ever been working on my Notebook. I successfully
 use Bluetooth mouse and Obex file transfer for years. And with
 Kernel V4.00 the Adapter is no longer recognized.
 
 It is an Intel 8087:07da.
 
 The first bad commit is:
 commit d0ac9eb72b6dceae318c15ee82ef2aaee233666d
 Author: Marcel Holtmann mar...@holtmann.org
 Date:   Wed Jan 28 19:41:43 2015 -0800
 
 Bluetooth: btusb: Ignore unknown Intel devices with generic descriptor
 
 Can you please revert that commit?

I don't think a revert is necessary. There's already a patch available
that should fix this:

http://marc.info/?l=linux-bluetoothm=142464845203372w=2

It should hopefully be making it to 4.0-rc2 or latest 4.0-rc3 (it's in
davem's networking tree at the moment but not yet in Linus's tree).

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 3.19-rc1 refuse connection from bluetooth headset

2015-02-12 Thread Johan Hedberg
Hi Ethan,

On Thu, Feb 12, 2015, Ethan wrote:
> I met similar issue in kernel 3.10 for Chromebook smart lock feature, I
> have merged your patch but issue still happened.

The whole feature of checking the whitelist when HCI_CONNECTABLE is not
set was introduced only in kernel version 3.18. So it makes no sense to
try to backport my patch to 3.10. If you have issues with 3.10 without
my patch then it's something else that's going on and that deserves a
separate email thread.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 3.19-rc1 refuse connection from bluetooth headset

2015-02-12 Thread Johan Hedberg
Hi Ethan,

On Thu, Feb 12, 2015, Ethan wrote:
 I met similar issue in kernel 3.10 for Chromebook smart lock feature, I
 have merged your patch but issue still happened.

The whole feature of checking the whitelist when HCI_CONNECTABLE is not
set was introduced only in kernel version 3.18. So it makes no sense to
try to backport my patch to 3.10. If you have issues with 3.10 without
my patch then it's something else that's going on and that deserves a
separate email thread.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:sched/core] sched/wait: Introduce wait_on_bit_timeout()

2015-02-04 Thread tip-bot for Johan Hedberg
Commit-ID:  44fc0e5eec00db5fba748803c95920098089c4cc
Gitweb: http://git.kernel.org/tip/44fc0e5eec00db5fba748803c95920098089c4cc
Author: Johan Hedberg 
AuthorDate: Fri, 30 Jan 2015 13:14:36 +0200
Committer:  Ingo Molnar 
CommitDate: Wed, 4 Feb 2015 07:52:32 +0100

sched/wait: Introduce wait_on_bit_timeout()

Add a new wait_on_bit_timeout() helper, basically the same as
wait_on_bit() except that it also takes a 'timeout' parameter.

All the building blocks like bit_wait_timeout() and
out_of_line_wait_on_bit_timeout() are already in place so the
addition is rather simple.

Signed-off-by: Johan Hedberg 
Signed-off-by: Peter Zijlstra (Intel) 
Cc: da...@davemloft.net
Cc: Linus Torvalds 
Link: 
http://lkml.kernel.org/r/1422616476-2917-2-git-send-email-johan.hedb...@gmail.com
Signed-off-by: Ingo Molnar 
---
 include/linux/wait.h | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index 37423e0..537d58e 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -990,6 +990,32 @@ wait_on_bit_io(void *word, int bit, unsigned mode)
 }
 
 /**
+ * wait_on_bit_timeout - wait for a bit to be cleared or a timeout elapses
+ * @word: the word being waited on, a kernel virtual address
+ * @bit: the bit of the word being waited on
+ * @mode: the task state to sleep in
+ * @timeout: timeout, in jiffies
+ *
+ * Use the standard hashed waitqueue table to wait for a bit
+ * to be cleared. This is similar to wait_on_bit(), except also takes a
+ * timeout parameter.
+ *
+ * Returned value will be zero if the bit was cleared before the
+ * @timeout elapsed, or non-zero if the @timeout elapsed or process
+ * received a signal and the mode permitted wakeup on that signal.
+ */
+static inline int
+wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout)
+{
+   might_sleep();
+   if (!test_bit(bit, word))
+   return 0;
+   return out_of_line_wait_on_bit_timeout(word, bit,
+  bit_wait_timeout,
+  mode, timeout);
+}
+
+/**
  * wait_on_bit_action - wait for a bit to be cleared
  * @word: the word being waited on, a kernel virtual address
  * @bit: the bit of the word being waited on
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:sched/core] sched/wait: Introduce wait_on_bit_timeout()

2015-02-04 Thread tip-bot for Johan Hedberg
Commit-ID:  44fc0e5eec00db5fba748803c95920098089c4cc
Gitweb: http://git.kernel.org/tip/44fc0e5eec00db5fba748803c95920098089c4cc
Author: Johan Hedberg johan.hedb...@intel.com
AuthorDate: Fri, 30 Jan 2015 13:14:36 +0200
Committer:  Ingo Molnar mi...@kernel.org
CommitDate: Wed, 4 Feb 2015 07:52:32 +0100

sched/wait: Introduce wait_on_bit_timeout()

Add a new wait_on_bit_timeout() helper, basically the same as
wait_on_bit() except that it also takes a 'timeout' parameter.

All the building blocks like bit_wait_timeout() and
out_of_line_wait_on_bit_timeout() are already in place so the
addition is rather simple.

Signed-off-by: Johan Hedberg johan.hedb...@intel.com
Signed-off-by: Peter Zijlstra (Intel) pet...@infradead.org
Cc: da...@davemloft.net
Cc: Linus Torvalds torva...@linux-foundation.org
Link: 
http://lkml.kernel.org/r/1422616476-2917-2-git-send-email-johan.hedb...@gmail.com
Signed-off-by: Ingo Molnar mi...@kernel.org
---
 include/linux/wait.h | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index 37423e0..537d58e 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -990,6 +990,32 @@ wait_on_bit_io(void *word, int bit, unsigned mode)
 }
 
 /**
+ * wait_on_bit_timeout - wait for a bit to be cleared or a timeout elapses
+ * @word: the word being waited on, a kernel virtual address
+ * @bit: the bit of the word being waited on
+ * @mode: the task state to sleep in
+ * @timeout: timeout, in jiffies
+ *
+ * Use the standard hashed waitqueue table to wait for a bit
+ * to be cleared. This is similar to wait_on_bit(), except also takes a
+ * timeout parameter.
+ *
+ * Returned value will be zero if the bit was cleared before the
+ * @timeout elapsed, or non-zero if the @timeout elapsed or process
+ * received a signal and the mode permitted wakeup on that signal.
+ */
+static inline int
+wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout)
+{
+   might_sleep();
+   if (!test_bit(bit, word))
+   return 0;
+   return out_of_line_wait_on_bit_timeout(word, bit,
+  bit_wait_timeout,
+  mode, timeout);
+}
+
+/**
  * wait_on_bit_action - wait for a bit to be cleared
  * @word: the word being waited on, a kernel virtual address
  * @bit: the bit of the word being waited on
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


sched/wait: Introduce a wait_on_bit_timeout() helper function

2015-01-30 Thread Johan Hedberg
Hi,

We'd need this helper function for the btusb driver for waiting for
certain firmware loading stages which are indicated through a bit-field.
For now we made a local copy in btusb [1] with the intention to switch to
this global version as soon as it makes it upstream. If it's ok we can
also take the patch through the bluetooth-next tree and get it from
there upstream.

Johan

[1] http://marc.info/?l=linux-bluetooth=142260834526228=2


Johan Hedberg (1):
  sched/wait: Introduce wait_on_bit_timeout()

 include/linux/wait.h | 26 ++
 1 file changed, 26 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] sched/wait: Introduce wait_on_bit_timeout()

2015-01-30 Thread Johan Hedberg
From: Johan Hedberg 

Add a new wait_on_bit_timeout() helper, basically the same as
wait_on_bit() except that it also takes a timeout parameter.
All the building blocks like bit_wait_timeout() and
out_of_line_wait_on_bit_timeout() are already in place so the addition
is rather simple.

Signed-off-by: Johan Hedberg 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
---
 include/linux/wait.h | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index 2232ed16635a..920de6df1210 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -991,6 +991,32 @@ wait_on_bit_io(void *word, int bit, unsigned mode)
 }
 
 /**
+ * wait_on_bit_timeout - wait for a bit to be cleared or a timeout elapses
+ * @word: the word being waited on, a kernel virtual address
+ * @bit: the bit of the word being waited on
+ * @mode: the task state to sleep in
+ * @timeout: timeout, in jiffies
+ *
+ * Use the standard hashed waitqueue table to wait for a bit
+ * to be cleared. This is similar to wait_on_bit(), except also takes a
+ * timeout parameter.
+ *
+ * Returned value will be zero if the bit was cleared before the
+ * @timeout elapsed, or non-zero if the @timeout elapsed or process
+ * received a signal and the mode permitted wakeup on that signal.
+ */
+static inline int
+wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout)
+{
+   might_sleep();
+   if (!test_bit(bit, word))
+   return 0;
+   return out_of_line_wait_on_bit_timeout(word, bit,
+  bit_wait_timeout,
+  mode, timeout);
+}
+
+/**
  * wait_on_bit_action - wait for a bit to be cleared
  * @word: the word being waited on, a kernel virtual address
  * @bit: the bit of the word being waited on
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


sched/wait: Introduce a wait_on_bit_timeout() helper function

2015-01-30 Thread Johan Hedberg
Hi,

We'd need this helper function for the btusb driver for waiting for
certain firmware loading stages which are indicated through a bit-field.
For now we made a local copy in btusb [1] with the intention to switch to
this global version as soon as it makes it upstream. If it's ok we can
also take the patch through the bluetooth-next tree and get it from
there upstream.

Johan

[1] http://marc.info/?l=linux-bluetoothm=142260834526228w=2


Johan Hedberg (1):
  sched/wait: Introduce wait_on_bit_timeout()

 include/linux/wait.h | 26 ++
 1 file changed, 26 insertions(+)

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] sched/wait: Introduce wait_on_bit_timeout()

2015-01-30 Thread Johan Hedberg
From: Johan Hedberg johan.hedb...@intel.com

Add a new wait_on_bit_timeout() helper, basically the same as
wait_on_bit() except that it also takes a timeout parameter.
All the building blocks like bit_wait_timeout() and
out_of_line_wait_on_bit_timeout() are already in place so the addition
is rather simple.

Signed-off-by: Johan Hedberg johan.hedb...@intel.com
Cc: Peter Zijlstra pet...@infradead.org
Cc: Ingo Molnar mi...@redhat.com
---
 include/linux/wait.h | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index 2232ed16635a..920de6df1210 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -991,6 +991,32 @@ wait_on_bit_io(void *word, int bit, unsigned mode)
 }
 
 /**
+ * wait_on_bit_timeout - wait for a bit to be cleared or a timeout elapses
+ * @word: the word being waited on, a kernel virtual address
+ * @bit: the bit of the word being waited on
+ * @mode: the task state to sleep in
+ * @timeout: timeout, in jiffies
+ *
+ * Use the standard hashed waitqueue table to wait for a bit
+ * to be cleared. This is similar to wait_on_bit(), except also takes a
+ * timeout parameter.
+ *
+ * Returned value will be zero if the bit was cleared before the
+ * @timeout elapsed, or non-zero if the @timeout elapsed or process
+ * received a signal and the mode permitted wakeup on that signal.
+ */
+static inline int
+wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout)
+{
+   might_sleep();
+   if (!test_bit(bit, word))
+   return 0;
+   return out_of_line_wait_on_bit_timeout(word, bit,
+  bit_wait_timeout,
+  mode, timeout);
+}
+
+/**
  * wait_on_bit_action - wait for a bit to be cleared
  * @word: the word being waited on, a kernel virtual address
  * @bit: the bit of the word being waited on
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] bluetooth: Add hci_h4p driver

2015-01-20 Thread Johan Hedberg
Hi Pavel,

On Tue, Dec 23, 2014, Pavel Machek wrote:
> + while (1) {
> + int cmd, len;
> +
> + fw_pos += cmd_len;
> +
> + if (fw_pos >= fw_entry->size)
> + break;
> +
> + if (fw_pos + 2 > fw_entry->size) {
> + dev_err(info->dev, "Corrupted firmware image\n");
> + err = -EMSGSIZE;
> + break;
> + }
> +
> + cmd_len = fw_entry->data[fw_pos++];
> + cmd_len += fw_entry->data[fw_pos++] << 8;
> + if (cmd_len == 0)
> + break;
> +
> + if (fw_pos + cmd_len > fw_entry->size) {
> + dev_err(info->dev, "Corrupted firmware image\n");
> + err = -EMSGSIZE;
> + break;
> + }
> +
> + /* Skip first two packets */
> + if (++num <= 2)
> + continue;
> +
> + /* Note that this is timing-critical. If sending packets takes 
> too
> +  * long, initialization will fail.
> +  */
> + cmd = fw_entry->data[fw_pos+1];
> + cmd += fw_entry->data[fw_pos+2] << 8;
> + len = fw_entry->data[fw_pos+3];
> +
> + skb = __hci_cmd_sync(info->hdev, cmd, len, 
> fw_entry->data+fw_pos+4, 500);
> + if (IS_ERR(skb)) {
> + dev_err(info->dev, "...sending cmd %x len %d failed 
> %ld\n",
> + cmd, len, PTR_ERR(skb));
> + err = -EIO;
> + break;
> + }
> + }

Looks like the code is leaking skb when __hci_cmd_sync() succeeds.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] bluetooth: Add hci_h4p driver

2015-01-20 Thread Johan Hedberg
Hi Pavel,

On Tue, Dec 23, 2014, Pavel Machek wrote:
 + while (1) {
 + int cmd, len;
 +
 + fw_pos += cmd_len;
 +
 + if (fw_pos = fw_entry-size)
 + break;
 +
 + if (fw_pos + 2  fw_entry-size) {
 + dev_err(info-dev, Corrupted firmware image\n);
 + err = -EMSGSIZE;
 + break;
 + }
 +
 + cmd_len = fw_entry-data[fw_pos++];
 + cmd_len += fw_entry-data[fw_pos++]  8;
 + if (cmd_len == 0)
 + break;
 +
 + if (fw_pos + cmd_len  fw_entry-size) {
 + dev_err(info-dev, Corrupted firmware image\n);
 + err = -EMSGSIZE;
 + break;
 + }
 +
 + /* Skip first two packets */
 + if (++num = 2)
 + continue;
 +
 + /* Note that this is timing-critical. If sending packets takes 
 too
 +  * long, initialization will fail.
 +  */
 + cmd = fw_entry-data[fw_pos+1];
 + cmd += fw_entry-data[fw_pos+2]  8;
 + len = fw_entry-data[fw_pos+3];
 +
 + skb = __hci_cmd_sync(info-hdev, cmd, len, 
 fw_entry-data+fw_pos+4, 500);
 + if (IS_ERR(skb)) {
 + dev_err(info-dev, ...sending cmd %x len %d failed 
 %ld\n,
 + cmd, len, PTR_ERR(skb));
 + err = -EIO;
 + break;
 + }
 + }

Looks like the code is leaking skb when __hci_cmd_sync() succeeds.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 3.19-rc1 refuse connection from bluetooth headset

2014-12-24 Thread Johan Hedberg
Hi Pali,

On Wed, Dec 24, 2014, Pali Rohár wrote:
> > Could you try the attached patch? I think the reason might be
> > the dependence on the HCI_CONNECTABLE flag that's only set if
> > the page scan was enabled through mgmt (which wouldn't be the
> > case with BlueZ 4.98).
> > 
> > Johan
> 
> Hi Johan! Thanks for quick reply. Your patch fixes my problem and 
> auto-connection of my bluetooth headset is working again. Will 
> you forward patch to mainline kernel?

Yes, we'll tag it from 3.17.x onwards where this was introduced.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 3.19-rc1 refuse connection from bluetooth headset

2014-12-24 Thread Johan Hedberg
Hi Pali,

On Wed, Dec 24, 2014, Pali Rohár wrote:
> now I installed 3.19-rc1 kernel and my bluetooth headset was refused
> to connect automatically. I need to start connection manually from
> laptop (and then it working). Before when I started bluetooth headset
> it automatically connected and I did not have to do anything. Now with
> 3.19-rc1 kernel I need to do connection manually and I see error
> messages in hcidump:
> 
>  $ sudo hcidump 
>  HCI sniffer - Bluetooth packet analyzer ver 2.2
>  device: hci0 snap_len: 1028 filter: 0x
>  > HCI Event: Connect Request (0x04) plen 10
>  bdaddr  class 0x240404 type ACL
>  < HCI Command: Reject Connection Request (0x01|0x000a) plen 7
>  bdaddr  reason 0x0f
>  Reason: Connection Rejected due to Unacceptable BD_ADDR
>  > HCI Event: Command Status (0x0f) plen 4
>  Reject Connection Request (0x01|0x000a) status 0x00 ncmd 1
>  > HCI Event: Connect Complete (0x03) plen 11
>  status 0x0f handle 34 bdaddr  type ACL encrypt 0x00
>  Error: Connection Rejected due to Unacceptable BD_ADDR
>  > HCI Event: Connect Request (0x04) plen 10
>  bdaddr  class 0x240404 type ACL
>  < HCI Command: Reject Connection Request (0x01|0x000a) plen 7
>  bdaddr  reason 0x0f
>  Reason: Connection Rejected due to Unacceptable BD_ADDR
>  > HCI Event: Command Status (0x0f) plen 4
>  Reject Connection Request (0x01|0x000a) status 0x00 ncmd 1
>  > HCI Event: Connect Complete (0x03) plen 11
> status 0x0f handle 35 bdaddr  type ACL encrypt 0x00
> Error: Connection Rejected due to Unacceptable BD_ADDR
> 
> (real address of my bluetooth headset was replaced by )
> 
> Can you inspect why new kernel refuse connection from my bluetooth headset?
> 
> I'm still using bluez 4.98 (which is in Ubuntu 12.04), I did not do any 
> update.

Could you try the attached patch? I think the reason might be the
dependence on the HCI_CONNECTABLE flag that's only set if the page scan
was enabled through mgmt (which wouldn't be the case with BlueZ 4.98).

Johan
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index c03d4b09caa3..898dfd7c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2197,7 +2197,8 @@ static void hci_conn_request_evt(struct hci_dev *hdev, 
struct sk_buff *skb)
return;
}
 
-   if (!test_bit(HCI_CONNECTABLE, >dev_flags) &&
+   if (test_bit(HCI_MGMT, >dev_flags) &&
+   !test_bit(HCI_CONNECTABLE, >dev_flags) &&
!hci_bdaddr_list_lookup(>whitelist, >bdaddr,
BDADDR_BREDR)) {
hci_reject_conn(hdev, >bdaddr);


Re: 3.19-rc1 refuse connection from bluetooth headset

2014-12-24 Thread Johan Hedberg
Hi Pali,

On Wed, Dec 24, 2014, Pali Rohár wrote:
 now I installed 3.19-rc1 kernel and my bluetooth headset was refused
 to connect automatically. I need to start connection manually from
 laptop (and then it working). Before when I started bluetooth headset
 it automatically connected and I did not have to do anything. Now with
 3.19-rc1 kernel I need to do connection manually and I see error
 messages in hcidump:
 
  $ sudo hcidump 
  HCI sniffer - Bluetooth packet analyzer ver 2.2
  device: hci0 snap_len: 1028 filter: 0x
   HCI Event: Connect Request (0x04) plen 10
  bdaddr HEADSET_ADDRESS class 0x240404 type ACL
   HCI Command: Reject Connection Request (0x01|0x000a) plen 7
  bdaddr HEADSET_ADDRESS reason 0x0f
  Reason: Connection Rejected due to Unacceptable BD_ADDR
   HCI Event: Command Status (0x0f) plen 4
  Reject Connection Request (0x01|0x000a) status 0x00 ncmd 1
   HCI Event: Connect Complete (0x03) plen 11
  status 0x0f handle 34 bdaddr HEADSET_ADDRESS type ACL encrypt 0x00
  Error: Connection Rejected due to Unacceptable BD_ADDR
   HCI Event: Connect Request (0x04) plen 10
  bdaddr HEADSET_ADDRESS class 0x240404 type ACL
   HCI Command: Reject Connection Request (0x01|0x000a) plen 7
  bdaddr HEADSET_ADDRESS reason 0x0f
  Reason: Connection Rejected due to Unacceptable BD_ADDR
   HCI Event: Command Status (0x0f) plen 4
  Reject Connection Request (0x01|0x000a) status 0x00 ncmd 1
   HCI Event: Connect Complete (0x03) plen 11
 status 0x0f handle 35 bdaddr HEADSET_ADDRESS type ACL encrypt 0x00
 Error: Connection Rejected due to Unacceptable BD_ADDR
 
 (real address of my bluetooth headset was replaced by HEADSET_ADDRESS)
 
 Can you inspect why new kernel refuse connection from my bluetooth headset?
 
 I'm still using bluez 4.98 (which is in Ubuntu 12.04), I did not do any 
 update.

Could you try the attached patch? I think the reason might be the
dependence on the HCI_CONNECTABLE flag that's only set if the page scan
was enabled through mgmt (which wouldn't be the case with BlueZ 4.98).

Johan
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index c03d4b09caa3..898dfd7c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2197,7 +2197,8 @@ static void hci_conn_request_evt(struct hci_dev *hdev, 
struct sk_buff *skb)
return;
}
 
-   if (!test_bit(HCI_CONNECTABLE, hdev-dev_flags) 
+   if (test_bit(HCI_MGMT, hdev-dev_flags) 
+   !test_bit(HCI_CONNECTABLE, hdev-dev_flags) 
!hci_bdaddr_list_lookup(hdev-whitelist, ev-bdaddr,
BDADDR_BREDR)) {
hci_reject_conn(hdev, ev-bdaddr);


Re: 3.19-rc1 refuse connection from bluetooth headset

2014-12-24 Thread Johan Hedberg
Hi Pali,

On Wed, Dec 24, 2014, Pali Rohár wrote:
  Could you try the attached patch? I think the reason might be
  the dependence on the HCI_CONNECTABLE flag that's only set if
  the page scan was enabled through mgmt (which wouldn't be the
  case with BlueZ 4.98).
  
  Johan
 
 Hi Johan! Thanks for quick reply. Your patch fixes my problem and 
 auto-connection of my bluetooth headset is working again. Will 
 you forward patch to mainline kernel?

Yes, we'll tag it from 3.17.x onwards where this was introduced.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


pull request: bluetooth 2014-12-17

2014-12-17 Thread Johan Hedberg
Hi Dave,

Here's the first direct (i.e. skipping the wireless tree) bluetooth pull
request for you, intended for 3.19. It's just one patch: a fix from
Marcel for for remote service discovery filtering which also fixes a
'used uninitialized' compiler warning.

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 65891feac27e26115dc4cce881743a1ac33372df:

  net: Disallow providing non zero VLAN ID for NIC drivers FDB add flow 
(2014-12-16 15:41:19 -0500)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git 
for-upstream

for you to fetch changes up to ea8ae2516ac43028a01c40b58ffa80d3b0afb802:

  Bluetooth: Fix bug with filter in service discovery optimization (2014-12-17 
22:03:49 +0200)


Marcel Holtmann (1):
  Bluetooth: Fix bug with filter in service discovery optimization

 net/bluetooth/mgmt.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)



pgpbHV4WlB2HS.pgp
Description: PGP signature


pull request: bluetooth 2014-12-17

2014-12-17 Thread Johan Hedberg
Hi Dave,

Here's the first direct (i.e. skipping the wireless tree) bluetooth pull
request for you, intended for 3.19. It's just one patch: a fix from
Marcel for for remote service discovery filtering which also fixes a
'used uninitialized' compiler warning.

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 65891feac27e26115dc4cce881743a1ac33372df:

  net: Disallow providing non zero VLAN ID for NIC drivers FDB add flow 
(2014-12-16 15:41:19 -0500)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git 
for-upstream

for you to fetch changes up to ea8ae2516ac43028a01c40b58ffa80d3b0afb802:

  Bluetooth: Fix bug with filter in service discovery optimization (2014-12-17 
22:03:49 +0200)


Marcel Holtmann (1):
  Bluetooth: Fix bug with filter in service discovery optimization

 net/bluetooth/mgmt.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)



pgpbHV4WlB2HS.pgp
Description: PGP signature


pull request: bluetooth 2014-12-12

2014-12-12 Thread Johan Hedberg
Hi John,

These fixes are intended for 3.19, note that the tree to pull from is
bluetooth-next (unlike the subject implies). I'd have normally done a
pull request from bluetooth.git, but since these fixes for 3.19 is all
we have so far I thought it's simpler if you just pull from our -next
tree. The patches consist of:

 - Coccinelle warning fix
 - hci_dev_lock/unlock fixes
 - Fixes for pending mgmt command handling
 - Fixes for properly following the force_lesc_support switch
 - Fix for a Microsoft branded Broadcom adapter
 - New device id for Atheros AR3012
 - Fix for BR/EDR Secure Connections enabling

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 5a34bd5f5d8119def4feb1d2b4e3906b71059416:

  Bluetooth: Enable events for P-256 Public Key and DHKey commands (2014-12-05 
18:17:49 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 9845904fd489288bcf693642c1b31cc463c0b660:

  Bluetooth: Fix mgmt response status when removing adapter (2014-12-12 
13:20:12 +0100)


Fengguang Wu (1):
  Bluetooth: fix err_cast.cocci warnings

Jaganath Kanakkassery (2):
  Bluetooth: Fix missing hci_dev_lock/unlock in mgmt req_complete()
  Bluetooth: Fix missing hci_dev_lock/unlock in hci_event

Janne Heikkinen (1):
  Bluetooth: Add USB device 04ca:3010 as Atheros AR3012

Johan Hedberg (5):
  Bluetooth: Fix calling hci_conn_put too early
  Bluetooth: Fix incorrect pending cmd removal in pairing_complete()
  Bluetooth: Fix notifying mgmt power off before flushing connection list
  Bluetooth: Fix enabling BR/EDR SC when powering on
  Bluetooth: Fix mgmt response status when removing adapter

Marcel Holtmann (4):
  Bluetooth: Check for force_lesc_support when enabling SMP over BR/EDR
  Bluetooth: Check for force_lesc_support before rejecting SMP over BR/EDR
  Bluetooth: Fix generation of non-resolvable private addresses
  Bluetooth: Fix check for support for page scan related commands

 drivers/bluetooth/ath3k.c  |  2 ++
 drivers/bluetooth/btusb.c  |  1 +
 net/bluetooth/hci_conn.c   |  2 +-
 net/bluetooth/hci_core.c   | 60 +++-
 net/bluetooth/hci_event.c  | 20 +++
 net/bluetooth/l2cap_core.c |  5 +--
 net/bluetooth/mgmt.c   | 85 -
 net/bluetooth/smp.c|  5 +--
 8 files changed, 126 insertions(+), 54 deletions(-)



pgpGvPqFE9HG9.pgp
Description: PGP signature


pull request: bluetooth 2014-12-12

2014-12-12 Thread Johan Hedberg
Hi John,

These fixes are intended for 3.19, note that the tree to pull from is
bluetooth-next (unlike the subject implies). I'd have normally done a
pull request from bluetooth.git, but since these fixes for 3.19 is all
we have so far I thought it's simpler if you just pull from our -next
tree. The patches consist of:

 - Coccinelle warning fix
 - hci_dev_lock/unlock fixes
 - Fixes for pending mgmt command handling
 - Fixes for properly following the force_lesc_support switch
 - Fix for a Microsoft branded Broadcom adapter
 - New device id for Atheros AR3012
 - Fix for BR/EDR Secure Connections enabling

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 5a34bd5f5d8119def4feb1d2b4e3906b71059416:

  Bluetooth: Enable events for P-256 Public Key and DHKey commands (2014-12-05 
18:17:49 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 9845904fd489288bcf693642c1b31cc463c0b660:

  Bluetooth: Fix mgmt response status when removing adapter (2014-12-12 
13:20:12 +0100)


Fengguang Wu (1):
  Bluetooth: fix err_cast.cocci warnings

Jaganath Kanakkassery (2):
  Bluetooth: Fix missing hci_dev_lock/unlock in mgmt req_complete()
  Bluetooth: Fix missing hci_dev_lock/unlock in hci_event

Janne Heikkinen (1):
  Bluetooth: Add USB device 04ca:3010 as Atheros AR3012

Johan Hedberg (5):
  Bluetooth: Fix calling hci_conn_put too early
  Bluetooth: Fix incorrect pending cmd removal in pairing_complete()
  Bluetooth: Fix notifying mgmt power off before flushing connection list
  Bluetooth: Fix enabling BR/EDR SC when powering on
  Bluetooth: Fix mgmt response status when removing adapter

Marcel Holtmann (4):
  Bluetooth: Check for force_lesc_support when enabling SMP over BR/EDR
  Bluetooth: Check for force_lesc_support before rejecting SMP over BR/EDR
  Bluetooth: Fix generation of non-resolvable private addresses
  Bluetooth: Fix check for support for page scan related commands

 drivers/bluetooth/ath3k.c  |  2 ++
 drivers/bluetooth/btusb.c  |  1 +
 net/bluetooth/hci_conn.c   |  2 +-
 net/bluetooth/hci_core.c   | 60 +++-
 net/bluetooth/hci_event.c  | 20 +++
 net/bluetooth/l2cap_core.c |  5 +--
 net/bluetooth/mgmt.c   | 85 -
 net/bluetooth/smp.c|  5 +--
 8 files changed, 126 insertions(+), 54 deletions(-)



pgpGvPqFE9HG9.pgp
Description: PGP signature


pull request: bluetooth-next 2014-12-05

2014-12-05 Thread Johan Hedberg
Hi John,

Marcel had a couple more patches that were supposed to be in the pull
request, so here's a new one that supersedes the one I made earlier
today.

In addition to the previous one this contains two more cleanups to
mac802154 as well as support for some new HCI features from the
Bluetooth 4.2 specification.

From the original request:

"Here's what should be the last bluetooth-next pull request for 3.19.
It's rather large but the majority of it is the Low Energy Secure
Connections feature that's part of the Bluetooth 4.2 specification. The
specification went public only this week so we couldn't publish the
corresponding code before that. The code itself can nevertheless be
considered fairly mature as it's been in development for over 6 months
and gone through several interoperability test events.

Besides LE SC the pull request contains an important fix for command
complete events for mgmt sockets which also fixes some leaks of hci_conn
objects when powering off or unplugging Bluetooth adapters.

A smaller feature that's part of the pull request is service discovery
support. This is like normal device discovery except that devices not
matching specific UUIDs or strong enough RSSI are filtered out.

Other changes that the pull request contains are firmware dump support
to the btmrvl driver, firmware download support for Broadcom BCM20702A0
variants, as well as some coding style cleanups in 6lowpan &
ieee802154/mac802154 code."

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit f6af675ef5489c69fc3d4faf8c6f477df3cbf8b9:

  Bluetooth: Automatically flushable packets aren't allowed on LE links 
(2014-11-27 12:12:27 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 5a34bd5f5d8119def4feb1d2b4e3906b71059416:

  Bluetooth: Enable events for P-256 Public Key and DHKey commands (2014-12-05 
18:17:49 +0200)


Amitkumar Karwar (1):
  Bluetooth: btmrvl: remove extra newline character

Heinrich Siebmanns (1):
  Bluetooth: Add support for Broadcom BCM20702A0 variants firmware download

Jakub Pawlowski (4):
  Bluetooth: Add definitions for MGMT_OP_START_SERVICE_DISCOVERY
  Bluetooth: Add extra discovery fields for storing filter information
  Bluetooth: Add logic for UUID filter handling
  Bluetooth: Add support for Start Service Discovery command

Johan Hedberg (62):
  Bluetooth: Track both local and remote L2CAP fixed channel mask
  Bluetooth: Simplify Link Key Notification event handling logic
  Bluetooth: Add basic SMP defines for LE Secure Connections
  Bluetooth: Make auth_req mask dependent on SC enabled or not
  Bluetooth: Add SMP flag for SC and set it when necessary.
  Bluetooth: Update SMP security level to/from auth_req for SC
  Bluetooth: Add mgmt support for LE Secure Connections LTK types
  Bluetooth: Set the correct security level for SC LTKs
  Bluetooth: Use custom macro for testing BR/EDR SC enabled
  Bluetooth: Add mgmt_set_secure_conn support for any LE adapter
  Bluetooth: Update LTK lookup to correctly deal with SC LTKs
  Bluetooth: Remove unused hci_find_ltk function
  Bluetooth: Rename hci_find_ltk_by_addr to hci_find_ltk
  Bluetooth: Set link key generation bit if necessary for LE SC
  Bluetooth: Add basic support for AES-CMAC
  Bluetooth: Add ECC library for LE Secure Connections
  Bluetooth: Add basic support for sending our LE SC public key
  Bluetooth: Add handler function for receiving LE SC public key
  Bluetooth: Add support for sending LE SC Confirm value
  Bluetooth: Add LE SC support for responding to Pairing Confirm PDU
  Bluetooth: Add support for LE SC numeric comparison
  Bluetooth: Add support for handling LE SC user response
  Bluetooth: Add support for LE SC DHKey check PDU
  Bluetooth: Add support for LE SC key generation
  Bluetooth: Track authentication method in SMP context
  Bluetooth: Add selection of the SC authentication method
  Bluetooth: Detect SMP SC debug keys
  Bluetooth: Add check for accidentally generating a debug key
  Bluetooth: Set correct LTK type and authentication for SC
  Bluetooth: Add support for SC just-works pairing
  Bluetooth: Fix BR/EDR Link Key type when derived through LE SC
  Bluetooth: Add passkey entry support for LE SC
  Bluetooth: Fix DHKey Check sending order for slave role
  Bluetooth: Add dummy handler for LE SC keypress notification
  Bluetooth: Use debug keys for SMP when HCI_USE_DEBUG_KEYS is set
  Bluetooth: Add hci_conn flag for new link key generation
  Bluetooth: Add debugfs switch for forcing SMP over BR/EDR
  Bluetooth: Add skeleton for BR/EDR SMP channel
  Bluetooth: Add full SMP 

pull request: bluetooth-next 2014-12-05

2014-12-05 Thread Johan Hedberg
Hi John,

Here's what should be the last bluetooth-next pull request for 3.19.
It's rather large but the majority of it is the Low Energy Secure
Connections feature that's part of the Bluetooth 4.2 specification. The
specification went public only this week so we couldn't publish the
corresponding code before that. The code itself can nevertheless be
considered fairly mature as it's been in development for over 6 months
and gone through several interoperability test events.

Besides LE SC the pull request contains an important fix for command
complete events for mgmt sockets which also fixes some leaks of hci_conn
objects when powering off or unplugging Bluetooth adapters.

A smaller feature that's part of the pull request is service discovery
support. This is like normal device discovery except that devices not
matching specific UUIDs or strong enough RSSI are filtered out.

Other changes that the pull request contains are firmware dump support
to the btmrvl driver, firmware download support for Broadcom BCM20702A0
variants, as well as some coding style cleanups in 6lowpan &
ieee802154/mac802154 code.

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit f6af675ef5489c69fc3d4faf8c6f477df3cbf8b9:

  Bluetooth: Automatically flushable packets aren't allowed on LE links 
(2014-11-27 12:12:27 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to da25cf6a9869cff52b4fd189fdcd322ad2daf023:

  Bluetooth: Report invalid RSSI for service discovery and background scan 
(2014-12-05 14:14:28 +0200)


Amitkumar Karwar (1):
  Bluetooth: btmrvl: remove extra newline character

Heinrich Siebmanns (1):
  Bluetooth: Add support for Broadcom BCM20702A0 variants firmware download

Jakub Pawlowski (4):
  Bluetooth: Add definitions for MGMT_OP_START_SERVICE_DISCOVERY
  Bluetooth: Add extra discovery fields for storing filter information
  Bluetooth: Add logic for UUID filter handling
  Bluetooth: Add support for Start Service Discovery command

Johan Hedberg (62):
  Bluetooth: Track both local and remote L2CAP fixed channel mask
  Bluetooth: Simplify Link Key Notification event handling logic
  Bluetooth: Add basic SMP defines for LE Secure Connections
  Bluetooth: Make auth_req mask dependent on SC enabled or not
  Bluetooth: Add SMP flag for SC and set it when necessary.
  Bluetooth: Update SMP security level to/from auth_req for SC
  Bluetooth: Add mgmt support for LE Secure Connections LTK types
  Bluetooth: Set the correct security level for SC LTKs
  Bluetooth: Use custom macro for testing BR/EDR SC enabled
  Bluetooth: Add mgmt_set_secure_conn support for any LE adapter
  Bluetooth: Update LTK lookup to correctly deal with SC LTKs
  Bluetooth: Remove unused hci_find_ltk function
  Bluetooth: Rename hci_find_ltk_by_addr to hci_find_ltk
  Bluetooth: Set link key generation bit if necessary for LE SC
  Bluetooth: Add basic support for AES-CMAC
  Bluetooth: Add ECC library for LE Secure Connections
  Bluetooth: Add basic support for sending our LE SC public key
  Bluetooth: Add handler function for receiving LE SC public key
  Bluetooth: Add support for sending LE SC Confirm value
  Bluetooth: Add LE SC support for responding to Pairing Confirm PDU
  Bluetooth: Add support for LE SC numeric comparison
  Bluetooth: Add support for handling LE SC user response
  Bluetooth: Add support for LE SC DHKey check PDU
  Bluetooth: Add support for LE SC key generation
  Bluetooth: Track authentication method in SMP context
  Bluetooth: Add selection of the SC authentication method
  Bluetooth: Detect SMP SC debug keys
  Bluetooth: Add check for accidentally generating a debug key
  Bluetooth: Set correct LTK type and authentication for SC
  Bluetooth: Add support for SC just-works pairing
  Bluetooth: Fix BR/EDR Link Key type when derived through LE SC
  Bluetooth: Add passkey entry support for LE SC
  Bluetooth: Fix DHKey Check sending order for slave role
  Bluetooth: Add dummy handler for LE SC keypress notification
  Bluetooth: Use debug keys for SMP when HCI_USE_DEBUG_KEYS is set
  Bluetooth: Add hci_conn flag for new link key generation
  Bluetooth: Add debugfs switch for forcing SMP over BR/EDR
  Bluetooth: Add skeleton for BR/EDR SMP channel
  Bluetooth: Add full SMP BR/EDR support
  Bluetooth: Add SC-only mode support for SMP
  Bluetooth: Unify remote OOB data functions
  Bluetooth: Store address type with OOB data
  Bluetooth: Add support for adding remote OOB data for LE
  Bluetooth: Set SMP OOB flag if OOB data is available
  Bluetooth: Add basic LE SC OOB support for remote OOB 

pull request: bluetooth-next 2014-12-05

2014-12-05 Thread Johan Hedberg
Hi John,

Here's what should be the last bluetooth-next pull request for 3.19.
It's rather large but the majority of it is the Low Energy Secure
Connections feature that's part of the Bluetooth 4.2 specification. The
specification went public only this week so we couldn't publish the
corresponding code before that. The code itself can nevertheless be
considered fairly mature as it's been in development for over 6 months
and gone through several interoperability test events.

Besides LE SC the pull request contains an important fix for command
complete events for mgmt sockets which also fixes some leaks of hci_conn
objects when powering off or unplugging Bluetooth adapters.

A smaller feature that's part of the pull request is service discovery
support. This is like normal device discovery except that devices not
matching specific UUIDs or strong enough RSSI are filtered out.

Other changes that the pull request contains are firmware dump support
to the btmrvl driver, firmware download support for Broadcom BCM20702A0
variants, as well as some coding style cleanups in 6lowpan 
ieee802154/mac802154 code.

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit f6af675ef5489c69fc3d4faf8c6f477df3cbf8b9:

  Bluetooth: Automatically flushable packets aren't allowed on LE links 
(2014-11-27 12:12:27 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to da25cf6a9869cff52b4fd189fdcd322ad2daf023:

  Bluetooth: Report invalid RSSI for service discovery and background scan 
(2014-12-05 14:14:28 +0200)


Amitkumar Karwar (1):
  Bluetooth: btmrvl: remove extra newline character

Heinrich Siebmanns (1):
  Bluetooth: Add support for Broadcom BCM20702A0 variants firmware download

Jakub Pawlowski (4):
  Bluetooth: Add definitions for MGMT_OP_START_SERVICE_DISCOVERY
  Bluetooth: Add extra discovery fields for storing filter information
  Bluetooth: Add logic for UUID filter handling
  Bluetooth: Add support for Start Service Discovery command

Johan Hedberg (62):
  Bluetooth: Track both local and remote L2CAP fixed channel mask
  Bluetooth: Simplify Link Key Notification event handling logic
  Bluetooth: Add basic SMP defines for LE Secure Connections
  Bluetooth: Make auth_req mask dependent on SC enabled or not
  Bluetooth: Add SMP flag for SC and set it when necessary.
  Bluetooth: Update SMP security level to/from auth_req for SC
  Bluetooth: Add mgmt support for LE Secure Connections LTK types
  Bluetooth: Set the correct security level for SC LTKs
  Bluetooth: Use custom macro for testing BR/EDR SC enabled
  Bluetooth: Add mgmt_set_secure_conn support for any LE adapter
  Bluetooth: Update LTK lookup to correctly deal with SC LTKs
  Bluetooth: Remove unused hci_find_ltk function
  Bluetooth: Rename hci_find_ltk_by_addr to hci_find_ltk
  Bluetooth: Set link key generation bit if necessary for LE SC
  Bluetooth: Add basic support for AES-CMAC
  Bluetooth: Add ECC library for LE Secure Connections
  Bluetooth: Add basic support for sending our LE SC public key
  Bluetooth: Add handler function for receiving LE SC public key
  Bluetooth: Add support for sending LE SC Confirm value
  Bluetooth: Add LE SC support for responding to Pairing Confirm PDU
  Bluetooth: Add support for LE SC numeric comparison
  Bluetooth: Add support for handling LE SC user response
  Bluetooth: Add support for LE SC DHKey check PDU
  Bluetooth: Add support for LE SC key generation
  Bluetooth: Track authentication method in SMP context
  Bluetooth: Add selection of the SC authentication method
  Bluetooth: Detect SMP SC debug keys
  Bluetooth: Add check for accidentally generating a debug key
  Bluetooth: Set correct LTK type and authentication for SC
  Bluetooth: Add support for SC just-works pairing
  Bluetooth: Fix BR/EDR Link Key type when derived through LE SC
  Bluetooth: Add passkey entry support for LE SC
  Bluetooth: Fix DHKey Check sending order for slave role
  Bluetooth: Add dummy handler for LE SC keypress notification
  Bluetooth: Use debug keys for SMP when HCI_USE_DEBUG_KEYS is set
  Bluetooth: Add hci_conn flag for new link key generation
  Bluetooth: Add debugfs switch for forcing SMP over BR/EDR
  Bluetooth: Add skeleton for BR/EDR SMP channel
  Bluetooth: Add full SMP BR/EDR support
  Bluetooth: Add SC-only mode support for SMP
  Bluetooth: Unify remote OOB data functions
  Bluetooth: Store address type with OOB data
  Bluetooth: Add support for adding remote OOB data for LE
  Bluetooth: Set SMP OOB flag if OOB data is available
  Bluetooth: Add basic LE SC OOB support for remote OOB data

pull request: bluetooth-next 2014-12-05

2014-12-05 Thread Johan Hedberg
Hi John,

Marcel had a couple more patches that were supposed to be in the pull
request, so here's a new one that supersedes the one I made earlier
today.

In addition to the previous one this contains two more cleanups to
mac802154 as well as support for some new HCI features from the
Bluetooth 4.2 specification.

From the original request:

Here's what should be the last bluetooth-next pull request for 3.19.
It's rather large but the majority of it is the Low Energy Secure
Connections feature that's part of the Bluetooth 4.2 specification. The
specification went public only this week so we couldn't publish the
corresponding code before that. The code itself can nevertheless be
considered fairly mature as it's been in development for over 6 months
and gone through several interoperability test events.

Besides LE SC the pull request contains an important fix for command
complete events for mgmt sockets which also fixes some leaks of hci_conn
objects when powering off or unplugging Bluetooth adapters.

A smaller feature that's part of the pull request is service discovery
support. This is like normal device discovery except that devices not
matching specific UUIDs or strong enough RSSI are filtered out.

Other changes that the pull request contains are firmware dump support
to the btmrvl driver, firmware download support for Broadcom BCM20702A0
variants, as well as some coding style cleanups in 6lowpan 
ieee802154/mac802154 code.

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit f6af675ef5489c69fc3d4faf8c6f477df3cbf8b9:

  Bluetooth: Automatically flushable packets aren't allowed on LE links 
(2014-11-27 12:12:27 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 5a34bd5f5d8119def4feb1d2b4e3906b71059416:

  Bluetooth: Enable events for P-256 Public Key and DHKey commands (2014-12-05 
18:17:49 +0200)


Amitkumar Karwar (1):
  Bluetooth: btmrvl: remove extra newline character

Heinrich Siebmanns (1):
  Bluetooth: Add support for Broadcom BCM20702A0 variants firmware download

Jakub Pawlowski (4):
  Bluetooth: Add definitions for MGMT_OP_START_SERVICE_DISCOVERY
  Bluetooth: Add extra discovery fields for storing filter information
  Bluetooth: Add logic for UUID filter handling
  Bluetooth: Add support for Start Service Discovery command

Johan Hedberg (62):
  Bluetooth: Track both local and remote L2CAP fixed channel mask
  Bluetooth: Simplify Link Key Notification event handling logic
  Bluetooth: Add basic SMP defines for LE Secure Connections
  Bluetooth: Make auth_req mask dependent on SC enabled or not
  Bluetooth: Add SMP flag for SC and set it when necessary.
  Bluetooth: Update SMP security level to/from auth_req for SC
  Bluetooth: Add mgmt support for LE Secure Connections LTK types
  Bluetooth: Set the correct security level for SC LTKs
  Bluetooth: Use custom macro for testing BR/EDR SC enabled
  Bluetooth: Add mgmt_set_secure_conn support for any LE adapter
  Bluetooth: Update LTK lookup to correctly deal with SC LTKs
  Bluetooth: Remove unused hci_find_ltk function
  Bluetooth: Rename hci_find_ltk_by_addr to hci_find_ltk
  Bluetooth: Set link key generation bit if necessary for LE SC
  Bluetooth: Add basic support for AES-CMAC
  Bluetooth: Add ECC library for LE Secure Connections
  Bluetooth: Add basic support for sending our LE SC public key
  Bluetooth: Add handler function for receiving LE SC public key
  Bluetooth: Add support for sending LE SC Confirm value
  Bluetooth: Add LE SC support for responding to Pairing Confirm PDU
  Bluetooth: Add support for LE SC numeric comparison
  Bluetooth: Add support for handling LE SC user response
  Bluetooth: Add support for LE SC DHKey check PDU
  Bluetooth: Add support for LE SC key generation
  Bluetooth: Track authentication method in SMP context
  Bluetooth: Add selection of the SC authentication method
  Bluetooth: Detect SMP SC debug keys
  Bluetooth: Add check for accidentally generating a debug key
  Bluetooth: Set correct LTK type and authentication for SC
  Bluetooth: Add support for SC just-works pairing
  Bluetooth: Fix BR/EDR Link Key type when derived through LE SC
  Bluetooth: Add passkey entry support for LE SC
  Bluetooth: Fix DHKey Check sending order for slave role
  Bluetooth: Add dummy handler for LE SC keypress notification
  Bluetooth: Use debug keys for SMP when HCI_USE_DEBUG_KEYS is set
  Bluetooth: Add hci_conn flag for new link key generation
  Bluetooth: Add debugfs switch for forcing SMP over BR/EDR
  Bluetooth: Add skeleton for BR/EDR SMP channel
  Bluetooth: Add full SMP BR/EDR support
  Bluetooth

pull request: bluetooth-next 2014-11-27

2014-11-27 Thread Johan Hedberg
Hi John,

Here's one more bluetooth-next pull request for 3.19:

 - Minor cleanups for ieee802154 & mac802154
 - Fix for the kernel warning with !TASK_RUNNING reported by Kirill A.
   Shutemov
 - Support for another ath3k device
 - Fix for tracking link key based security level
 - Device tree bindings for btmrvl + a state update fix
 - Fix for wrong ACL flags on LE links

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit a86c02ea38c53b695209b1181f9e2e18d73eb4e8:

  Bluetooth: Add support for Broadcom BCM20702A1 variant (2014-11-18 08:32:14 
+0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to f6af675ef5489c69fc3d4faf8c6f477df3cbf8b9:

  Bluetooth: Automatically flushable packets aren't allowed on LE links 
(2014-11-27 12:12:27 +0200)


Amitkumar Karwar (3):
  Bluetooth: btmrvl: add DT bindings documentation
  Bluetooth: btmrvl: add DT-bindings for gpio-gap
  Bluetooth: btmrvl: update hs_state in interrupt handler

Dmitry Tunin (1):
  Bluetooth: ath3k: Add support of MCI 13d3:3408 bt device

Johan Hedberg (3):
  Bluetooth: Fix setting state back to TASK_RUNNING
  Bluetooth: Fix setting conn->pending_sec_level value from link key
  Bluetooth: Convert link keys list to use RCU

Steven Walter (1):
  Bluetooth: Automatically flushable packets aren't allowed on LE links

Varka Bhadram (2):
  ieee802154: fix spelling mistakes
  mac802154: remove unnecessary if statement

 Documentation/devicetree/bindings/btmrvl.txt | 29 +++
 drivers/bluetooth/ath3k.c|  2 +
 drivers/bluetooth/btmrvl_main.c  | 51 +++---
 drivers/bluetooth/btusb.c|  1 +
 include/net/bluetooth/hci_core.h |  1 +
 net/bluetooth/hci_core.c | 39 ++--
 net/bluetooth/hci_event.c| 51 +-
 net/bluetooth/l2cap_core.c   | 14 +--
 net/ieee802154/6lowpan_rtnl.c|  2 +-
 net/ieee802154/netlink.c |  2 +-
 net/ieee802154/nl-mac.c  |  2 +-
 net/ieee802154/nl-phy.c  |  2 +-
 net/mac802154/iface.c|  8 ++--
 13 files changed, 143 insertions(+), 61 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/btmrvl.txt



pgpriyiKBZolx.pgp
Description: PGP signature


Re: [PATCH v3] Bluetooth: automatically flushable packets aren't allowed on LE links

2014-11-27 Thread Johan Hedberg
Hi Marcel,

On Wed, Nov 26, 2014, Marcel Holtmann wrote:
>  I think Marcel was after just providing a clarifying code comment in
>  both places - having two branches of an if-statement doing exactly the
>  same thing looks a bit weird to me. To make thins completely clear I'd
>  suggest adding a simple helper function that you can call from both
>  places to get the needed flags, something like the following:
> >>> 
> >>> I am actually fine with just adding a comment explaining the complex if
> >>> statement on why it is correct. It is just a helper for everybody to
> >>> understand what and why it is done that way.
> >> 
> >> 
> >> Is the comment I added sufficient, or should I add one for the other if
> >> condition as well?  To me, the second condition is pretty straightforward:
> >> if the caller requested it and the hardware supports it, use NO_FLUSH.  The
> >> relationship between FLUSH/NO_FLUSH and low-energy is much less clear and
> >> more justifies a comment, in my opinion.
> > 
> > Did a miss a reply to this?  How would you like the next iteration of
> > the patch to look?
> 
> can you just send a v4 and I have a look at it. I thing it is best to
> keep the original patch with the rather complicated if statement you
> had. And then add a comment in front of it, why it is that way and
> that it is correct this way.

Since this is moving way too slow for such a trivial patch I went ahead
and added the necessary comments myself and pushed the patch upstream
(to bluetooth-next). So no need to send new revisions of this one.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] Bluetooth: automatically flushable packets aren't allowed on LE links

2014-11-27 Thread Johan Hedberg
Hi Marcel,

On Wed, Nov 26, 2014, Marcel Holtmann wrote:
  I think Marcel was after just providing a clarifying code comment in
  both places - having two branches of an if-statement doing exactly the
  same thing looks a bit weird to me. To make thins completely clear I'd
  suggest adding a simple helper function that you can call from both
  places to get the needed flags, something like the following:
  
  I am actually fine with just adding a comment explaining the complex if
  statement on why it is correct. It is just a helper for everybody to
  understand what and why it is done that way.
  
  
  Is the comment I added sufficient, or should I add one for the other if
  condition as well?  To me, the second condition is pretty straightforward:
  if the caller requested it and the hardware supports it, use NO_FLUSH.  The
  relationship between FLUSH/NO_FLUSH and low-energy is much less clear and
  more justifies a comment, in my opinion.
  
  Did a miss a reply to this?  How would you like the next iteration of
  the patch to look?
 
 can you just send a v4 and I have a look at it. I thing it is best to
 keep the original patch with the rather complicated if statement you
 had. And then add a comment in front of it, why it is that way and
 that it is correct this way.

Since this is moving way too slow for such a trivial patch I went ahead
and added the necessary comments myself and pushed the patch upstream
(to bluetooth-next). So no need to send new revisions of this one.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


pull request: bluetooth-next 2014-11-27

2014-11-27 Thread Johan Hedberg
Hi John,

Here's one more bluetooth-next pull request for 3.19:

 - Minor cleanups for ieee802154  mac802154
 - Fix for the kernel warning with !TASK_RUNNING reported by Kirill A.
   Shutemov
 - Support for another ath3k device
 - Fix for tracking link key based security level
 - Device tree bindings for btmrvl + a state update fix
 - Fix for wrong ACL flags on LE links

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit a86c02ea38c53b695209b1181f9e2e18d73eb4e8:

  Bluetooth: Add support for Broadcom BCM20702A1 variant (2014-11-18 08:32:14 
+0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to f6af675ef5489c69fc3d4faf8c6f477df3cbf8b9:

  Bluetooth: Automatically flushable packets aren't allowed on LE links 
(2014-11-27 12:12:27 +0200)


Amitkumar Karwar (3):
  Bluetooth: btmrvl: add DT bindings documentation
  Bluetooth: btmrvl: add DT-bindings for gpio-gap
  Bluetooth: btmrvl: update hs_state in interrupt handler

Dmitry Tunin (1):
  Bluetooth: ath3k: Add support of MCI 13d3:3408 bt device

Johan Hedberg (3):
  Bluetooth: Fix setting state back to TASK_RUNNING
  Bluetooth: Fix setting conn-pending_sec_level value from link key
  Bluetooth: Convert link keys list to use RCU

Steven Walter (1):
  Bluetooth: Automatically flushable packets aren't allowed on LE links

Varka Bhadram (2):
  ieee802154: fix spelling mistakes
  mac802154: remove unnecessary if statement

 Documentation/devicetree/bindings/btmrvl.txt | 29 +++
 drivers/bluetooth/ath3k.c|  2 +
 drivers/bluetooth/btmrvl_main.c  | 51 +++---
 drivers/bluetooth/btusb.c|  1 +
 include/net/bluetooth/hci_core.h |  1 +
 net/bluetooth/hci_core.c | 39 ++--
 net/bluetooth/hci_event.c| 51 +-
 net/bluetooth/l2cap_core.c   | 14 +--
 net/ieee802154/6lowpan_rtnl.c|  2 +-
 net/ieee802154/netlink.c |  2 +-
 net/ieee802154/nl-mac.c  |  2 +-
 net/ieee802154/nl-phy.c  |  2 +-
 net/mac802154/iface.c|  8 ++--
 13 files changed, 143 insertions(+), 61 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/btmrvl.txt



pgpriyiKBZolx.pgp
Description: PGP signature


Re: [PATCH v6] ath3k: Add support of MCI 13d3:3408 bt device

2014-11-26 Thread Johan Hedberg
Hi Dmitry,

On Tue, Nov 25, 2014, Dmitry Tunin wrote:
> Add support for bluetooth MCI WB335 (AR9565) Wi-Fi+bt module.
> This bluetooth module requires loading patch and sysconfig by ath3k driver.
> 
> T:  Bus=01 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 20 Spd=12   MxCh= 0
> D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
> P:  Vendor=13d3 ProdID=3408 Rev= 0.02
> C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
> A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
> I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
> E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
> I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
> I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
> I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
> I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
> 
> 
> CC: sta...@vger.kernel.org
> Signed-off-by: Dmitry Tunin 
> ---

I was able to apply this patch successfully. It has now been pushed to
the upstream bluetooth-next tree. Thanks.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v6] ath3k: Add support of MCI 13d3:3408 bt device

2014-11-26 Thread Johan Hedberg
Hi Dmitry,

On Tue, Nov 25, 2014, Dmitry Tunin wrote:
 Add support for bluetooth MCI WB335 (AR9565) Wi-Fi+bt module.
 This bluetooth module requires loading patch and sysconfig by ath3k driver.
 
 T:  Bus=01 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 20 Spd=12   MxCh= 0
 D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
 P:  Vendor=13d3 ProdID=3408 Rev= 0.02
 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
 A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
 E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
 E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
 E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
 I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
 E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
 E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
 I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
 E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
 E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
 I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
 E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
 E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
 I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
 E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
 E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
 I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
 E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
 E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
 I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
 E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
 E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
 
 
 CC: sta...@vger.kernel.org
 Signed-off-by: Dmitry Tunin hanipouspi...@gmail.com
 ---

I was able to apply this patch successfully. It has now been pushed to
the upstream bluetooth-next tree. Thanks.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5] ath3k: Add support of MCI 13d3:3408 bt device

2014-11-25 Thread Johan Hedberg
Hi Dmitry,

On Tue, Nov 25, 2014, Dmitry Tunin wrote:
> Add support for bluetooth MCI WB335 (AR9565) Wi-Fi+bt module.
> This bluetooth module requires loading patch and sysconfig by ath3k driver.
> 
> CC: sta...@vger.kernel.org
> Signed-off-by: Dmitry Tunin 
> 
> ---

Seems you've forgotten the /sys/kernel/debug/usb/devices output from the
commit message? (you had it earlier but then dropped it for some reason)

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5] ath3k: Add support of MCI 13d3:3408 bt device

2014-11-25 Thread Johan Hedberg
Hi Dmitry,

On Tue, Nov 25, 2014, Dmitry Tunin wrote:
 Add support for bluetooth MCI WB335 (AR9565) Wi-Fi+bt module.
 This bluetooth module requires loading patch and sysconfig by ath3k driver.
 
 CC: sta...@vger.kernel.org
 Signed-off-by: Dmitry Tunin hanipouspi...@gmail.com
 
 ---

Seems you've forgotten the /sys/kernel/debug/usb/devices output from the
commit message? (you had it earlier but then dropped it for some reason)

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] Bluetooth: automatically flushable packets aren't allowed on LE links

2014-11-20 Thread Johan Hedberg
Hi Marcel,

On Thu, Nov 20, 2014, Marcel Holtmann wrote:
> > static u16 get_acl_flags(struct hci_conn *hcon, struct l2cap_chan *chan)
> > {
> 
> If we do it with a helper functions, then it should only provide the
> l2cap_chan since we can get the hci_conn from there.

One of the places it'd get called from (l2cap_send_cmd)  doesn't have a
l2cap_chan context at all which is why I split this into one mandatory
(hci_conn) and another optoinal (l2cap_chan) parameter.

Anyway, if you're happy with having this inline with a code comment
explaining the (rather complex) if-statement then I'm fine with that
too.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] Bluetooth: automatically flushable packets aren't allowed on LE links

2014-11-20 Thread Johan Hedberg
Hi Steven,

On Wed, Nov 19, 2014, Steven Walter wrote:
> The bluetooth spec states that automatically flushable packets may not
> be sent over a LE-U link.
> 
> Signed-off-by: Steven Walter 
> ---
>  net/bluetooth/l2cap_core.c | 14 --
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index 4af3821..7c4350f 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -764,7 +764,7 @@ static void l2cap_send_cmd(struct l2cap_conn *conn, u8 
> ident, u8 code, u16 len,
>   if (!skb)
>   return;
>  
> - if (lmp_no_flush_capable(conn->hcon->hdev))
> + if (lmp_no_flush_capable(conn->hcon->hdev) || conn->hcon->type == 
> LE_LINK)
>   flags = ACL_START_NO_FLUSH;
>   else
>   flags = ACL_START;
> @@ -784,7 +784,7 @@ static bool __chan_is_moving(struct l2cap_chan *chan)
>  static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb)
>  {
>   struct hci_conn *hcon = chan->conn->hcon;
> - u16 flags;
> + u16 flags = ACL_START;
>  
>   BT_DBG("chan %p, skb %p len %d priority %u", chan, skb, skb->len,
>  skb->priority);
> @@ -798,11 +798,13 @@ static void l2cap_do_send(struct l2cap_chan *chan, 
> struct sk_buff *skb)
>   return;
>   }
>  
> - if (!test_bit(FLAG_FLUSHABLE, >flags) &&
> - lmp_no_flush_capable(hcon->hdev))
> + if (hcon->type == LE_LINK) {
> + /* LE-U does not support auto-flushing packets */
>   flags = ACL_START_NO_FLUSH;
> - else
> - flags = ACL_START;
> + } else if (!test_bit(FLAG_FLUSHABLE, >flags) &&
> + lmp_no_flush_capable(hcon->hdev)) {
> + flags = ACL_START_NO_FLUSH;
> + }

I think Marcel was after just providing a clarifying code comment in
both places - having two branches of an if-statement doing exactly the
same thing looks a bit weird to me. To make thins completely clear I'd
suggest adding a simple helper function that you can call from both
places to get the needed flags, something like the following:

static u16 get_acl_flags(struct hci_conn *hcon, struct l2cap_chan *chan)
{
/* LE-U does not support auto-flushing packets */
if (hcon->type == LE_LINK)
return ACL_START_NO_FLUSH;

/* If non-flushable packets are not supported don't request them */
if (!lmp_no_flush_capable(hcon->hdev))
 return ACL_START;

/* If the chan has requested auto-flushing go with that */
if (chan && test_bit(FLAG_FLUSHABLE, >flags))
return ACL_START;

/* Otherwise go with a non-flushable packet */
return ACL_START_NO_FLUSH;
}

This way we'd avoid complex if-statements and can clearly document each
condition independently.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] Bluetooth: automatically flushable packets aren't allowed on LE links

2014-11-20 Thread Johan Hedberg
Hi Steven,

On Wed, Nov 19, 2014, Steven Walter wrote:
 The bluetooth spec states that automatically flushable packets may not
 be sent over a LE-U link.
 
 Signed-off-by: Steven Walter stevenrwal...@gmail.com
 ---
  net/bluetooth/l2cap_core.c | 14 --
  1 file changed, 8 insertions(+), 6 deletions(-)
 
 diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
 index 4af3821..7c4350f 100644
 --- a/net/bluetooth/l2cap_core.c
 +++ b/net/bluetooth/l2cap_core.c
 @@ -764,7 +764,7 @@ static void l2cap_send_cmd(struct l2cap_conn *conn, u8 
 ident, u8 code, u16 len,
   if (!skb)
   return;
  
 - if (lmp_no_flush_capable(conn-hcon-hdev))
 + if (lmp_no_flush_capable(conn-hcon-hdev) || conn-hcon-type == 
 LE_LINK)
   flags = ACL_START_NO_FLUSH;
   else
   flags = ACL_START;
 @@ -784,7 +784,7 @@ static bool __chan_is_moving(struct l2cap_chan *chan)
  static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb)
  {
   struct hci_conn *hcon = chan-conn-hcon;
 - u16 flags;
 + u16 flags = ACL_START;
  
   BT_DBG(chan %p, skb %p len %d priority %u, chan, skb, skb-len,
  skb-priority);
 @@ -798,11 +798,13 @@ static void l2cap_do_send(struct l2cap_chan *chan, 
 struct sk_buff *skb)
   return;
   }
  
 - if (!test_bit(FLAG_FLUSHABLE, chan-flags) 
 - lmp_no_flush_capable(hcon-hdev))
 + if (hcon-type == LE_LINK) {
 + /* LE-U does not support auto-flushing packets */
   flags = ACL_START_NO_FLUSH;
 - else
 - flags = ACL_START;
 + } else if (!test_bit(FLAG_FLUSHABLE, chan-flags) 
 + lmp_no_flush_capable(hcon-hdev)) {
 + flags = ACL_START_NO_FLUSH;
 + }

I think Marcel was after just providing a clarifying code comment in
both places - having two branches of an if-statement doing exactly the
same thing looks a bit weird to me. To make thins completely clear I'd
suggest adding a simple helper function that you can call from both
places to get the needed flags, something like the following:

static u16 get_acl_flags(struct hci_conn *hcon, struct l2cap_chan *chan)
{
/* LE-U does not support auto-flushing packets */
if (hcon-type == LE_LINK)
return ACL_START_NO_FLUSH;

/* If non-flushable packets are not supported don't request them */
if (!lmp_no_flush_capable(hcon-hdev))
 return ACL_START;

/* If the chan has requested auto-flushing go with that */
if (chan  test_bit(FLAG_FLUSHABLE, chan-flags))
return ACL_START;

/* Otherwise go with a non-flushable packet */
return ACL_START_NO_FLUSH;
}

This way we'd avoid complex if-statements and can clearly document each
condition independently.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] Bluetooth: automatically flushable packets aren't allowed on LE links

2014-11-20 Thread Johan Hedberg
Hi Marcel,

On Thu, Nov 20, 2014, Marcel Holtmann wrote:
  static u16 get_acl_flags(struct hci_conn *hcon, struct l2cap_chan *chan)
  {
 
 If we do it with a helper functions, then it should only provide the
 l2cap_chan since we can get the hci_conn from there.

One of the places it'd get called from (l2cap_send_cmd)  doesn't have a
l2cap_chan context at all which is why I split this into one mandatory
(hci_conn) and another optoinal (l2cap_chan) parameter.

Anyway, if you're happy with having this inline with a code comment
explaining the (rather complex) if-statement then I'm fine with that
too.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: pull request: bluetooth-next 2014-11-07

2014-11-19 Thread Johan Hedberg
Hi Kirill,

On Wed, Nov 19, 2014, Kirill A. Shutemov wrote:
> > From: Johan Hedberg 
> > Date: Tue, 18 Nov 2014 20:00:15 +0200
> > Subject: [PATCH] Bluetooth: Fix setting state back to TASK_RUNNING
> > 
> > In __hci_cmd_sync_ev() and __hci_req_sync() if the hci_req_run() call
> > fails and we return from the functions we should ensure that the state
> > doesn't remain in TASK_INTERRUPTIBLE that we just set it to. This patch
> > fixes missing calls to set_current_state(TASK_RUNNING) in both places.
> > 
> > Signed-off-by: Johan Hedberg 
> 
> This patch helps -- warning is gone.

Thanks! I've resent it to linux-bluetooth with the appropriate
Reported-by/Tested-by credits. It'll be included in the next pull
request for the bluetooth-next tree.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: pull request: bluetooth-next 2014-11-07

2014-11-19 Thread Johan Hedberg
Hi Kirill,

On Wed, Nov 19, 2014, Kirill A. Shutemov wrote:
  From: Johan Hedberg johan.hedb...@intel.com
  Date: Tue, 18 Nov 2014 20:00:15 +0200
  Subject: [PATCH] Bluetooth: Fix setting state back to TASK_RUNNING
  
  In __hci_cmd_sync_ev() and __hci_req_sync() if the hci_req_run() call
  fails and we return from the functions we should ensure that the state
  doesn't remain in TASK_INTERRUPTIBLE that we just set it to. This patch
  fixes missing calls to set_current_state(TASK_RUNNING) in both places.
  
  Signed-off-by: Johan Hedberg johan.hedb...@intel.com
 
 This patch helps -- warning is gone.

Thanks! I've resent it to linux-bluetooth with the appropriate
Reported-by/Tested-by credits. It'll be included in the next pull
request for the bluetooth-next tree.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: pull request: bluetooth-next 2014-11-07

2014-11-18 Thread Johan Hedberg
Hi Kirill,

On Tue, Nov 18, 2014, Kirill A. Shutemov wrote:
> On Fri, Nov 07, 2014 at 11:27:54AM +0200, Johan Hedberg wrote:
> > Chan-yeol Park (1):
> >   Bluetooth: Fix hci_sync missing wakeup interrupt
> 
> Look like this commit causes problem for me:
> 
> [2.018671] [ cut here ]
> [2.022836] WARNING: CPU: 2 PID: 109 at 
> /home/kas/git/public/linux/kernel/sched/core.c:7323 __might_sleep+0xbd/0xd0()
> [2.023166] Freeing unused kernel memory: 944K (880001b14000 - 
> 880001c0)
> [2.030362] do not call blocking ops when !TASK_RUNNING; state=1 set at 
> [] __hci_req_sync+0x7b/0x2a0
> [2.034193] Modules linked in:
> [2.036133] CPU: 2 PID: 109 Comm: kworker/u17:0 Not tainted 
> 3.18.0-rc4-next-20141117-07404-g9dad2ab6df8b #66
> [2.036383] Freeing unused kernel memory: 1404K (8800020a1000 - 
> 88000220)
> [2.038940] Hardware name: LENOVO 3460CC6/3460CC6, BIOS G6ET93WW (2.53 ) 
> 02/04/2013
> [2.040233] Workqueue: hci0 hci_power_on
> [2.041517]  81f51d50 8800d3ecfb28 81afc316 
> 
> [2.042811]  8800d3ecfb78 8800d3ecfb68 810fc11a 
> 8800
> [2.042812]  81f52a28 026d  
> 8800d3ec9200
> [2.042813] Call Trace:
> [2.042818]  [] dump_stack+0x4c/0x6e
> [2.042821]  [] warn_slowpath_common+0x8a/0xc0
> [2.042823]  [] warn_slowpath_fmt+0x46/0x50
> [2.042825]  [] ? __hci_req_sync+0x7b/0x2a0
> [2.042827]  [] ? __hci_req_sync+0x7b/0x2a0
> [2.042830]  [] __might_sleep+0xbd/0xd0
> [2.042832]  [] mutex_lock_nested+0x2f/0x450
> [2.042835]  [] ? _raw_spin_unlock+0x2b/0x50
> [2.042837]  [] ? wake_up_process+0x50/0x50
> [2.042840]  [] __create_file+0x71/0x2c0
> [2.042842]  [] debugfs_create_file+0x1f/0x30
> [2.042844]  [] hci_dev_do_open+0x431/0xa70
> [2.042846]  [] ? process_one_work+0x13c/0x810
> [2.042847]  [] hci_power_on+0x31/0x1e0
> [2.042849]  [] process_one_work+0x1d8/0x810
> [2.042850]  [] ? process_one_work+0x13c/0x810
> [2.042851]  [] worker_thread+0x6b/0x4b0
> [2.042852]  [] ? init_pwq+0xf0/0xf0
> [2.042854]  [] kthread+0x119/0x130
> [2.042855]  [] ? finish_task_switch+0x4d/0x140
> [2.042857]  [] ? kthread_create_on_node+0x240/0x240
> [2.042859]  [] ret_from_fork+0x7c/0xb0
> [2.042861]  [] ? kthread_create_on_node+0x240/0x240
> [2.042863] ---[ end trace 3a40e80ec4ca7159 ]---

At least one obvious bug that the patch in question seems to have is
that it fails to set the state back to TASK_RUNNING in case
hci_req_run() fails and we never call schedule_timeout(). This would
also seem to match the error you're getting.

The attached patch fixes the missing set_current_state() calls - could
you please check if it fixes the issue for you? Out of curiosity, which
HW are you reproducing this with and are there any special steps
involved? Looking at the code it seems that at least some older
Bluetooth adapters could cause some hci_req_run() calls to return
ENODATA, however I wasn't able to get the warning with any of my own
adapters (I have one for pretty much every Bluetooth version).

Johan
>From a75be9ae3c163db6a812330b5b50079891e1f7bd Mon Sep 17 00:00:00 2001
From: Johan Hedberg 
Date: Tue, 18 Nov 2014 20:00:15 +0200
Subject: [PATCH] Bluetooth: Fix setting state back to TASK_RUNNING

In __hci_cmd_sync_ev() and __hci_req_sync() if the hci_req_run() call
fails and we return from the functions we should ensure that the state
doesn't remain in TASK_INTERRUPTIBLE that we just set it to. This patch
fixes missing calls to set_current_state(TASK_RUNNING) in both places.

Signed-off-by: Johan Hedberg 
---
 net/bluetooth/hci_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index d786958a1dec..a67a4b8e4e1c 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1128,6 +1128,7 @@ struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, 
u16 opcode, u32 plen,
err = hci_req_run(, hci_req_sync_complete);
if (err < 0) {
remove_wait_queue(>req_wait_q, );
+   set_current_state(TASK_RUNNING);
return ERR_PTR(err);
}
 
@@ -1196,6 +1197,7 @@ static int __hci_req_sync(struct hci_dev *hdev,
hdev->req_status = 0;
 
remove_wait_queue(>req_wait_q, );
+   set_current_state(TASK_RUNNING);
 
/* ENODATA means the HCI request command queue is empty.
 * This can happen when a request with conditionals doesn't
-- 
2.1.0



pull request: bluetooth-next 2014-11-18

2014-11-18 Thread Johan Hedberg
Hi John,

Here's another bluetooth-next pull request for 3.19. We've got:

 - Various fixes, cleanups and improvements to ieee802154/mac802154
 - Support for a Broadcom BCM20702A1 variant
 - Lots of lockdep fixes
 - Fixed handling of LE CoC errors that should trigger SMP

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 56b2c3eea398c772dd895dc62c18cbdd1ba127b1:

  6lowpan: move skb_free from error paths in decompression (2014-11-06 22:09:48 
+0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to a86c02ea38c53b695209b1181f9e2e18d73eb4e8:

  Bluetooth: Add support for Broadcom BCM20702A1 variant (2014-11-18 08:32:14 
+0100)


Alexander Aring (49):
  Bluetooth: 6lowpan: fix skb_unshare behaviour
  mac802154: move mac pib attributes into wpan_dev
  mac802154: remove mac_params in sdata
  ieee802154: rename wpan_phy_alloc
  ieee802154: add cfg802154_registered_device list
  ieee802154: add iftype to wpan_dev
  ieee802154: add wpan_dev_list
  ieee802154: sysfs add wpan_phy index and name
  ieee802154: add new nl802154 header
  ieee802154: add nl802154 framework
  ieee802154: add wpan_phy dump support
  ieee802154: add wpan_dev dump support
  mac820154: don't set monitor dev_addr
  ieee802154: netlink add rtnl lock
  ieee802154: fix iface dump with lowpan
  mac802154: protect address changes via ioctl
  mac820154: move interface unregistration into iface
  mac820154: rename sdata next to tmp
  mac820154: move mutex locks out of loop
  mac802154: add wpan_phy priv id
  mac802154: change module description
  mac802154: add ifname change notifier
  ieee802154: cleanup cfg802154 intendation
  ieee820154: add channel set support
  ieee820154: remove valid page and channel checks
  ieee820154: add pan_id setting support
  ieee820154: add short_addr setting support
  ieee820154: add backoff exponent setting support
  at86rf230: remove invalid backoff exponent check
  ieee820154: add max csma backoffs setting support
  at86rf230: remove invalid max csma backoffs check
  ieee820154: add max frame retries setting support
  at86rf230: remove invalid max frame retries check
  ieee820154: add lbt setting support
  mac802154: add interframe spacing time handling
  at86rf230: remove interframe spacing time workaround
  mac802154: remove unused prototypes
  at86rf230: fix commentation for symbol duration
  mac802154: remove const for non pointer in driver-ops
  mac802154: remove const for non pointer in cfg ops
  mac802154: remove const for non pointer in rdev-ops
  mac802154: remove deprecated linux-zigbee info
  mac802154: use new nl802154 iftype types
  mac802154: remove wpan_dev parameter in if_add
  ieee802154: add new interface command
  ieee802154: setting extended address while iface add
  ieee802154: add del interface command
  ieee802154: rename and move WPAN_NUM_ defines
  ieee802154: fix byteorder for short address and panid

Fabian Frederick (1):
  Bluetooth: hidp: replace kzalloc/copy_from_user by memdup_user

Fabio K (1):
  Bluetooth: Add support for Broadcom BCM20702A1 variant

Fugang Duan (1):
  Bluetooth: hci-uart-ath: Correct the comments in this driver

Jaganath Kanakkassery (1):
  Bluetooth: Send mgmt_connected only if state is BT_CONFIG

Johan Hedberg (20):
  Bluetooth: Fix sparse warning in amp.c
  Bluetooth: Fix mgmt connected notification
  Bluetooth: 6lowpan: Remove unnecessary RCU callback
  Bluetooth: Fix l2cap_sock_teardown_cb lockdep warning
  Bluetooth: Remove unnecessary hci_dev_lock/unlock in smp.c
  Bluetooth: Use proper nesting annotation for l2cap_chan lock
  Bluetooth: Fix L2CAP socket lock nesting level
  Bluetooth: Fix L2CAP nesting level initialization location
  Bluetooth: Fix correct nesting for 6lowpan server channel
  Bluetooth: Fix sending incorrect LE CoC PDU in BT_CONNECT2 state
  Bluetooth: Add key preference parameter to smp_sufficient_security
  Bluetooth: Trigger SMP for the appropriate LE CoC errors
  Bluetooth: Convert LTK list to RCU
  Bluetooth: Convert IRK list to RCU
  Bluetooth: Remove unnecessary hdev locking in smp.c
  Bluetooth: Add debug logs to help track locking issues
  Bluetooth: Fix clearing remote OOB data through mgmt
  Bluetooth: Fix BR/EDR-only address checks for remote OOB data
  Bluetooth: Use shorter "rand" name for "randomizer"
  Bluetooth: Call drain_workqueue() before resetting state

 MAINTAINERS|   1 +
 drivers/bluetooth/btusb.c  |   2 +
 drivers/bluetooth/hci_ath.c|

Re: pull request: bluetooth-next 2014-11-07

2014-11-18 Thread Johan Hedberg
Hi Kirill,

On Tue, Nov 18, 2014, Kirill A. Shutemov wrote:
 On Fri, Nov 07, 2014 at 11:27:54AM +0200, Johan Hedberg wrote:
  Chan-yeol Park (1):
Bluetooth: Fix hci_sync missing wakeup interrupt
 
 Look like this commit causes problem for me:
 
 [2.018671] [ cut here ]
 [2.022836] WARNING: CPU: 2 PID: 109 at 
 /home/kas/git/public/linux/kernel/sched/core.c:7323 __might_sleep+0xbd/0xd0()
 [2.023166] Freeing unused kernel memory: 944K (880001b14000 - 
 880001c0)
 [2.030362] do not call blocking ops when !TASK_RUNNING; state=1 set at 
 [819ab67b] __hci_req_sync+0x7b/0x2a0
 [2.034193] Modules linked in:
 [2.036133] CPU: 2 PID: 109 Comm: kworker/u17:0 Not tainted 
 3.18.0-rc4-next-20141117-07404-g9dad2ab6df8b #66
 [2.036383] Freeing unused kernel memory: 1404K (8800020a1000 - 
 88000220)
 [2.038940] Hardware name: LENOVO 3460CC6/3460CC6, BIOS G6ET93WW (2.53 ) 
 02/04/2013
 [2.040233] Workqueue: hci0 hci_power_on
 [2.041517]  81f51d50 8800d3ecfb28 81afc316 
 
 [2.042811]  8800d3ecfb78 8800d3ecfb68 810fc11a 
 8800
 [2.042812]  81f52a28 026d  
 8800d3ec9200
 [2.042813] Call Trace:
 [2.042818]  [81afc316] dump_stack+0x4c/0x6e
 [2.042821]  [810fc11a] warn_slowpath_common+0x8a/0xc0
 [2.042823]  [810fc196] warn_slowpath_fmt+0x46/0x50
 [2.042825]  [819ab67b] ? __hci_req_sync+0x7b/0x2a0
 [2.042827]  [819ab67b] ? __hci_req_sync+0x7b/0x2a0
 [2.042830]  [811295ed] __might_sleep+0xbd/0xd0
 [2.042832]  [81b04b8f] mutex_lock_nested+0x2f/0x450
 [2.042835]  [81b0812b] ? _raw_spin_unlock+0x2b/0x50
 [2.042837]  [81131db0] ? wake_up_process+0x50/0x50
 [2.042840]  [813b9ea1] __create_file+0x71/0x2c0
 [2.042842]  [813ba10f] debugfs_create_file+0x1f/0x30
 [2.042844]  [819ac461] hci_dev_do_open+0x431/0xa70
 [2.042846]  [8111a72c] ? process_one_work+0x13c/0x810
 [2.042847]  [819ad2b1] hci_power_on+0x31/0x1e0
 [2.042849]  [8111a7c8] process_one_work+0x1d8/0x810
 [2.042850]  [8111a72c] ? process_one_work+0x13c/0x810
 [2.042851]  [8111b2db] worker_thread+0x6b/0x4b0
 [2.042852]  [8111b270] ? init_pwq+0xf0/0xf0
 [2.042854]  [81120ef9] kthread+0x119/0x130
 [2.042855]  [8112923d] ? finish_task_switch+0x4d/0x140
 [2.042857]  [81120de0] ? kthread_create_on_node+0x240/0x240
 [2.042859]  [81b08cfc] ret_from_fork+0x7c/0xb0
 [2.042861]  [81120de0] ? kthread_create_on_node+0x240/0x240
 [2.042863] ---[ end trace 3a40e80ec4ca7159 ]---

At least one obvious bug that the patch in question seems to have is
that it fails to set the state back to TASK_RUNNING in case
hci_req_run() fails and we never call schedule_timeout(). This would
also seem to match the error you're getting.

The attached patch fixes the missing set_current_state() calls - could
you please check if it fixes the issue for you? Out of curiosity, which
HW are you reproducing this with and are there any special steps
involved? Looking at the code it seems that at least some older
Bluetooth adapters could cause some hci_req_run() calls to return
ENODATA, however I wasn't able to get the warning with any of my own
adapters (I have one for pretty much every Bluetooth version).

Johan
From a75be9ae3c163db6a812330b5b50079891e1f7bd Mon Sep 17 00:00:00 2001
From: Johan Hedberg johan.hedb...@intel.com
Date: Tue, 18 Nov 2014 20:00:15 +0200
Subject: [PATCH] Bluetooth: Fix setting state back to TASK_RUNNING

In __hci_cmd_sync_ev() and __hci_req_sync() if the hci_req_run() call
fails and we return from the functions we should ensure that the state
doesn't remain in TASK_INTERRUPTIBLE that we just set it to. This patch
fixes missing calls to set_current_state(TASK_RUNNING) in both places.

Signed-off-by: Johan Hedberg johan.hedb...@intel.com
---
 net/bluetooth/hci_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index d786958a1dec..a67a4b8e4e1c 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1128,6 +1128,7 @@ struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, 
u16 opcode, u32 plen,
err = hci_req_run(req, hci_req_sync_complete);
if (err  0) {
remove_wait_queue(hdev-req_wait_q, wait);
+   set_current_state(TASK_RUNNING);
return ERR_PTR(err);
}
 
@@ -1196,6 +1197,7 @@ static int __hci_req_sync(struct hci_dev *hdev,
hdev-req_status = 0;
 
remove_wait_queue(hdev-req_wait_q, wait);
+   set_current_state(TASK_RUNNING);
 
/* ENODATA means the HCI request command queue is empty

pull request: bluetooth-next 2014-11-18

2014-11-18 Thread Johan Hedberg
Hi John,

Here's another bluetooth-next pull request for 3.19. We've got:

 - Various fixes, cleanups and improvements to ieee802154/mac802154
 - Support for a Broadcom BCM20702A1 variant
 - Lots of lockdep fixes
 - Fixed handling of LE CoC errors that should trigger SMP

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 56b2c3eea398c772dd895dc62c18cbdd1ba127b1:

  6lowpan: move skb_free from error paths in decompression (2014-11-06 22:09:48 
+0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to a86c02ea38c53b695209b1181f9e2e18d73eb4e8:

  Bluetooth: Add support for Broadcom BCM20702A1 variant (2014-11-18 08:32:14 
+0100)


Alexander Aring (49):
  Bluetooth: 6lowpan: fix skb_unshare behaviour
  mac802154: move mac pib attributes into wpan_dev
  mac802154: remove mac_params in sdata
  ieee802154: rename wpan_phy_alloc
  ieee802154: add cfg802154_registered_device list
  ieee802154: add iftype to wpan_dev
  ieee802154: add wpan_dev_list
  ieee802154: sysfs add wpan_phy index and name
  ieee802154: add new nl802154 header
  ieee802154: add nl802154 framework
  ieee802154: add wpan_phy dump support
  ieee802154: add wpan_dev dump support
  mac820154: don't set monitor dev_addr
  ieee802154: netlink add rtnl lock
  ieee802154: fix iface dump with lowpan
  mac802154: protect address changes via ioctl
  mac820154: move interface unregistration into iface
  mac820154: rename sdata next to tmp
  mac820154: move mutex locks out of loop
  mac802154: add wpan_phy priv id
  mac802154: change module description
  mac802154: add ifname change notifier
  ieee802154: cleanup cfg802154 intendation
  ieee820154: add channel set support
  ieee820154: remove valid page and channel checks
  ieee820154: add pan_id setting support
  ieee820154: add short_addr setting support
  ieee820154: add backoff exponent setting support
  at86rf230: remove invalid backoff exponent check
  ieee820154: add max csma backoffs setting support
  at86rf230: remove invalid max csma backoffs check
  ieee820154: add max frame retries setting support
  at86rf230: remove invalid max frame retries check
  ieee820154: add lbt setting support
  mac802154: add interframe spacing time handling
  at86rf230: remove interframe spacing time workaround
  mac802154: remove unused prototypes
  at86rf230: fix commentation for symbol duration
  mac802154: remove const for non pointer in driver-ops
  mac802154: remove const for non pointer in cfg ops
  mac802154: remove const for non pointer in rdev-ops
  mac802154: remove deprecated linux-zigbee info
  mac802154: use new nl802154 iftype types
  mac802154: remove wpan_dev parameter in if_add
  ieee802154: add new interface command
  ieee802154: setting extended address while iface add
  ieee802154: add del interface command
  ieee802154: rename and move WPAN_NUM_ defines
  ieee802154: fix byteorder for short address and panid

Fabian Frederick (1):
  Bluetooth: hidp: replace kzalloc/copy_from_user by memdup_user

Fabio K (1):
  Bluetooth: Add support for Broadcom BCM20702A1 variant

Fugang Duan (1):
  Bluetooth: hci-uart-ath: Correct the comments in this driver

Jaganath Kanakkassery (1):
  Bluetooth: Send mgmt_connected only if state is BT_CONFIG

Johan Hedberg (20):
  Bluetooth: Fix sparse warning in amp.c
  Bluetooth: Fix mgmt connected notification
  Bluetooth: 6lowpan: Remove unnecessary RCU callback
  Bluetooth: Fix l2cap_sock_teardown_cb lockdep warning
  Bluetooth: Remove unnecessary hci_dev_lock/unlock in smp.c
  Bluetooth: Use proper nesting annotation for l2cap_chan lock
  Bluetooth: Fix L2CAP socket lock nesting level
  Bluetooth: Fix L2CAP nesting level initialization location
  Bluetooth: Fix correct nesting for 6lowpan server channel
  Bluetooth: Fix sending incorrect LE CoC PDU in BT_CONNECT2 state
  Bluetooth: Add key preference parameter to smp_sufficient_security
  Bluetooth: Trigger SMP for the appropriate LE CoC errors
  Bluetooth: Convert LTK list to RCU
  Bluetooth: Convert IRK list to RCU
  Bluetooth: Remove unnecessary hdev locking in smp.c
  Bluetooth: Add debug logs to help track locking issues
  Bluetooth: Fix clearing remote OOB data through mgmt
  Bluetooth: Fix BR/EDR-only address checks for remote OOB data
  Bluetooth: Use shorter rand name for randomizer
  Bluetooth: Call drain_workqueue() before resetting state

 MAINTAINERS|   1 +
 drivers/bluetooth/btusb.c  |   2 +
 drivers/bluetooth/hci_ath.c|   2 +-
 drivers/net

pull request: bluetooth-next 2014-11-07

2014-11-07 Thread Johan Hedberg
Hi John

Here's another set of patches for 3.19. Most of it is again fixes and
cleanups to ieee802154 related code from Alexander Aring. We've also got
better handling of hardware error events along with a proper API for HCI
drivers to notify the HCI core of such situations. There's also a minor
fix for mgmt events as well as a sparse warning fix. The code for
sending HCI commands synchronously also gets a fix where we might loose
the completion event in the case of very fast HW (particularly easily
reproducible with an emulated HCI device).

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 6bc6c49f1e2f3ab1bec05d1c08aad219ab4eb5d0:

  mwifiex: add cfg80211 dump_survey handler (2014-10-31 16:07:49 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 56b2c3eea398c772dd895dc62c18cbdd1ba127b1:

  6lowpan: move skb_free from error paths in decompression (2014-11-06 22:09:48 
+0100)


Alexander Aring (41):
  at86rf230: fix page parameter constraints
  ieee802154: remove default channel settings
  at86rf230: add default channel settings
  cfg802154: introduce cfg802154_registered_device
  mac802154: introduce mac802154_config_ops
  ieee802154: add helper wpan_phy_to_rdev function
  cfg802154: convert deprecated iface add and del
  ieee802154: don't allow to change addr while netif_running
  mac802154: add helper for converting dev_addr
  mac802154: set extended address filter on ifup
  mac802154: set short address filter on ifup
  mac802154: set panid address filter on ifup
  mac802154: move phy settings into netlink receive
  ieee802154: add extended address validation helper
  mac802154: iface: add validation for extended address
  ieee802154: 6lowpan: remove set of mac address
  ieee802154: add missing ULL definition
  ieee802154: fix byteorder issues
  mac802154: fix byteorder issues
  ieee802154: sysfs: add missing include
  mac802154: cfg: add missing include
  ieee802154: remove unnecessary functions
  netdevice: add ieee802154_ptr to net_device
  ieee802154: rework wpan_phy index assignment
  ieee802154: remove nl802154 unused functions
  mac802154: move interface del handling in iface
  mac802154: move interface add handling in iface
  mac802154: move dev_hold out of ieee802154_if_add
  ieee802154: rework interface registration
  ieee802154: remove mlme get_phy callback
  mac802154: add default interface registration
  mac802154: add ieee802154_vif struct
  ieee802154: add IEEE802154_EXTENDED_ADDR_LEN
  ieee802154: add ieee802154_random_extended_addr
  mac802154: add ieee802154_le64_to_be64
  mac802154: cleanup ieee802154_netdev_to_extended_addr
  mac802154: add support for perm_extended_addr
  at86rf230: generate random perm extended address
  at86rf230: add force slotted operation bit
  mac802154: use IEEE802154_EXTENDED_ADDR_LEN
  mac802154: fix typo promisuous to promiscuous

Chan-yeol Park (1):
  Bluetooth: Fix hci_sync missing wakeup interrupt

Dan Carpenter (1):
  ieee802154: || vs && in ieee802154_is_valid_extended_addr()

Fengguang Wu (1):
  at86rf230: fix simple_return.cocci warnings

Johan Hedberg (1):
  Bluetooth: Fix sparse warnings in RFCOMM

Kuba Pawlak (2):
  Bluetooth: Clear role switch pending flag
  Bluetooth: Sort switch cases by opcode's numeric value

Marcel Holtmann (11):
  Bluetooth: Check status of command complete for HCI_Reset
  Bluetooth: Print error message for HCI_Hardware_Error event
  Bluetooth: Use HCI_EV_HARDWARE_ERROR define for event payload
  Bluetooth: Introduce BT_BREDR and BT_LE config options
  Bluetooth: Add hci_reset_dev() for driver triggerd stack reset
  Bluetooth: Switch HCI H5 driver to use hci_reset_dev() function
  Bluetooth: Introduce HCI_QUIRK_STRICT_DUPLICATE_FILTER
  Bluetooth: Set HCI_QUIRK_STRICT_DUPLICATE_FILTER for Broadcom devices
  Bluetooth: Consolidate whitelist debugfs entry into device_list
  Bluetooth: btusb: Add internal callback for USB bulk rx data
  Bluetooth: Add hci_conn_lookup_type() helper function

Martin Townsend (1):
  6lowpan: move skb_free from error paths in decompression

Simon Vincent (1):
  6lowpan: fix udp header compression when using raw sockets

Szymon Janc (1):
  Bluetooth: Fix invalid response for 'Start Discovery' command

 MAINTAINERS|   1 -
 drivers/bluetooth/btusb.c  |   7 +-
 drivers/bluetooth/hci_h5.c |  13 +--
 drivers/net/ieee802154/at86rf230.c |  13 ++-
 drivers/net/ieee802154/cc2520.c|   1 +
 include/linux/ieee802154.h |  32 ++
 include/linux/netdevice.h   

pull request: bluetooth-next 2014-11-07

2014-11-07 Thread Johan Hedberg
Hi John

Here's another set of patches for 3.19. Most of it is again fixes and
cleanups to ieee802154 related code from Alexander Aring. We've also got
better handling of hardware error events along with a proper API for HCI
drivers to notify the HCI core of such situations. There's also a minor
fix for mgmt events as well as a sparse warning fix. The code for
sending HCI commands synchronously also gets a fix where we might loose
the completion event in the case of very fast HW (particularly easily
reproducible with an emulated HCI device).

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 6bc6c49f1e2f3ab1bec05d1c08aad219ab4eb5d0:

  mwifiex: add cfg80211 dump_survey handler (2014-10-31 16:07:49 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 56b2c3eea398c772dd895dc62c18cbdd1ba127b1:

  6lowpan: move skb_free from error paths in decompression (2014-11-06 22:09:48 
+0100)


Alexander Aring (41):
  at86rf230: fix page parameter constraints
  ieee802154: remove default channel settings
  at86rf230: add default channel settings
  cfg802154: introduce cfg802154_registered_device
  mac802154: introduce mac802154_config_ops
  ieee802154: add helper wpan_phy_to_rdev function
  cfg802154: convert deprecated iface add and del
  ieee802154: don't allow to change addr while netif_running
  mac802154: add helper for converting dev_addr
  mac802154: set extended address filter on ifup
  mac802154: set short address filter on ifup
  mac802154: set panid address filter on ifup
  mac802154: move phy settings into netlink receive
  ieee802154: add extended address validation helper
  mac802154: iface: add validation for extended address
  ieee802154: 6lowpan: remove set of mac address
  ieee802154: add missing ULL definition
  ieee802154: fix byteorder issues
  mac802154: fix byteorder issues
  ieee802154: sysfs: add missing include
  mac802154: cfg: add missing include
  ieee802154: remove unnecessary functions
  netdevice: add ieee802154_ptr to net_device
  ieee802154: rework wpan_phy index assignment
  ieee802154: remove nl802154 unused functions
  mac802154: move interface del handling in iface
  mac802154: move interface add handling in iface
  mac802154: move dev_hold out of ieee802154_if_add
  ieee802154: rework interface registration
  ieee802154: remove mlme get_phy callback
  mac802154: add default interface registration
  mac802154: add ieee802154_vif struct
  ieee802154: add IEEE802154_EXTENDED_ADDR_LEN
  ieee802154: add ieee802154_random_extended_addr
  mac802154: add ieee802154_le64_to_be64
  mac802154: cleanup ieee802154_netdev_to_extended_addr
  mac802154: add support for perm_extended_addr
  at86rf230: generate random perm extended address
  at86rf230: add force slotted operation bit
  mac802154: use IEEE802154_EXTENDED_ADDR_LEN
  mac802154: fix typo promisuous to promiscuous

Chan-yeol Park (1):
  Bluetooth: Fix hci_sync missing wakeup interrupt

Dan Carpenter (1):
  ieee802154: || vs  in ieee802154_is_valid_extended_addr()

Fengguang Wu (1):
  at86rf230: fix simple_return.cocci warnings

Johan Hedberg (1):
  Bluetooth: Fix sparse warnings in RFCOMM

Kuba Pawlak (2):
  Bluetooth: Clear role switch pending flag
  Bluetooth: Sort switch cases by opcode's numeric value

Marcel Holtmann (11):
  Bluetooth: Check status of command complete for HCI_Reset
  Bluetooth: Print error message for HCI_Hardware_Error event
  Bluetooth: Use HCI_EV_HARDWARE_ERROR define for event payload
  Bluetooth: Introduce BT_BREDR and BT_LE config options
  Bluetooth: Add hci_reset_dev() for driver triggerd stack reset
  Bluetooth: Switch HCI H5 driver to use hci_reset_dev() function
  Bluetooth: Introduce HCI_QUIRK_STRICT_DUPLICATE_FILTER
  Bluetooth: Set HCI_QUIRK_STRICT_DUPLICATE_FILTER for Broadcom devices
  Bluetooth: Consolidate whitelist debugfs entry into device_list
  Bluetooth: btusb: Add internal callback for USB bulk rx data
  Bluetooth: Add hci_conn_lookup_type() helper function

Martin Townsend (1):
  6lowpan: move skb_free from error paths in decompression

Simon Vincent (1):
  6lowpan: fix udp header compression when using raw sockets

Szymon Janc (1):
  Bluetooth: Fix invalid response for 'Start Discovery' command

 MAINTAINERS|   1 -
 drivers/bluetooth/btusb.c  |   7 +-
 drivers/bluetooth/hci_h5.c |  13 +--
 drivers/net/ieee802154/at86rf230.c |  13 ++-
 drivers/net/ieee802154/cc2520.c|   1 +
 include/linux/ieee802154.h |  32 ++
 include/linux/netdevice.h  |   3 +
 include

pull request: bluetooth-next 2014-10-31

2014-10-31 Thread Johan Hedberg
pan-phy
  mac802154: rework sdata state change to running
  mac802154: rename running to started
  mac802154: move local started handling
  mac802154: add synchronization handling
  mac802154: iface: remove assign to zero
  mac802154: remove channel attributes from sdata
  mac802154: move mac_params functions into mac_cmd
  mac802154: cleanup open count handling
  ieee802154: introduce sysfs file
  mac802154: main: remove unnecessary include
  mac802154: remove tab after define
  mac802154: add IEEE802154_HW_ARET hw flag
  mac802154: add hardware address filter flag
  mac802154: add support for promiscuous mode
  at86rf230: add support for promiscuous mode
  mac802154: separate omit tx/rx flags
  mac802154: rx: remove unnecessary parameter
  mac802154: rx: simplify crc receive handling
  mac802154: rx: add software checksum filtering check
  mac802154: rx: remove override pkt_type set to PACKET_HOST
  mac802154: rx: use netif_receive_skb
  mac802154: rx: add rx stats incrementation
  mac802154: rx: monitor receive cleanup
  mac802154: rx: add error handling after skb_clone
  at86rf230: deliver with checksum
  mac802154: add basic support for monitor

Alfonso Acosta (4):
  Bluetooth: Refactor arguments of mgmt_device_connected
  Bluetooth: Include ADV_IND report in Device Connected event
  Bluetooth: Remove redundant check on hci_conn's device class
  Bluetooth: Defer connection-parameter removal when unpairing

Anantha Krishnan (1):
  Bluetooth: Add support for Acer [0489:e078]

Dan Carpenter (1):
  Bluetooth: 6lowpan: use after free in disconnect_devices()

Fabian Frederick (1):
  Bluetooth: fix shadow warning in hci_disconnect()

Johan Hedberg (6):
  Bluetooth: Pass only crypto context to SMP crypto functions
  Bluetooth: Add skeleton for SMP self-tests
  Bluetooth: Add self-tests for SMP crypto functions
  Bluetooth: Revert SMP self-test patches
  Bluetooth: Fix LE connection timeout deadlock
  Bluetooth: Fix check for direct advertising

Jukka Rissanen (3):
  Bluetooth: 6lowpan: Converting rwlocks to use RCU
  Bluetooth: 6lowpan: Fix lockdep splats
  Bluetooth: Wrong style spin lock used

Julien Catalano (1):
  trivial: net/mac802154: Fix Kconfig typo

Li RongQing (1):
  Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper

Loic Poulain (1):
  Bluetooth: HCI H5 peer reset detection

Marcel Holtmann (1):
  Bluetooth: Clear LE white list when resetting controller

Martin Townsend (6):
  6lowpan: Use skb_cow in IPHC decompression.
  Bluetooth: Fix missing channel unlock in l2cap_le_credits
  6lowpan: remove skb_deliver from IPHC
  6lowpan: fix process_data return values
  bluetooth:6lowpan: use consume_skb when packet processed successfully
  ieee802154: 6lowpan: rename process_data and lowpan_process_data

Simon Vincent (2):
  ieee802154: 6lowpan: Drop PACKET_OTHERHOST skbs in 6lowpan
  ieee802154: mrf24j40: Add support for MRF24J40MC

Stephen Hemminger (1):
  Bluetooth: spelling fixes

Szymon Janc (2):
  Bluetooth: Fix RFCOMM NSC response
  Bluetooth: Improve RFCOMM __test_pf macro robustness

Varka Bhadram (1):
  MAINTAINERS: add cc2520 driver maintainer

 MAINTAINERS   |  15 +
 drivers/bluetooth/ath3k.c |   2 +
 drivers/bluetooth/btusb.c |   1 +
 drivers/bluetooth/hci_h5.c|  34 ++
 drivers/net/ieee802154/Kconfig|  10 -
 drivers/net/ieee802154/Makefile   |   1 -
 drivers/net/ieee802154/at86rf230.c| 392 
 drivers/net/ieee802154/cc2520.c   |  70 +--
 drivers/net/ieee802154/fakehard.c | 427 --
 drivers/net/ieee802154/fakelb.c   |  92 ++--
 drivers/net/ieee802154/mrf24j40.c | 104 +++--
 include/{net => linux}/ieee802154.h   |  23 +-
 include/linux/nl802154.h  |   4 -
 include/net/6lowpan.h |  12 +-
 include/net/af_ieee802154.h   |   4 -
 include/net/bluetooth/hci_core.h  |   8 +-
 include/net/{wpan-phy.h => cfg802154.h}   |  22 +-
 include/net/ieee802154_netdev.h   |   6 +-
 include/net/mac802154.h   | 124 +++--
 include/net/nl802154.h|   4 -
 net/6lowpan/iphc.c|  71 +--
 net/bluetooth/6lowpan.c   | 284 +++-
 net/bluetooth/hci_conn.c  |  14 +-
 net/bluetooth/hci_core.c  |  16 +-
 net/bluetooth/hci_event.c |  50 ++-
 net/bluetooth/hci_sock.c  |   2 +-
 net/bluetooth/l2cap_core.c|   7 +-
 net/bluetooth/mgmt.c  |  83 +++-
 net/bluetooth/rfco

pull request: bluetooth-next 2014-10-31

2014-10-31 Thread Johan Hedberg
-phy
  mac802154: rework sdata state change to running
  mac802154: rename running to started
  mac802154: move local started handling
  mac802154: add synchronization handling
  mac802154: iface: remove assign to zero
  mac802154: remove channel attributes from sdata
  mac802154: move mac_params functions into mac_cmd
  mac802154: cleanup open count handling
  ieee802154: introduce sysfs file
  mac802154: main: remove unnecessary include
  mac802154: remove tab after define
  mac802154: add IEEE802154_HW_ARET hw flag
  mac802154: add hardware address filter flag
  mac802154: add support for promiscuous mode
  at86rf230: add support for promiscuous mode
  mac802154: separate omit tx/rx flags
  mac802154: rx: remove unnecessary parameter
  mac802154: rx: simplify crc receive handling
  mac802154: rx: add software checksum filtering check
  mac802154: rx: remove override pkt_type set to PACKET_HOST
  mac802154: rx: use netif_receive_skb
  mac802154: rx: add rx stats incrementation
  mac802154: rx: monitor receive cleanup
  mac802154: rx: add error handling after skb_clone
  at86rf230: deliver with checksum
  mac802154: add basic support for monitor

Alfonso Acosta (4):
  Bluetooth: Refactor arguments of mgmt_device_connected
  Bluetooth: Include ADV_IND report in Device Connected event
  Bluetooth: Remove redundant check on hci_conn's device class
  Bluetooth: Defer connection-parameter removal when unpairing

Anantha Krishnan (1):
  Bluetooth: Add support for Acer [0489:e078]

Dan Carpenter (1):
  Bluetooth: 6lowpan: use after free in disconnect_devices()

Fabian Frederick (1):
  Bluetooth: fix shadow warning in hci_disconnect()

Johan Hedberg (6):
  Bluetooth: Pass only crypto context to SMP crypto functions
  Bluetooth: Add skeleton for SMP self-tests
  Bluetooth: Add self-tests for SMP crypto functions
  Bluetooth: Revert SMP self-test patches
  Bluetooth: Fix LE connection timeout deadlock
  Bluetooth: Fix check for direct advertising

Jukka Rissanen (3):
  Bluetooth: 6lowpan: Converting rwlocks to use RCU
  Bluetooth: 6lowpan: Fix lockdep splats
  Bluetooth: Wrong style spin lock used

Julien Catalano (1):
  trivial: net/mac802154: Fix Kconfig typo

Li RongQing (1):
  Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper

Loic Poulain (1):
  Bluetooth: HCI H5 peer reset detection

Marcel Holtmann (1):
  Bluetooth: Clear LE white list when resetting controller

Martin Townsend (6):
  6lowpan: Use skb_cow in IPHC decompression.
  Bluetooth: Fix missing channel unlock in l2cap_le_credits
  6lowpan: remove skb_deliver from IPHC
  6lowpan: fix process_data return values
  bluetooth:6lowpan: use consume_skb when packet processed successfully
  ieee802154: 6lowpan: rename process_data and lowpan_process_data

Simon Vincent (2):
  ieee802154: 6lowpan: Drop PACKET_OTHERHOST skbs in 6lowpan
  ieee802154: mrf24j40: Add support for MRF24J40MC

Stephen Hemminger (1):
  Bluetooth: spelling fixes

Szymon Janc (2):
  Bluetooth: Fix RFCOMM NSC response
  Bluetooth: Improve RFCOMM __test_pf macro robustness

Varka Bhadram (1):
  MAINTAINERS: add cc2520 driver maintainer

 MAINTAINERS   |  15 +
 drivers/bluetooth/ath3k.c |   2 +
 drivers/bluetooth/btusb.c |   1 +
 drivers/bluetooth/hci_h5.c|  34 ++
 drivers/net/ieee802154/Kconfig|  10 -
 drivers/net/ieee802154/Makefile   |   1 -
 drivers/net/ieee802154/at86rf230.c| 392 
 drivers/net/ieee802154/cc2520.c   |  70 +--
 drivers/net/ieee802154/fakehard.c | 427 --
 drivers/net/ieee802154/fakelb.c   |  92 ++--
 drivers/net/ieee802154/mrf24j40.c | 104 +++--
 include/{net = linux}/ieee802154.h   |  23 +-
 include/linux/nl802154.h  |   4 -
 include/net/6lowpan.h |  12 +-
 include/net/af_ieee802154.h   |   4 -
 include/net/bluetooth/hci_core.h  |   8 +-
 include/net/{wpan-phy.h = cfg802154.h}   |  22 +-
 include/net/ieee802154_netdev.h   |   6 +-
 include/net/mac802154.h   | 124 +++--
 include/net/nl802154.h|   4 -
 net/6lowpan/iphc.c|  71 +--
 net/bluetooth/6lowpan.c   | 284 +++-
 net/bluetooth/hci_conn.c  |  14 +-
 net/bluetooth/hci_core.c  |  16 +-
 net/bluetooth/hci_event.c |  50 ++-
 net/bluetooth/hci_sock.c  |   2 +-
 net/bluetooth/l2cap_core.c|   7 +-
 net/bluetooth/mgmt.c  |  83 +++-
 net/bluetooth/rfcomm/core.c

Re: linux-next: build failure after merge of the bluetooth tree

2014-10-28 Thread Johan Hedberg
Hi Stephen,

On Mon, Oct 27, 2014, Stephen Rothwell wrote:
> After merging the bluetooth tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> net/bluetooth/smp.o: In function `test_smp':
> smp.c:(.init.text+0x0): multiple definition of `init_module'
> net/bluetooth/af_bluetooth.o:af_bluetooth.c:(.init.text+0x0): first defined 
> here
> 
> Probably caused by commit 4cd3362da899 ("Bluetooth: Add skeleton for
> SMP self-tests").
> 
> I have used the bluetooth tree from next-20141023 for today.

We've applied a revert patch for the SMP self-tests to the
bluetooth-next tree until we figure out how to fix this properly.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: build failure after merge of the bluetooth tree

2014-10-28 Thread Johan Hedberg
Hi Stephen,

On Mon, Oct 27, 2014, Stephen Rothwell wrote:
 After merging the bluetooth tree, today's linux-next build (x86_64
 allmodconfig) failed like this:
 
 net/bluetooth/smp.o: In function `test_smp':
 smp.c:(.init.text+0x0): multiple definition of `init_module'
 net/bluetooth/af_bluetooth.o:af_bluetooth.c:(.init.text+0x0): first defined 
 here
 
 Probably caused by commit 4cd3362da899 (Bluetooth: Add skeleton for
 SMP self-tests).
 
 I have used the bluetooth tree from next-20141023 for today.

We've applied a revert patch for the SMP self-tests to the
bluetooth-next tree until we figure out how to fix this properly.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


pull request: bluetooth-next 2014-10-02

2014-10-02 Thread Johan Hedberg
Hi John,

Unless 3.17 gets delayed this will probably be our last -next pull request for
3.18. We've got:

  - New Marvell hardware supportr
  - Multicast support for 6lowpan
  - Several of 6lowpan fixes & cleanups
  - Fix for a (false-positive) lockdep warning in L2CAP
  - Minor btusb cleanup

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 565766b087a6d6ff257f5b79c8ceda0188c9169f:

  Bluetooth: Rename sco_param_wideband table to esco_param_msbc (2014-09-25 
10:35:08 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 9c238ca8ec79c38ab22762b44aeaf7a42fc97b18:

  Bluetooth: 6lowpan: Check transmit errors for multicast packets (2014-10-02 
13:41:57 +0300)


Amitkumar Karwar (2):
  Bluetooth: btmrvl: rename definitions from 88xx to 8897
  Bluetooth: btusb: remove redundant lock variable

Johan Hedberg (1):
  Bluetooth: Fix lockdep warning with l2cap_chan_connect

Jukka Rissanen (7):
  Bluetooth: 6lowpan: Make sure skb exists before accessing it
  Bluetooth: 6lowpan: Ensure header compression does not corrupt IPv6 header
  Bluetooth: 6lowpan: Enable multicast support
  Bluetooth: 6lowpan: Memory leak as the skb is not freed
  Bluetooth: 6lowpan: Avoid memory leak if memory allocation fails
  Bluetooth: 6lowpan: Return EAGAIN error also for multicast packets
  Bluetooth: 6lowpan: Check transmit errors for multicast packets

Xinming Hu (1):
  Bluetooth: btmrvl: support Marvell Bluetooth device SD8887

 drivers/bluetooth/Kconfig   |   4 +-
 drivers/bluetooth/btmrvl_sdio.c |  36 +-
 drivers/bluetooth/btusb.c   |   4 --
 net/bluetooth/6lowpan.c | 145 +-
 net/bluetooth/l2cap_core.c  |  13 ++--
 5 files changed, 139 insertions(+), 63 deletions(-)


pgppYotpsXljB.pgp
Description: PGP signature


pull request: bluetooth-next 2014-10-02

2014-10-02 Thread Johan Hedberg
Hi John,

Unless 3.17 gets delayed this will probably be our last -next pull request for
3.18. We've got:

  - New Marvell hardware supportr
  - Multicast support for 6lowpan
  - Several of 6lowpan fixes  cleanups
  - Fix for a (false-positive) lockdep warning in L2CAP
  - Minor btusb cleanup

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 565766b087a6d6ff257f5b79c8ceda0188c9169f:

  Bluetooth: Rename sco_param_wideband table to esco_param_msbc (2014-09-25 
10:35:08 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 9c238ca8ec79c38ab22762b44aeaf7a42fc97b18:

  Bluetooth: 6lowpan: Check transmit errors for multicast packets (2014-10-02 
13:41:57 +0300)


Amitkumar Karwar (2):
  Bluetooth: btmrvl: rename definitions from 88xx to 8897
  Bluetooth: btusb: remove redundant lock variable

Johan Hedberg (1):
  Bluetooth: Fix lockdep warning with l2cap_chan_connect

Jukka Rissanen (7):
  Bluetooth: 6lowpan: Make sure skb exists before accessing it
  Bluetooth: 6lowpan: Ensure header compression does not corrupt IPv6 header
  Bluetooth: 6lowpan: Enable multicast support
  Bluetooth: 6lowpan: Memory leak as the skb is not freed
  Bluetooth: 6lowpan: Avoid memory leak if memory allocation fails
  Bluetooth: 6lowpan: Return EAGAIN error also for multicast packets
  Bluetooth: 6lowpan: Check transmit errors for multicast packets

Xinming Hu (1):
  Bluetooth: btmrvl: support Marvell Bluetooth device SD8887

 drivers/bluetooth/Kconfig   |   4 +-
 drivers/bluetooth/btmrvl_sdio.c |  36 +-
 drivers/bluetooth/btusb.c   |   4 --
 net/bluetooth/6lowpan.c | 145 +-
 net/bluetooth/l2cap_core.c  |  13 ++--
 5 files changed, 139 insertions(+), 63 deletions(-)


pgppYotpsXljB.pgp
Description: PGP signature


pull request: bluetooth-next 2014-09-25

2014-09-25 Thread Johan Hedberg
Hi John,

This 3.18 pull request replaces the one I did on Monday ("bluetooth-next
2014-09-22", which hasn't been pulled yet). The additions since the last
request are:

 - SCO connection fix for devices not supporting eSCO
 - Cleanups regarding the SCO establishment logic
 - Remove unnecessary return value from logging functions
 - Header compression fix for 6lowpan
 - Cleanups to the ieee802154/mrf24j40 driver

Here's a copy from previous request that this one replaces:

"
Here are some more patches for 3.18. They include various fixes to the
btusb HCI driver, a fix for LE SMP, as well as adding Jukka to the
MAINTAINERS file for generic 6LoWPAN (as requested by Alexander Aring).

I've held on to this pull request a bit since we were waiting for a SCO
related fix to get sorted out first. However, since the merge window is
getting closer I decided not to wait for it. If we do get the fix sorted
out there'll probably be a second small pull request later this week.
"

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 9a783a139c32a905825ee0aa9597f485ea461f76:

  Bluetooth: Fix re-setting RPA as expired when deferring update (2014-09-12 
18:34:25 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 565766b087a6d6ff257f5b79c8ceda0188c9169f:

  Bluetooth: Rename sco_param_wideband table to esco_param_msbc (2014-09-25 
10:35:08 +0200)


Bernhard Thaler (1):
  Bluetooth: Check for SCO type before setting retransmission effort

Joe Perches (1):
  Bluetooth: Convert bt_ logging functions to return void

Johan Hedberg (5):
  Bluetooth: btusb: Use GFP_KERNEL in btusb_send_frame()
  Bluetooth: Fix setting correct security level when initiating SMP
  Bluetooth: Fix reason code used for rejecting SCO connections
  Bluetooth: Add retransmission effort into SCO parameter table
  Bluetooth: Rename sco_param_wideband table to esco_param_msbc

Jukka Rissanen (1):
  MAINTAINERS: add maintainer for generic 6LoWPAN

Marcel Holtmann (7):
  Bluetooth: btusb: Separate TX URB allocation and submission
  Bluetooth: Add BUILD_BUG_ON check for SKB control buffer size
  Bluetooth: Provide HCI command opcode information to driver
  Bluetooth: btusb: Fix old coding style issues
  Bluetooth: btusb: Split fragement receiption into separate functions
  Bluetooth: btusb: Implement driver internal packet reassembly
  Bluetooth: Remove exported hci_recv_fragment function

Simon Vincent (1):
  ieee802154: 6lowpan: ensure header compression does not corrupt ipv6 
header

Varka Bhadram (3):
  mrf24j40: fix Missing a blank line after declarations
  mrf24j40: remove unnecessary return statement
  mrf24j40: use pr_* / dev_* instead of printk()

 MAINTAINERS   |   1 +
 drivers/bluetooth/btusb.c | 511 ++--
 drivers/net/ieee802154/mrf24j40.c |  19 +-
 include/net/bluetooth/bluetooth.h |   5 +-
 include/net/bluetooth/hci.h   |   1 +
 include/net/bluetooth/hci_core.h  |   1 -
 net/bluetooth/af_bluetooth.c  |   3 +
 net/bluetooth/hci_conn.c  |  43 +--
 net/bluetooth/hci_core.c  |  21 +-
 net/bluetooth/lib.c   |  14 +-
 net/bluetooth/smp.c   |   5 +-
 net/ieee802154/6lowpan_rtnl.c | 125 ++---
 12 files changed, 518 insertions(+), 231 deletions(-)



pgpVWQ5lW4uvA.pgp
Description: PGP signature


pull request: bluetooth-next 2014-09-25

2014-09-25 Thread Johan Hedberg
Hi John,

This 3.18 pull request replaces the one I did on Monday (bluetooth-next
2014-09-22, which hasn't been pulled yet). The additions since the last
request are:

 - SCO connection fix for devices not supporting eSCO
 - Cleanups regarding the SCO establishment logic
 - Remove unnecessary return value from logging functions
 - Header compression fix for 6lowpan
 - Cleanups to the ieee802154/mrf24j40 driver

Here's a copy from previous request that this one replaces:


Here are some more patches for 3.18. They include various fixes to the
btusb HCI driver, a fix for LE SMP, as well as adding Jukka to the
MAINTAINERS file for generic 6LoWPAN (as requested by Alexander Aring).

I've held on to this pull request a bit since we were waiting for a SCO
related fix to get sorted out first. However, since the merge window is
getting closer I decided not to wait for it. If we do get the fix sorted
out there'll probably be a second small pull request later this week.


Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 9a783a139c32a905825ee0aa9597f485ea461f76:

  Bluetooth: Fix re-setting RPA as expired when deferring update (2014-09-12 
18:34:25 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 565766b087a6d6ff257f5b79c8ceda0188c9169f:

  Bluetooth: Rename sco_param_wideband table to esco_param_msbc (2014-09-25 
10:35:08 +0200)


Bernhard Thaler (1):
  Bluetooth: Check for SCO type before setting retransmission effort

Joe Perches (1):
  Bluetooth: Convert bt_level logging functions to return void

Johan Hedberg (5):
  Bluetooth: btusb: Use GFP_KERNEL in btusb_send_frame()
  Bluetooth: Fix setting correct security level when initiating SMP
  Bluetooth: Fix reason code used for rejecting SCO connections
  Bluetooth: Add retransmission effort into SCO parameter table
  Bluetooth: Rename sco_param_wideband table to esco_param_msbc

Jukka Rissanen (1):
  MAINTAINERS: add maintainer for generic 6LoWPAN

Marcel Holtmann (7):
  Bluetooth: btusb: Separate TX URB allocation and submission
  Bluetooth: Add BUILD_BUG_ON check for SKB control buffer size
  Bluetooth: Provide HCI command opcode information to driver
  Bluetooth: btusb: Fix old coding style issues
  Bluetooth: btusb: Split fragement receiption into separate functions
  Bluetooth: btusb: Implement driver internal packet reassembly
  Bluetooth: Remove exported hci_recv_fragment function

Simon Vincent (1):
  ieee802154: 6lowpan: ensure header compression does not corrupt ipv6 
header

Varka Bhadram (3):
  mrf24j40: fix Missing a blank line after declarations
  mrf24j40: remove unnecessary return statement
  mrf24j40: use pr_* / dev_* instead of printk()

 MAINTAINERS   |   1 +
 drivers/bluetooth/btusb.c | 511 ++--
 drivers/net/ieee802154/mrf24j40.c |  19 +-
 include/net/bluetooth/bluetooth.h |   5 +-
 include/net/bluetooth/hci.h   |   1 +
 include/net/bluetooth/hci_core.h  |   1 -
 net/bluetooth/af_bluetooth.c  |   3 +
 net/bluetooth/hci_conn.c  |  43 +--
 net/bluetooth/hci_core.c  |  21 +-
 net/bluetooth/lib.c   |  14 +-
 net/bluetooth/smp.c   |   5 +-
 net/ieee802154/6lowpan_rtnl.c | 125 ++---
 12 files changed, 518 insertions(+), 231 deletions(-)



pgpVWQ5lW4uvA.pgp
Description: PGP signature


pull request: bluetooth-next 2014-09-22

2014-09-21 Thread Johan Hedberg
Hi John,

Here are some more patches for 3.18. They include various fixes to the
btusb HCI driver, a fix for LE SMP, as well as adding Jukka to the
MAINTAINERS file for generic 6LoWPAN (as requested by Alexander Aring).

I've held on to this pull request a bit since we were waiting for a SCO
related fix to get sorted out first. However, since the merge window is
getting closer I decided not to wait for it. If we do get the fix sorted
out there'll probably be a second small pull request later this week.

Let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 9a783a139c32a905825ee0aa9597f485ea461f76:

  Bluetooth: Fix re-setting RPA as expired when deferring update (2014-09-12 
18:34:25 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 5eb596f55cacc2389554a8d7572d90d5e9d4269d:

  Bluetooth: Fix setting correct security level when initiating SMP (2014-09-18 
17:39:37 +0200)


Johan Hedberg (2):
  Bluetooth: btusb: Use GFP_KERNEL in btusb_send_frame()
  Bluetooth: Fix setting correct security level when initiating SMP

Jukka Rissanen (1):
  MAINTAINERS: add maintainer for generic 6LoWPAN

Marcel Holtmann (7):
  Bluetooth: btusb: Separate TX URB allocation and submission
  Bluetooth: Add BUILD_BUG_ON check for SKB control buffer size
  Bluetooth: Provide HCI command opcode information to driver
  Bluetooth: btusb: Fix old coding style issues
  Bluetooth: btusb: Split fragement receiption into separate functions
  Bluetooth: btusb: Implement driver internal packet reassembly
  Bluetooth: Remove exported hci_recv_fragment function

 MAINTAINERS   |   1 +
 drivers/bluetooth/btusb.c | 511 +-
 include/net/bluetooth/bluetooth.h |   1 +
 include/net/bluetooth/hci_core.h  |   1 -
 net/bluetooth/af_bluetooth.c  |   3 +
 net/bluetooth/hci_core.c  |  21 +-
 net/bluetooth/smp.c   |   5 +-
 7 files changed, 385 insertions(+), 158 deletions(-)



pgpFV70uOsJ0a.pgp
Description: PGP signature


pull request: bluetooth-next 2014-09-22

2014-09-21 Thread Johan Hedberg
Hi John,

Here are some more patches for 3.18. They include various fixes to the
btusb HCI driver, a fix for LE SMP, as well as adding Jukka to the
MAINTAINERS file for generic 6LoWPAN (as requested by Alexander Aring).

I've held on to this pull request a bit since we were waiting for a SCO
related fix to get sorted out first. However, since the merge window is
getting closer I decided not to wait for it. If we do get the fix sorted
out there'll probably be a second small pull request later this week.

Let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 9a783a139c32a905825ee0aa9597f485ea461f76:

  Bluetooth: Fix re-setting RPA as expired when deferring update (2014-09-12 
18:34:25 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 5eb596f55cacc2389554a8d7572d90d5e9d4269d:

  Bluetooth: Fix setting correct security level when initiating SMP (2014-09-18 
17:39:37 +0200)


Johan Hedberg (2):
  Bluetooth: btusb: Use GFP_KERNEL in btusb_send_frame()
  Bluetooth: Fix setting correct security level when initiating SMP

Jukka Rissanen (1):
  MAINTAINERS: add maintainer for generic 6LoWPAN

Marcel Holtmann (7):
  Bluetooth: btusb: Separate TX URB allocation and submission
  Bluetooth: Add BUILD_BUG_ON check for SKB control buffer size
  Bluetooth: Provide HCI command opcode information to driver
  Bluetooth: btusb: Fix old coding style issues
  Bluetooth: btusb: Split fragement receiption into separate functions
  Bluetooth: btusb: Implement driver internal packet reassembly
  Bluetooth: Remove exported hci_recv_fragment function

 MAINTAINERS   |   1 +
 drivers/bluetooth/btusb.c | 511 +-
 include/net/bluetooth/bluetooth.h |   1 +
 include/net/bluetooth/hci_core.h  |   1 -
 net/bluetooth/af_bluetooth.c  |   3 +
 net/bluetooth/hci_core.c  |  21 +-
 net/bluetooth/smp.c   |   5 +-
 7 files changed, 385 insertions(+), 158 deletions(-)



pgpFV70uOsJ0a.pgp
Description: PGP signature


Re: pull request: bluetooth-next 2014-09-14

2014-09-13 Thread Johan Hedberg
Hi John,

On Sun, Sep 14, 2014, Johan Hedberg wrote:
> Here are some more patches intended for 3.18. Most of them are cleanups
> or fixes for SMP. The only exception is a fix for BR/EDR L2CAP fixed
> channels which should now work better together with the L2CAP
> information request procedure.
> 
> Let me know if there are any issues pulling. Thanks.
> 
> Johan
> 
> ---
> The following changes since commit 39e90c77637b3892a39f2908aea57539e961c50e:
> 
>   Bluetooth: 6lowpan: Route packets that are not meant to peer via correct 
> device (2014-09-09 15:51:47 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
> master

This was supposed to be a reference to the for-upstream branch instead
of master. Both point to the same commit at this moment but it'd be more
convenient if you pull from for-upstream so that the master branch can
continue living on without waiting for the pull to happen. Sorry for the
extra hassle.

Johan


pgpqbefFxCb0h.pgp
Description: PGP signature


pull request: bluetooth-next 2014-09-14

2014-09-13 Thread Johan Hedberg
Hi John,

Here are some more patches intended for 3.18. Most of them are cleanups
or fixes for SMP. The only exception is a fix for BR/EDR L2CAP fixed
channels which should now work better together with the L2CAP
information request procedure.

Let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 39e90c77637b3892a39f2908aea57539e961c50e:

  Bluetooth: 6lowpan: Route packets that are not meant to peer via correct 
device (2014-09-09 15:51:47 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
master

for you to fetch changes up to 9a783a139c32a905825ee0aa9597f485ea461f76:

  Bluetooth: Fix re-setting RPA as expired when deferring update (2014-09-12 
18:34:25 +0200)


Johan Hedberg (10):
  Bluetooth: Fix allowing SMP Signing info PDU
  Bluetooth: Remove unnecessary early initialization of variable
  Bluetooth: Fix ignoring unknown SMP authentication requirement bits
  Bluetooth: Centralize disallowing SMP commands to a single place
  Bluetooth: Fix SMP security level when we have no IO capabilities
  Bluetooth: Add smp_ltk_sec_level() helper function
  Bluetooth: Fix L2CAP information request handling for fixed channels
  Bluetooth: Avoid hard-coded IO capability values in SMP
  Bluetooth: Expire RPA if encryption fails
  Bluetooth: Fix re-setting RPA as expired when deferring update

 net/bluetooth/hci_core.c   |  1 +
 net/bluetooth/hci_event.c  | 11 +---
 net/bluetooth/l2cap_core.c | 53 ---
 net/bluetooth/smp.c| 57 +++---
 net/bluetooth/smp.h|  8 ++
 5 files changed, 75 insertions(+), 55 deletions(-)



pgp9nhtjDHpk9.pgp
Description: PGP signature


pull request: bluetooth-next 2014-09-14

2014-09-13 Thread Johan Hedberg
Hi John,

Here are some more patches intended for 3.18. Most of them are cleanups
or fixes for SMP. The only exception is a fix for BR/EDR L2CAP fixed
channels which should now work better together with the L2CAP
information request procedure.

Let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 39e90c77637b3892a39f2908aea57539e961c50e:

  Bluetooth: 6lowpan: Route packets that are not meant to peer via correct 
device (2014-09-09 15:51:47 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
master

for you to fetch changes up to 9a783a139c32a905825ee0aa9597f485ea461f76:

  Bluetooth: Fix re-setting RPA as expired when deferring update (2014-09-12 
18:34:25 +0200)


Johan Hedberg (10):
  Bluetooth: Fix allowing SMP Signing info PDU
  Bluetooth: Remove unnecessary early initialization of variable
  Bluetooth: Fix ignoring unknown SMP authentication requirement bits
  Bluetooth: Centralize disallowing SMP commands to a single place
  Bluetooth: Fix SMP security level when we have no IO capabilities
  Bluetooth: Add smp_ltk_sec_level() helper function
  Bluetooth: Fix L2CAP information request handling for fixed channels
  Bluetooth: Avoid hard-coded IO capability values in SMP
  Bluetooth: Expire RPA if encryption fails
  Bluetooth: Fix re-setting RPA as expired when deferring update

 net/bluetooth/hci_core.c   |  1 +
 net/bluetooth/hci_event.c  | 11 +---
 net/bluetooth/l2cap_core.c | 53 ---
 net/bluetooth/smp.c| 57 +++---
 net/bluetooth/smp.h|  8 ++
 5 files changed, 75 insertions(+), 55 deletions(-)



pgp9nhtjDHpk9.pgp
Description: PGP signature


Re: pull request: bluetooth-next 2014-09-14

2014-09-13 Thread Johan Hedberg
Hi John,

On Sun, Sep 14, 2014, Johan Hedberg wrote:
 Here are some more patches intended for 3.18. Most of them are cleanups
 or fixes for SMP. The only exception is a fix for BR/EDR L2CAP fixed
 channels which should now work better together with the L2CAP
 information request procedure.
 
 Let me know if there are any issues pulling. Thanks.
 
 Johan
 
 ---
 The following changes since commit 39e90c77637b3892a39f2908aea57539e961c50e:
 
   Bluetooth: 6lowpan: Route packets that are not meant to peer via correct 
 device (2014-09-09 15:51:47 +0200)
 
 are available in the git repository at:
 
   git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
 master

This was supposed to be a reference to the for-upstream branch instead
of master. Both point to the same commit at this moment but it'd be more
convenient if you pull from for-upstream so that the master branch can
continue living on without waiting for the pull to happen. Sorry for the
extra hassle.

Johan


pgpqbefFxCb0h.pgp
Description: PGP signature


pull request: bluetooth-next 2014-09-09

2014-09-09 Thread Johan Hedberg
Hi John,

This set of patches is intended for 3.18. Most of the patches are LE SMP
(Security Manager Protocol) fixes/improvements, but there are also some
6lowpan fixes as well as a fix for the btusb HCI driver.

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 61a3d4f9d52c00b2016bc27fc66b10a194043f76:

  Merge branch 'master' of 
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2014-09-08 
11:14:56 -0400)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 39e90c77637b3892a39f2908aea57539e961c50e:

  Bluetooth: 6lowpan: Route packets that are not meant to peer via correct 
device (2014-09-09 15:51:47 +0200)


Behan Webster (1):
  Bluetooth: LLVMLinux: Remove VLAIS from bluetooth/amp.c

Champion Chen (1):
  Bluetooth: Fix issue with USB suspend in btusb driver

Johan Hedberg (31):
  Bluetooth: Fix incorrect LE CoC PDU length restriction based on HCI MTU
  Bluetooth: Remove unnecessary l2cap_chan_unlock before l2cap_chan_add
  Bluetooth: Fix hci_conn reference counting for fixed channels
  Bluetooth: Set addr_type only when it's needed
  Bluetooth: Optimize connection parameter lookup for LE connections
  Bluetooth: Improve *_get() functions to return the object type
  Bluetooth: Fix using hci_conn_get() for hci_conn pointers
  Bluetooth: Refactor connection parameter freeing into its own function
  Bluetooth: Use zero timeout for immediate scheduling
  Bluetooth: Fix hci_conn reference counting with hci_chan
  Bluetooth: Set disc_timeout to 0 when calling hci_chan_del
  Bluetooth: Ignore incoming data after initiating disconnection
  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()
  Bluetooth: Add clarifying comment for LE CoC result value
  Bluetooth: Remove unnecessary checks after canceling SMP security timer
  Bluetooth: Don't take any action in smp_resume_cb if not encrypted
  Bluetooth: Move identity address update behind a workqueue
  Bluetooth: Remove unnecessary deferred work for SMP key distribution
  Bluetooth: Fix locking of the SMP context
  Bluetooth: Add define for key distribution mask
  Bluetooth: Fix calling smp_distribute_keys() when still waiting for keys
  Bluetooth: Add strict checks for allowed SMP PDUs
  Bluetooth: Fix dereferencing conn variable before NULL check
  Bluetooth: Fix mgmt pairing failure when authentication fails

Jukka Rissanen (3):
  Bluetooth: 6lowpan: Increase the connection timeout value
  Bluetooth: 6lowpan: Set the peer IPv6 address correctly
  Bluetooth: 6lowpan: Route packets that are not meant to peer via correct 
device

 drivers/bluetooth/btusb.c|   9 ++
 include/net/bluetooth/hci_core.h |  14 +--
 include/net/bluetooth/l2cap.h|  10 +-
 net/bluetooth/6lowpan.c  |  80 +++-
 net/bluetooth/amp.c  |  13 +-
 net/bluetooth/hci_conn.c |  49 
 net/bluetooth/hci_core.c |  29 +++--
 net/bluetooth/hci_event.c|  22 ++--
 net/bluetooth/hidp/core.c|  10 +-
 net/bluetooth/l2cap_core.c   |  67 +-
 net/bluetooth/l2cap_sock.c   |   8 ++
 net/bluetooth/mgmt.c |  37 +++---
 net/bluetooth/smp.c  | 247 ++---
 net/bluetooth/smp.h  |   2 +
 14 files changed, 366 insertions(+), 231 deletions(-)



pgphdcbSWYmov.pgp
Description: PGP signature


pull request: bluetooth-next 2014-09-09

2014-09-09 Thread Johan Hedberg
Hi John,

This set of patches is intended for 3.18. Most of the patches are LE SMP
(Security Manager Protocol) fixes/improvements, but there are also some
6lowpan fixes as well as a fix for the btusb HCI driver.

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 61a3d4f9d52c00b2016bc27fc66b10a194043f76:

  Merge branch 'master' of 
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2014-09-08 
11:14:56 -0400)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 39e90c77637b3892a39f2908aea57539e961c50e:

  Bluetooth: 6lowpan: Route packets that are not meant to peer via correct 
device (2014-09-09 15:51:47 +0200)


Behan Webster (1):
  Bluetooth: LLVMLinux: Remove VLAIS from bluetooth/amp.c

Champion Chen (1):
  Bluetooth: Fix issue with USB suspend in btusb driver

Johan Hedberg (31):
  Bluetooth: Fix incorrect LE CoC PDU length restriction based on HCI MTU
  Bluetooth: Remove unnecessary l2cap_chan_unlock before l2cap_chan_add
  Bluetooth: Fix hci_conn reference counting for fixed channels
  Bluetooth: Set addr_type only when it's needed
  Bluetooth: Optimize connection parameter lookup for LE connections
  Bluetooth: Improve *_get() functions to return the object type
  Bluetooth: Fix using hci_conn_get() for hci_conn pointers
  Bluetooth: Refactor connection parameter freeing into its own function
  Bluetooth: Use zero timeout for immediate scheduling
  Bluetooth: Fix hci_conn reference counting with hci_chan
  Bluetooth: Set disc_timeout to 0 when calling hci_chan_del
  Bluetooth: Ignore incoming data after initiating disconnection
  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()
  Bluetooth: Add clarifying comment for LE CoC result value
  Bluetooth: Remove unnecessary checks after canceling SMP security timer
  Bluetooth: Don't take any action in smp_resume_cb if not encrypted
  Bluetooth: Move identity address update behind a workqueue
  Bluetooth: Remove unnecessary deferred work for SMP key distribution
  Bluetooth: Fix locking of the SMP context
  Bluetooth: Add define for key distribution mask
  Bluetooth: Fix calling smp_distribute_keys() when still waiting for keys
  Bluetooth: Add strict checks for allowed SMP PDUs
  Bluetooth: Fix dereferencing conn variable before NULL check
  Bluetooth: Fix mgmt pairing failure when authentication fails

Jukka Rissanen (3):
  Bluetooth: 6lowpan: Increase the connection timeout value
  Bluetooth: 6lowpan: Set the peer IPv6 address correctly
  Bluetooth: 6lowpan: Route packets that are not meant to peer via correct 
device

 drivers/bluetooth/btusb.c|   9 ++
 include/net/bluetooth/hci_core.h |  14 +--
 include/net/bluetooth/l2cap.h|  10 +-
 net/bluetooth/6lowpan.c  |  80 +++-
 net/bluetooth/amp.c  |  13 +-
 net/bluetooth/hci_conn.c |  49 
 net/bluetooth/hci_core.c |  29 +++--
 net/bluetooth/hci_event.c|  22 ++--
 net/bluetooth/hidp/core.c|  10 +-
 net/bluetooth/l2cap_core.c   |  67 +-
 net/bluetooth/l2cap_sock.c   |   8 ++
 net/bluetooth/mgmt.c |  37 +++---
 net/bluetooth/smp.c  | 247 ++---
 net/bluetooth/smp.h  |   2 +
 14 files changed, 366 insertions(+), 231 deletions(-)



pgphdcbSWYmov.pgp
Description: PGP signature


pull request: bluetooth 2014-08-20

2014-08-20 Thread Johan Hedberg
Hi John,

Here's a set of patches for the 3.17-rc series.

It contains a connection reference counting fix for LE where a
connection might stay up even though it should get disconnected.

The other 802.15.4 6LoWPAN related patches were sent to the bluetooth
tree by Alexander Aring and described as follows by him:

"
these patches contains patches for the bluetooth branch.

This series includes memory leak fixes and an errno value fix.
Also there are two patches for sending and receiving 1280 6LoWPAN
packets, which makes the IEEE 802.15.4 6LoWPAN stack more RFC
compliant.
"

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 77b2f2865956b7573f9b040db7a9f808b434acd1:

  iwlwifi: mvm: disable scheduled scan to prevent firmware crash (2014-08-14 
19:47:41 +0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git 
for-upstream

for you to fetch changes up to f161dd4122ffa73e4e12000309dca65bec80d416:

  Bluetooth: Fix hci_conn reference counting for auto-connections (2014-08-20 
21:57:39 +0300)


Alexander Aring (2):
  ieee802154: 6lowpan_rtnl: fix correct errno value
  ieee802154: 6lowpan: ensure of sending 1280 packets

Johan Hedberg (1):
  Bluetooth: Fix hci_conn reference counting for auto-connections

Martin Townsend (3):
  mac802154: fixed potential skb leak with mac802154_parse_frame_start
  ieee802154: mac802154: handle the reserved dest mode by dropping the 
packet
  ieee802154: 6lowpan: ensure MTU of 1280 for 6lowpan

 include/net/bluetooth/hci_core.h   |  2 ++
 include/net/netns/ieee802154_6lowpan.h |  1 -
 net/bluetooth/hci_conn.c   |  8 
 net/bluetooth/hci_core.c   | 14 --
 net/bluetooth/hci_event.c  | 17 +++--
 net/ieee802154/6lowpan_rtnl.c  |  4 ++--
 net/ieee802154/reassembly.c| 15 +++
 net/mac802154/wpan.c   |  6 +-
 8 files changed, 47 insertions(+), 20 deletions(-)



pgpowfTjtCGBh.pgp
Description: PGP signature


pull request: bluetooth 2014-08-20

2014-08-20 Thread Johan Hedberg
Hi John,

Here's a set of patches for the 3.17-rc series.

It contains a connection reference counting fix for LE where a
connection might stay up even though it should get disconnected.

The other 802.15.4 6LoWPAN related patches were sent to the bluetooth
tree by Alexander Aring and described as follows by him:


these patches contains patches for the bluetooth branch.

This series includes memory leak fixes and an errno value fix.
Also there are two patches for sending and receiving 1280 6LoWPAN
packets, which makes the IEEE 802.15.4 6LoWPAN stack more RFC
compliant.


Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit 77b2f2865956b7573f9b040db7a9f808b434acd1:

  iwlwifi: mvm: disable scheduled scan to prevent firmware crash (2014-08-14 
19:47:41 +0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git 
for-upstream

for you to fetch changes up to f161dd4122ffa73e4e12000309dca65bec80d416:

  Bluetooth: Fix hci_conn reference counting for auto-connections (2014-08-20 
21:57:39 +0300)


Alexander Aring (2):
  ieee802154: 6lowpan_rtnl: fix correct errno value
  ieee802154: 6lowpan: ensure of sending 1280 packets

Johan Hedberg (1):
  Bluetooth: Fix hci_conn reference counting for auto-connections

Martin Townsend (3):
  mac802154: fixed potential skb leak with mac802154_parse_frame_start
  ieee802154: mac802154: handle the reserved dest mode by dropping the 
packet
  ieee802154: 6lowpan: ensure MTU of 1280 for 6lowpan

 include/net/bluetooth/hci_core.h   |  2 ++
 include/net/netns/ieee802154_6lowpan.h |  1 -
 net/bluetooth/hci_conn.c   |  8 
 net/bluetooth/hci_core.c   | 14 --
 net/bluetooth/hci_event.c  | 17 +++--
 net/ieee802154/6lowpan_rtnl.c  |  4 ++--
 net/ieee802154/reassembly.c| 15 +++
 net/mac802154/wpan.c   |  6 +-
 8 files changed, 47 insertions(+), 20 deletions(-)



pgpowfTjtCGBh.pgp
Description: PGP signature


pull request: bluetooth-next 2014-08-14

2014-08-14 Thread Johan Hedberg
Hi John,

Here's our first bluetooth-next pull request for the 3.18 kernel. Our
tree is based on net-next so you'd need to pull from there first before
pulling from our tree.

The changes consists of:

- Coding style fixes to HCI drivers
- Corrupted ack value fix for the H5 HCI driver
- A couple of Enhanced L2CAP fixes
- Conversion of SMP code to use common L2CAP channel API
- Page scan optimizations when using the kernel-side whitelist
- Various mac802154 and and ieee802154 6lowpan cleanups
- One new Atheros USB ID

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit f0094b28f3038936c1985be64dbe83f0e950b671:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2014-08-13 
18:27:40 -0600)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 13cac15296afe7e42088ecfcd0f1d4b658248c46:

  Bluetooth: Fix ERTM L2CAP resend packet (2014-08-14 09:47:02 +0200)


Alexander Aring (1):
  ieee802154: 6lowpan: remove unused function

Himangi Saraogi (4):
  Bluetooth: Remove typedef bluecard_info_t
  Bluetooth: Remove typedef btuart_info_t
  Bluetooth: Remove typedefs nsh_t and dtl1_info_t
  Bluetooth: Remove typedef bt3c_info_t

Johan Hedberg (35):
  Bluetooth: Add convenience function to check for pending power off
  Bluetooth: Create unified helper function for updating page scan
  Bluetooth: Disable page scan if all whitelisted devices are connected
  Bluetooth: Remove redundant check for remote_key_dist
  Bluetooth: Fix confusion between parent and child channel for 6lowpan
  Bluetooth: Fix reference counting of global L2CAP channels
  Bluetooth: Fix __l2cap_no_conn_pending() usage with all channels
  Bluetooth: Resume BT_CONNECTED state after LE security elevation
  Bluetooth: Remove special handling of ATT in l2cap_security_cfm()
  Bluetooth: Refactor l2cap_connect_cfm
  Bluetooth: Move L2CAP fixed channel creation into l2cap_conn_cfm
  Bluetooth: Improve fixed channel lookup based on link type
  Bluetooth: Remove special ATT data channel handling
  Bluetooth: Move parts of fixed channel initialization to l2cap_add_scid
  Bluetooth: Call L2CAP teardown callback before clearing chan->conn
  Bluetooth: Call l2cap_le_conn_ready after notifying channels
  Bluetooth: Fix using HCI_CONN_LE_SMP_PEND to check for SMP context
  Bluetooth: Fix hci_update_random_address() error return for no crypto
  Bluetooth: Fix IRK lookup when tfm_aes is not available
  Bluetooth: Refactor SMP (de)initialization into separate functions
  Bluetooth: Move SMP initialization after HCI init
  Bluetooth: Move SMP (de)initialization to smp.c
  Bluetooth: Add more L2CAP convenience callbacks
  Bluetooth: Add SMP L2CAP channel skeleton
  Bluetooth: Make AES crypto context private to SMP
  Bluetooth: Convert SMP to use l2cap_chan infrastructure
  Bluetooth: Use L2CAP resume callback to call smp_distribute_keys
  Bluetooth: Add public l2cap_conn_shutdown() API to request disconnection
  Bluetooth: Call l2cap_conn_shutdown() when SMP recv callback fails
  Bluetooth: Fix double free of SMP data skb
  Bluetooth: Add SMP-internal timeout callback
  Bluetooth: Remove unused l2cap_conn->security_timer
  Bluetooth: Move canceling security_timer into smp_chan_destroy()
  Bluetooth: Always call smp_distribute_keys() from a workqueue
  Bluetooth: Make smp_chan_destroy() private to smp.c

Loic Poulain (1):
  Bluetooth: Fix HCI H5 corrupted ack value

Lukasz Rymanowski (2):
  Bluetooth: Improve data packing in SAR mode
  Bluetooth: Fix ERTM L2CAP resend packet

Varka Bhadram (4):
  MAINTAINERS: update maintainers info
  mac802154: cleanup in rx path
  mac802154: common error path
  mac802154: common tx error path

Vincent Zwanenburg (1):
  Add a new PID/VID 0227/0930 for AR3012.

 MAINTAINERS  |   9 +-
 drivers/bluetooth/ath3k.c|   2 +
 drivers/bluetooth/bluecard_cs.c  |  35 +-
 drivers/bluetooth/bt3c_cs.c  |  27 +-
 drivers/bluetooth/btuart_cs.c|  27 +-
 drivers/bluetooth/btusb.c|   1 +
 drivers/bluetooth/dtl1_cs.c  |  36 +-
 drivers/bluetooth/hci_h5.c   |   2 +-
 include/net/bluetooth/hci_core.h |   8 +-
 include/net/bluetooth/l2cap.h|  33 +-
 net/bluetooth/6lowpan.c  |  10 +-
 net/bluetooth/hci_core.c |  71 +++-
 net/bluetooth/hci_event.c|  11 +-
 net/bluetooth/l2cap_core.c   | 309 +++
 net/bluetooth/l2cap_sock.c   |  15 +-
 net/bluetooth/mgmt.c | 124 ++
 net/bluetooth/smp.c  | 726 +++
 net/bluetooth

pull request: bluetooth-next 2014-08-14

2014-08-14 Thread Johan Hedberg
Hi John,

Here's our first bluetooth-next pull request for the 3.18 kernel. Our
tree is based on net-next so you'd need to pull from there first before
pulling from our tree.

The changes consists of:

- Coding style fixes to HCI drivers
- Corrupted ack value fix for the H5 HCI driver
- A couple of Enhanced L2CAP fixes
- Conversion of SMP code to use common L2CAP channel API
- Page scan optimizations when using the kernel-side whitelist
- Various mac802154 and and ieee802154 6lowpan cleanups
- One new Atheros USB ID

Please let me know if there are any issues pulling. Thanks.

Johan

---
The following changes since commit f0094b28f3038936c1985be64dbe83f0e950b671:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2014-08-13 
18:27:40 -0600)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 13cac15296afe7e42088ecfcd0f1d4b658248c46:

  Bluetooth: Fix ERTM L2CAP resend packet (2014-08-14 09:47:02 +0200)


Alexander Aring (1):
  ieee802154: 6lowpan: remove unused function

Himangi Saraogi (4):
  Bluetooth: Remove typedef bluecard_info_t
  Bluetooth: Remove typedef btuart_info_t
  Bluetooth: Remove typedefs nsh_t and dtl1_info_t
  Bluetooth: Remove typedef bt3c_info_t

Johan Hedberg (35):
  Bluetooth: Add convenience function to check for pending power off
  Bluetooth: Create unified helper function for updating page scan
  Bluetooth: Disable page scan if all whitelisted devices are connected
  Bluetooth: Remove redundant check for remote_key_dist
  Bluetooth: Fix confusion between parent and child channel for 6lowpan
  Bluetooth: Fix reference counting of global L2CAP channels
  Bluetooth: Fix __l2cap_no_conn_pending() usage with all channels
  Bluetooth: Resume BT_CONNECTED state after LE security elevation
  Bluetooth: Remove special handling of ATT in l2cap_security_cfm()
  Bluetooth: Refactor l2cap_connect_cfm
  Bluetooth: Move L2CAP fixed channel creation into l2cap_conn_cfm
  Bluetooth: Improve fixed channel lookup based on link type
  Bluetooth: Remove special ATT data channel handling
  Bluetooth: Move parts of fixed channel initialization to l2cap_add_scid
  Bluetooth: Call L2CAP teardown callback before clearing chan-conn
  Bluetooth: Call l2cap_le_conn_ready after notifying channels
  Bluetooth: Fix using HCI_CONN_LE_SMP_PEND to check for SMP context
  Bluetooth: Fix hci_update_random_address() error return for no crypto
  Bluetooth: Fix IRK lookup when tfm_aes is not available
  Bluetooth: Refactor SMP (de)initialization into separate functions
  Bluetooth: Move SMP initialization after HCI init
  Bluetooth: Move SMP (de)initialization to smp.c
  Bluetooth: Add more L2CAP convenience callbacks
  Bluetooth: Add SMP L2CAP channel skeleton
  Bluetooth: Make AES crypto context private to SMP
  Bluetooth: Convert SMP to use l2cap_chan infrastructure
  Bluetooth: Use L2CAP resume callback to call smp_distribute_keys
  Bluetooth: Add public l2cap_conn_shutdown() API to request disconnection
  Bluetooth: Call l2cap_conn_shutdown() when SMP recv callback fails
  Bluetooth: Fix double free of SMP data skb
  Bluetooth: Add SMP-internal timeout callback
  Bluetooth: Remove unused l2cap_conn-security_timer
  Bluetooth: Move canceling security_timer into smp_chan_destroy()
  Bluetooth: Always call smp_distribute_keys() from a workqueue
  Bluetooth: Make smp_chan_destroy() private to smp.c

Loic Poulain (1):
  Bluetooth: Fix HCI H5 corrupted ack value

Lukasz Rymanowski (2):
  Bluetooth: Improve data packing in SAR mode
  Bluetooth: Fix ERTM L2CAP resend packet

Varka Bhadram (4):
  MAINTAINERS: update maintainers info
  mac802154: cleanup in rx path
  mac802154: common error path
  mac802154: common tx error path

Vincent Zwanenburg (1):
  Add a new PID/VID 0227/0930 for AR3012.

 MAINTAINERS  |   9 +-
 drivers/bluetooth/ath3k.c|   2 +
 drivers/bluetooth/bluecard_cs.c  |  35 +-
 drivers/bluetooth/bt3c_cs.c  |  27 +-
 drivers/bluetooth/btuart_cs.c|  27 +-
 drivers/bluetooth/btusb.c|   1 +
 drivers/bluetooth/dtl1_cs.c  |  36 +-
 drivers/bluetooth/hci_h5.c   |   2 +-
 include/net/bluetooth/hci_core.h |   8 +-
 include/net/bluetooth/l2cap.h|  33 +-
 net/bluetooth/6lowpan.c  |  10 +-
 net/bluetooth/hci_core.c |  71 +++-
 net/bluetooth/hci_event.c|  11 +-
 net/bluetooth/l2cap_core.c   | 309 +++
 net/bluetooth/l2cap_sock.c   |  15 +-
 net/bluetooth/mgmt.c | 124 ++
 net/bluetooth/smp.c  | 726 +++
 net/bluetooth/smp.h

pull request: bluetooth-next 2014-07-31

2014-07-31 Thread Johan Hedberg
Hi John,

Here's one more (hopefully last) pull request for 3.17.

We've got:

- 6lowpan fixes/cleanups
- A couple crash fixes, one for the Marvell HCI driver and another in LE SMP.
- Fix for an incorrect connected state check
- Fix for the bondable requirement during pairing (an issue which had
  crept in because of using "pairable" when in fact the actual meaning
  was "bondable" (these have different meanings in Bluetooth)

Let me know if there are any issues. Thanks.

Johan

---
The following changes since commit 568ba389be505f505b7fbeedb9ab4ece27603fc9:

  brcmfmac: Fix OOB interrupt not working for BCM43362 (2014-07-29 10:32:57 
-0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 8500d791c458ccbbb3e2d3fa9a0320ffd5729069:

  Bluetooth: Fix crash in the Marvell driver initialization codepath 
(2014-07-31 01:07:28 +0200)


Alexander Aring (7):
  6lowpan: iphc: rename hc06_ptr pointer to hc_ptr
  6lowpan: iphc: use sizeof in udp uncompression
  6lowpan: iphc: cleanup use of lowpan_fetch_skb
  6lowpan: iphc: cleanup use of lowpan_push_hc_data
  6lowpan: iphc: use ipv6 api to check address scope
  6lowpan: iphc: remove check on null
  6lowpan: remove unused LOWPAN_FRAG_SIZE define

Anatol Pomozov (1):
  Bluetooth: Fix crash in the Marvell driver initialization codepath

Johan Hedberg (5):
  Bluetooth: Fix SMP context tracking leading to a kernel crash
  Bluetooth: Fix check for connected state when pairing
  Bluetooth: Rename HCI_PAIRABLE to HCI_BONDABLE
  Bluetooth: Rename pairable mgmt setting to bondable
  Bluetooth: Always use non-bonding requirement when not bondable

Marcel Holtmann (6):
  6lowpan: iphc: Fix block comments to match networking style
  6lowpan: iphc: Fix issues with alignment matching open parenthesis
  6lowpan: iphc: Fix missing blank line after variable declarations
  6lowpan: iphc: Fix missing braces for if statement
  6lowpan: iphc: Fix parenthesis alignments which off-by-one
  Bluetooth: Fix sparse warning from HID new leds handling

Varka Bhadram (2):
  6lowpan: remove unused macros
  6lowpan: remove unused function

 drivers/bluetooth/btmrvl_main.c |   5 +
 include/net/6lowpan.h   |  50 --
 include/net/bluetooth/hci.h |   2 +-
 include/net/bluetooth/mgmt.h|   4 +-
 net/6lowpan/iphc.c  | 295 +---
 net/bluetooth/hci_core.c|   4 +-
 net/bluetooth/hci_event.c   |  15 +-
 net/bluetooth/hidp/core.c   |   2 +-
 net/bluetooth/mgmt.c|  24 +--
 net/bluetooth/smp.c |  17 ++-
 10 files changed, 185 insertions(+), 233 deletions(-)



pgp3VOmVDFVK3.pgp
Description: PGP signature


pull request: bluetooth-next 2014-07-31

2014-07-31 Thread Johan Hedberg
Hi John,

Here's one more (hopefully last) pull request for 3.17.

We've got:

- 6lowpan fixes/cleanups
- A couple crash fixes, one for the Marvell HCI driver and another in LE SMP.
- Fix for an incorrect connected state check
- Fix for the bondable requirement during pairing (an issue which had
  crept in because of using pairable when in fact the actual meaning
  was bondable (these have different meanings in Bluetooth)

Let me know if there are any issues. Thanks.

Johan

---
The following changes since commit 568ba389be505f505b7fbeedb9ab4ece27603fc9:

  brcmfmac: Fix OOB interrupt not working for BCM43362 (2014-07-29 10:32:57 
-0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 8500d791c458ccbbb3e2d3fa9a0320ffd5729069:

  Bluetooth: Fix crash in the Marvell driver initialization codepath 
(2014-07-31 01:07:28 +0200)


Alexander Aring (7):
  6lowpan: iphc: rename hc06_ptr pointer to hc_ptr
  6lowpan: iphc: use sizeof in udp uncompression
  6lowpan: iphc: cleanup use of lowpan_fetch_skb
  6lowpan: iphc: cleanup use of lowpan_push_hc_data
  6lowpan: iphc: use ipv6 api to check address scope
  6lowpan: iphc: remove check on null
  6lowpan: remove unused LOWPAN_FRAG_SIZE define

Anatol Pomozov (1):
  Bluetooth: Fix crash in the Marvell driver initialization codepath

Johan Hedberg (5):
  Bluetooth: Fix SMP context tracking leading to a kernel crash
  Bluetooth: Fix check for connected state when pairing
  Bluetooth: Rename HCI_PAIRABLE to HCI_BONDABLE
  Bluetooth: Rename pairable mgmt setting to bondable
  Bluetooth: Always use non-bonding requirement when not bondable

Marcel Holtmann (6):
  6lowpan: iphc: Fix block comments to match networking style
  6lowpan: iphc: Fix issues with alignment matching open parenthesis
  6lowpan: iphc: Fix missing blank line after variable declarations
  6lowpan: iphc: Fix missing braces for if statement
  6lowpan: iphc: Fix parenthesis alignments which off-by-one
  Bluetooth: Fix sparse warning from HID new leds handling

Varka Bhadram (2):
  6lowpan: remove unused macros
  6lowpan: remove unused function

 drivers/bluetooth/btmrvl_main.c |   5 +
 include/net/6lowpan.h   |  50 --
 include/net/bluetooth/hci.h |   2 +-
 include/net/bluetooth/mgmt.h|   4 +-
 net/6lowpan/iphc.c  | 295 +---
 net/bluetooth/hci_core.c|   4 +-
 net/bluetooth/hci_event.c   |  15 +-
 net/bluetooth/hidp/core.c   |   2 +-
 net/bluetooth/mgmt.c|  24 +--
 net/bluetooth/smp.c |  17 ++-
 10 files changed, 185 insertions(+), 233 deletions(-)



pgp3VOmVDFVK3.pgp
Description: PGP signature


pull request: bluetooth-next 2014-07-28

2014-07-28 Thread Johan Hedberg
Hi John,

This pull request should replace the previous one that Gustavo made
(bluetooth-next 2014-07-23).

To quote Gustavo from his previous request:

"Some last minute fixes for -next. We have a fix for a use after free in
RFCOMM, another fix to an issue with ADV_DIRECT_IND and one for ADV_IND with
auto-connection handling.  Last, we added support for reading the codec and
MWS setting for controllers that support these features."

Additionally there are fixes to LE scanning, an update to conform to the 4.1
core specification as well as fixes for tracking the page scan state. All
of these fixes are important for 3.17.

Let me know if there are any issues. Thanks.

Johan

---
The following changes since commit c2aef6e8cbebd60f79555baeb9266e220f135a44:

  Bluetooth: Add support for Broadcom device of Asus Z97-DELUXE motherboard 
(2014-07-21 15:07:08 +0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 3bd2724010a51d5d15afa8065ac3c5fab3725499:

  Bluetooth: Fix incorrectly disabling page scan when toggling connectable 
(2014-07-28 20:13:32 +0200)


Alexander Aring (1):
  MAINTAINERS: add 6lowpan header file

Georg Lukas (2):
  Bluetooth: Provide defaults for LE advertising interval
  Bluetooth: Expose default LE advertising interval via debugfs

Johan Hedberg (2):
  Bluetooth: Fix clearing HCI_PSCAN flag
  Bluetooth: Fix incorrectly disabling page scan when toggling connectable

Marcel Holtmann (7):
  Bluetooth: Read list of local codecs supported by the controller
  Bluetooth: Get MWS transport configuration of the controller
  Bluetooth: Ignore ADV_DIRECT_IND attempts from unknown devices
  Bluetooth: Fix issue with ADV_IND reports and auto-connection handling
  Bluetooth: Add support for using controller white list filtering
  Bluetooth: Fix white list handling with resolvable private addresses
  Bluetooth: Set Simultaneous LE and BR/EDR controller option to zero

Vignesh Raman (1):
  Bluetooth: Avoid use of session socket after the session gets freed

 MAINTAINERS  |   1 +
 include/net/bluetooth/hci.h  |   4 +
 include/net/bluetooth/hci_core.h |   3 +
 net/bluetooth/hci_core.c | 181 ++-
 net/bluetooth/hci_event.c|  35 +--
 net/bluetooth/mgmt.c |  33 +--
 net/bluetooth/rfcomm/core.c  |   7 +-
 net/bluetooth/smp.c  |  16 
 8 files changed, 260 insertions(+), 20 deletions(-)



pgp_sIkEFOfhG.pgp
Description: PGP signature


pull request: bluetooth-next 2014-07-28

2014-07-28 Thread Johan Hedberg
Hi John,

This pull request should replace the previous one that Gustavo made
(bluetooth-next 2014-07-23).

To quote Gustavo from his previous request:

Some last minute fixes for -next. We have a fix for a use after free in
RFCOMM, another fix to an issue with ADV_DIRECT_IND and one for ADV_IND with
auto-connection handling.  Last, we added support for reading the codec and
MWS setting for controllers that support these features.

Additionally there are fixes to LE scanning, an update to conform to the 4.1
core specification as well as fixes for tracking the page scan state. All
of these fixes are important for 3.17.

Let me know if there are any issues. Thanks.

Johan

---
The following changes since commit c2aef6e8cbebd60f79555baeb9266e220f135a44:

  Bluetooth: Add support for Broadcom device of Asus Z97-DELUXE motherboard 
(2014-07-21 15:07:08 +0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
for-upstream

for you to fetch changes up to 3bd2724010a51d5d15afa8065ac3c5fab3725499:

  Bluetooth: Fix incorrectly disabling page scan when toggling connectable 
(2014-07-28 20:13:32 +0200)


Alexander Aring (1):
  MAINTAINERS: add 6lowpan header file

Georg Lukas (2):
  Bluetooth: Provide defaults for LE advertising interval
  Bluetooth: Expose default LE advertising interval via debugfs

Johan Hedberg (2):
  Bluetooth: Fix clearing HCI_PSCAN flag
  Bluetooth: Fix incorrectly disabling page scan when toggling connectable

Marcel Holtmann (7):
  Bluetooth: Read list of local codecs supported by the controller
  Bluetooth: Get MWS transport configuration of the controller
  Bluetooth: Ignore ADV_DIRECT_IND attempts from unknown devices
  Bluetooth: Fix issue with ADV_IND reports and auto-connection handling
  Bluetooth: Add support for using controller white list filtering
  Bluetooth: Fix white list handling with resolvable private addresses
  Bluetooth: Set Simultaneous LE and BR/EDR controller option to zero

Vignesh Raman (1):
  Bluetooth: Avoid use of session socket after the session gets freed

 MAINTAINERS  |   1 +
 include/net/bluetooth/hci.h  |   4 +
 include/net/bluetooth/hci_core.h |   3 +
 net/bluetooth/hci_core.c | 181 ++-
 net/bluetooth/hci_event.c|  35 +--
 net/bluetooth/mgmt.c |  33 +--
 net/bluetooth/rfcomm/core.c  |   7 +-
 net/bluetooth/smp.c  |  16 
 8 files changed, 260 insertions(+), 20 deletions(-)



pgp_sIkEFOfhG.pgp
Description: PGP signature


Re: [PATCH 3.13 131/160] Bluetooth: Fix redundant encryption request for reauthentication

2014-06-10 Thread Johan Hedberg
Hi,

On Tue, Jun 10, 2014, Kamal Mostafa wrote:
> 3.13.11.3 -stable review patch.  If anyone has any objections, please let me 
> know.
> 
> --
> 
> From: Johan Hedberg 
> 
> commit 09da1f3463eb81d59685df723b1c5950b7570340 upstream.
> 
> When we're performing reauthentication (in order to elevate the
> security level from an unauthenticated key to an authenticated one) we
> do not need to issue any encryption command once authentication
> completes. Since the trigger for the encryption HCI command is the
> ENCRYPT_PEND flag this flag should not be set in this scenario.
> Instead, the REAUTH_PEND flag takes care of all necessary steps for
> reauthentication.
> 
> Signed-off-by: Johan Hedberg 
> Signed-off-by: Marcel Holtmann 
> Signed-off-by: Kamal Mostafa 
> ---
>  net/bluetooth/hci_conn.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

This one has a regression reported against it:

https://bugzilla.kernel.org/show_bug.cgi?id=77541

The report also has a working fix for the issue which we'll be sending
to the stable trees (it's already in the Bluetooth subsystem tree). So
I'm not sure what the right way to proceed here: ignore this patch until
the other patch is available, apply this one and wait for the other one,
or just forget about both patches for the stable trees.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 131/160] Bluetooth: Fix redundant encryption request for reauthentication

2014-06-10 Thread Johan Hedberg
Hi,

On Tue, Jun 10, 2014, Kamal Mostafa wrote:
 3.13.11.3 -stable review patch.  If anyone has any objections, please let me 
 know.
 
 --
 
 From: Johan Hedberg johan.hedb...@intel.com
 
 commit 09da1f3463eb81d59685df723b1c5950b7570340 upstream.
 
 When we're performing reauthentication (in order to elevate the
 security level from an unauthenticated key to an authenticated one) we
 do not need to issue any encryption command once authentication
 completes. Since the trigger for the encryption HCI command is the
 ENCRYPT_PEND flag this flag should not be set in this scenario.
 Instead, the REAUTH_PEND flag takes care of all necessary steps for
 reauthentication.
 
 Signed-off-by: Johan Hedberg johan.hedb...@intel.com
 Signed-off-by: Marcel Holtmann mar...@holtmann.org
 Signed-off-by: Kamal Mostafa ka...@canonical.com
 ---
  net/bluetooth/hci_conn.c | 9 ++---
  1 file changed, 6 insertions(+), 3 deletions(-)

This one has a regression reported against it:

https://bugzilla.kernel.org/show_bug.cgi?id=77541

The report also has a working fix for the issue which we'll be sending
to the stable trees (it's already in the Bluetooth subsystem tree). So
I'm not sure what the right way to proceed here: ignore this patch until
the other patch is available, apply this one and wait for the other one,
or just forget about both patches for the stable trees.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.12 064/146] Bluetooth: Fix redundant encryption request for reauthentication

2014-06-09 Thread Johan Hedberg
Hi,

On Mon, Jun 09, 2014, Jiri Slaby wrote:
> 3.12-stable review patch.  If anyone has any objections, please let me know.
> 
> ===
> 
> commit 09da1f3463eb81d59685df723b1c5950b7570340 upstream.
> 
> When we're performing reauthentication (in order to elevate the
> security level from an unauthenticated key to an authenticated one) we
> do not need to issue any encryption command once authentication
> completes. Since the trigger for the encryption HCI command is the
> ENCRYPT_PEND flag this flag should not be set in this scenario.
> Instead, the REAUTH_PEND flag takes care of all necessary steps for
> reauthentication.
> 
> Signed-off-by: Johan Hedberg 
> Signed-off-by: Marcel Holtmann 
> Signed-off-by: Jiri Slaby 
> ---
>  net/bluetooth/hci_conn.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

This one seems to be causing a regression, so it's probably best to keep
it out of stable trees for now:

https://bugzilla.kernel.org/show_bug.cgi?id=77541

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.12 064/146] Bluetooth: Fix redundant encryption request for reauthentication

2014-06-09 Thread Johan Hedberg
Hi,

On Mon, Jun 09, 2014, Jiri Slaby wrote:
 3.12-stable review patch.  If anyone has any objections, please let me know.
 
 ===
 
 commit 09da1f3463eb81d59685df723b1c5950b7570340 upstream.
 
 When we're performing reauthentication (in order to elevate the
 security level from an unauthenticated key to an authenticated one) we
 do not need to issue any encryption command once authentication
 completes. Since the trigger for the encryption HCI command is the
 ENCRYPT_PEND flag this flag should not be set in this scenario.
 Instead, the REAUTH_PEND flag takes care of all necessary steps for
 reauthentication.
 
 Signed-off-by: Johan Hedberg johan.hedb...@intel.com
 Signed-off-by: Marcel Holtmann mar...@holtmann.org
 Signed-off-by: Jiri Slaby jsl...@suse.cz
 ---
  net/bluetooth/hci_conn.c | 9 ++---
  1 file changed, 6 insertions(+), 3 deletions(-)

This one seems to be causing a regression, so it's probably best to keep
it out of stable trees for now:

https://bugzilla.kernel.org/show_bug.cgi?id=77541

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] bluetooth:hci_ldisc: add tasklet for deferred TX handling

2014-04-23 Thread Johan Hedberg
Hi Andreas,

On Wed, Apr 16, 2014, Andreas Bießmann wrote:
> This patch fixes a recursive locking scenario when using BCSP connection via
> 8250 driver. The 8250 driver may tty_wakeup() in interrupt context which
> results in hci_uart_tx_wakeup(). This in turn will call uart_write() in the
> very same context and therefore will spin_lock() the same lock within the
> same context.
> 
> Here is the call stack:
> 
> ---8<---
> =
> [ INFO: possible recursive locking detected ]
> 3.4.87-gf1a3cc3 #3 Tainted: G   O
> -
> swapper/0 is trying to acquire lock:
>  (_lock_key){-.-...}, at: [] uart_write+0x60/0xfc
> 
> but task is already holding lock:
>  (_lock_key){-.-...}, at: [] serial8250_handle_irq+0x24/0x88
> 
> other info that might help us debug this:
>  Possible unsafe locking scenario:
> 
>CPU0
>
>   lock(_lock_key);
>   lock(_lock_key);
> 
>  *** DEADLOCK ***
> 
>  May be due to missing lock nesting notation
> 
> 2 locks held by swapper/0:
>  #0:  (&(>lock)->rlock){-.-...}, at: [] 
> serial8250_interrupt+0x2c/0xc0
>  #1:  (_lock_key){-.-...}, at: [] 
> serial8250_handle_irq+0x24/0x88
> 
> stack backtrace:
> [] (unwind_backtrace+0x0/0xec) from [] 
> (dump_stack+0x20/0x24)
> [] (dump_stack+0x20/0x24) from [] 
> (print_deadlock_bug+0xb4/0xe4)
> [] (print_deadlock_bug+0xb4/0xe4) from [] 
> (check_deadlock.isra.20+0x160/0x18c)
> [] (check_deadlock.isra.20+0x160/0x18c) from [] 
> (validate_chain.isra.24+0x4a4/0x4f0)
> [] (validate_chain.isra.24+0x4a4/0x4f0) from [] 
> (__lock_acquire+0x670/0x740)
> [] (__lock_acquire+0x670/0x740) from [] 
> (lock_acquire+0x138/0x15c)
> [] (lock_acquire+0x138/0x15c) from [] 
> (_raw_spin_lock_irqsave+0x54/0x68)
> [] (_raw_spin_lock_irqsave+0x54/0x68) from [] 
> (uart_write+0x60/0xfc)
> [] (uart_write+0x60/0xfc) from [] 
> (hci_uart_tx_wakeup+0x9c/0x160 [hci_uart])
> [] (hci_uart_tx_wakeup+0x9c/0x160 [hci_uart]) from [] 
> (hci_uart_tty_wakeup+0x58/0x5c [hci_uart])
> [] (hci_uart_tty_wakeup+0x58/0x5c [hci_uart]) from [] 
> (tty_wakeup+0x48/0x68)
> [] (tty_wakeup+0x48/0x68) from [] 
> (uart_write_wakeup+0x2c/0x30)
> [] (uart_write_wakeup+0x2c/0x30) from [] 
> (serial8250_tx_chars+0xf0/0x140)
> [] (serial8250_tx_chars+0xf0/0x140) from [] 
> (serial8250_handle_irq+0x6c/0x88)
> [] (serial8250_handle_irq+0x6c/0x88) from [] 
> (serial8250_default_handle_irq+0x30/0x34)
> [] (serial8250_default_handle_irq+0x30/0x34) from [] 
> (serial8250_interrupt+0x44/0xc0)
> [] (serial8250_interrupt+0x44/0xc0) from [] 
> (handle_irq_event_percpu+0xc4/0x2cc)
> [] (handle_irq_event_percpu+0xc4/0x2cc) from [] 
> (handle_irq_event+0x4c/0x6c)
> [] (handle_irq_event+0x4c/0x6c) from [] 
> (handle_edge_irq+0x114/0x14c)
> [] (handle_edge_irq+0x114/0x14c) from [] 
> (generic_handle_irq+0x40/0x54)
> [] (generic_handle_irq+0x40/0x54) from [] 
> (gpio_irq_handler+0x168/0x1ac)
> [] (gpio_irq_handler+0x168/0x1ac) from [] 
> (generic_handle_irq+0x40/0x54)
> [] (generic_handle_irq+0x40/0x54) from [] 
> (handle_IRQ+0x70/0x94)
> [] (handle_IRQ+0x70/0x94) from [] 
> (omap3_intc_handle_irq+0x64/0x78)
> [] (omap3_intc_handle_irq+0x64/0x78) from [] 
> (__irq_svc+0x44/0x78)
> --->8---
> 
> Signed-off-by: Andreas Bießmann 
> Cc: Marcel Holtmann 
> Cc: Gustavo Padovan 
> Cc: Johan Hedberg 
> Cc: linux-blueto...@vger.kernel.org
> ---
> 
> It seems at least one other guy had the very same problem with another uart
> (mpc52xx): http://www.spinics.net/lists/linux-rt-users/msg09246.html
> 
> I wonder, if my approach is right. It is runtime tested with 3.4.87 on our
> board and work around the mentioned recursive locking. But I do not know, if
> it should be fixed in another way.
> If it is right, I'd work some more on it to get the fix mainline.
> 
>  drivers/bluetooth/hci_ldisc.c |   49 
> -
>  drivers/bluetooth/hci_uart.h  |2 ++
>  2 files changed, 45 insertions(+), 6 deletions(-)

This seems to be tackling the same problem as the following patch from
Felipe Balbi (of which a new revision was sent earlier today):

Subject: [PATCH 02/13] bluetooth: hci_ldisc: fix deadlock condition

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] bluetooth:hci_ldisc: add tasklet for deferred TX handling

2014-04-23 Thread Johan Hedberg
Hi Andreas,

On Wed, Apr 16, 2014, Andreas Bießmann wrote:
 This patch fixes a recursive locking scenario when using BCSP connection via
 8250 driver. The 8250 driver may tty_wakeup() in interrupt context which
 results in hci_uart_tx_wakeup(). This in turn will call uart_write() in the
 very same context and therefore will spin_lock() the same lock within the
 same context.
 
 Here is the call stack:
 
 ---8---
 =
 [ INFO: possible recursive locking detected ]
 3.4.87-gf1a3cc3 #3 Tainted: G   O
 -
 swapper/0 is trying to acquire lock:
  (port_lock_key){-.-...}, at: [c023e21c] uart_write+0x60/0xfc
 
 but task is already holding lock:
  (port_lock_key){-.-...}, at: [c0242830] serial8250_handle_irq+0x24/0x88
 
 other info that might help us debug this:
  Possible unsafe locking scenario:
 
CPU0

   lock(port_lock_key);
   lock(port_lock_key);
 
  *** DEADLOCK ***
 
  May be due to missing lock nesting notation
 
 2 locks held by swapper/0:
  #0:  ((i-lock)-rlock){-.-...}, at: [c0240f44] 
 serial8250_interrupt+0x2c/0xc0
  #1:  (port_lock_key){-.-...}, at: [c0242830] 
 serial8250_handle_irq+0x24/0x88
 
 stack backtrace:
 [c0014234] (unwind_backtrace+0x0/0xec) from [c0398448] 
 (dump_stack+0x20/0x24)
 [c0398448] (dump_stack+0x20/0x24) from [c006eebc] 
 (print_deadlock_bug+0xb4/0xe4)
 [c006eebc] (print_deadlock_bug+0xb4/0xe4) from [c006f04c] 
 (check_deadlock.isra.20+0x160/0x18c)
 [c006f04c] (check_deadlock.isra.20+0x160/0x18c) from [c0070890] 
 (validate_chain.isra.24+0x4a4/0x4f0)
 [c0070890] (validate_chain.isra.24+0x4a4/0x4f0) from [c00715a0] 
 (__lock_acquire+0x670/0x740)
 [c00715a0] (__lock_acquire+0x670/0x740) from [c0071cb0] 
 (lock_acquire+0x138/0x15c)
 [c0071cb0] (lock_acquire+0x138/0x15c) from [c03a5904] 
 (_raw_spin_lock_irqsave+0x54/0x68)
 [c03a5904] (_raw_spin_lock_irqsave+0x54/0x68) from [c023e21c] 
 (uart_write+0x60/0xfc)
 [c023e21c] (uart_write+0x60/0xfc) from [bf0716d8] 
 (hci_uart_tx_wakeup+0x9c/0x160 [hci_uart])
 [bf0716d8] (hci_uart_tx_wakeup+0x9c/0x160 [hci_uart]) from [bf0717f4] 
 (hci_uart_tty_wakeup+0x58/0x5c [hci_uart])
 [bf0717f4] (hci_uart_tty_wakeup+0x58/0x5c [hci_uart]) from [c02246ec] 
 (tty_wakeup+0x48/0x68)
 [c02246ec] (tty_wakeup+0x48/0x68) from [c023efb0] 
 (uart_write_wakeup+0x2c/0x30)
 [c023efb0] (uart_write_wakeup+0x2c/0x30) from [c0241d0c] 
 (serial8250_tx_chars+0xf0/0x140)
 [c0241d0c] (serial8250_tx_chars+0xf0/0x140) from [c0242878] 
 (serial8250_handle_irq+0x6c/0x88)
 [c0242878] (serial8250_handle_irq+0x6c/0x88) from [c02428c4] 
 (serial8250_default_handle_irq+0x30/0x34)
 [c02428c4] (serial8250_default_handle_irq+0x30/0x34) from [c0240f5c] 
 (serial8250_interrupt+0x44/0xc0)
 [c0240f5c] (serial8250_interrupt+0x44/0xc0) from [c0087c70] 
 (handle_irq_event_percpu+0xc4/0x2cc)
 [c0087c70] (handle_irq_event_percpu+0xc4/0x2cc) from [c0087ec4] 
 (handle_irq_event+0x4c/0x6c)
 [c0087ec4] (handle_irq_event+0x4c/0x6c) from [c008a368] 
 (handle_edge_irq+0x114/0x14c)
 [c008a368] (handle_edge_irq+0x114/0x14c) from [c0087528] 
 (generic_handle_irq+0x40/0x54)
 [c0087528] (generic_handle_irq+0x40/0x54) from [c01f1900] 
 (gpio_irq_handler+0x168/0x1ac)
 [c01f1900] (gpio_irq_handler+0x168/0x1ac) from [c0087528] 
 (generic_handle_irq+0x40/0x54)
 [c0087528] (generic_handle_irq+0x40/0x54) from [c000ed7c] 
 (handle_IRQ+0x70/0x94)
 [c000ed7c] (handle_IRQ+0x70/0x94) from [c000877c] 
 (omap3_intc_handle_irq+0x64/0x78)
 [c000877c] (omap3_intc_handle_irq+0x64/0x78) from [c000df44] 
 (__irq_svc+0x44/0x78)
 ---8---
 
 Signed-off-by: Andreas Bießmann andr...@biessmann.de
 Cc: Marcel Holtmann mar...@holtmann.org
 Cc: Gustavo Padovan gust...@padovan.org
 Cc: Johan Hedberg johan.hedb...@gmail.com
 Cc: linux-blueto...@vger.kernel.org
 ---
 
 It seems at least one other guy had the very same problem with another uart
 (mpc52xx): http://www.spinics.net/lists/linux-rt-users/msg09246.html
 
 I wonder, if my approach is right. It is runtime tested with 3.4.87 on our
 board and work around the mentioned recursive locking. But I do not know, if
 it should be fixed in another way.
 If it is right, I'd work some more on it to get the fix mainline.
 
  drivers/bluetooth/hci_ldisc.c |   49 
 -
  drivers/bluetooth/hci_uart.h  |2 ++
  2 files changed, 45 insertions(+), 6 deletions(-)

This seems to be tackling the same problem as the following patch from
Felipe Balbi (of which a new revision was sent earlier today):

Subject: [PATCH 02/13] bluetooth: hci_ldisc: fix deadlock condition

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: USB autosuspend causing trouble on Intel bluetooth (Linux 3.14)

2014-04-03 Thread Johan Hedberg
Hi Thomas,

On Thu, Apr 03, 2014, Thomas Bächler wrote:
> > You can easily check by running the "Inquiry (LIAC)” test from
> > tools/hci-tester. Problem is that some of the HCI events are not
> > making it to the host. They get delivered as soon as the device
> > wakes up again. In this test case it is the Inquiry Complete event.
> > If you poke the controller and send a new command, the even will be
> > magically dequeued.
> 
> I cannot figure out how to compile hci-tester. The Makefiles from
> bluez.git won't build it.

A quick look at Makefile.tools shows that you'll probably need to pass
--enable-experimental to configure in order to build it.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: USB autosuspend causing trouble on Intel bluetooth (Linux 3.14)

2014-04-03 Thread Johan Hedberg
Hi Thomas,

On Thu, Apr 03, 2014, Thomas Bächler wrote:
  You can easily check by running the Inquiry (LIAC)” test from
  tools/hci-tester. Problem is that some of the HCI events are not
  making it to the host. They get delivered as soon as the device
  wakes up again. In this test case it is the Inquiry Complete event.
  If you poke the controller and send a new command, the even will be
  magically dequeued.
 
 I cannot figure out how to compile hci-tester. The Makefiles from
 bluez.git won't build it.

A quick look at Makefile.tools shows that you'll probably need to pass
--enable-experimental to configure in order to build it.

Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers:bluetooth:ath3k.c: Fixed sparse warning for cast to restricted __le32

2014-03-25 Thread Johan Hedberg
Hi,

On Tue, Mar 25, 2014, Surendra Patil wrote:
> This patch fixes below Sparse warnings -
> drivers/bluetooth/ath3k.c:370:17: warning: cast to restricted __le32
> drivers/bluetooth/ath3k.c:432:17: warning: cast to restricted __le32
> 
> Signed-off-by: Surendra Patil 
> ---
>  drivers/bluetooth/ath3k.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
> index be571fe..badacbc 100644
> --- a/drivers/bluetooth/ath3k.c
> +++ b/drivers/bluetooth/ath3k.c
> @@ -367,7 +367,7 @@ static int ath3k_load_patch(struct usb_device *udev)
>   }
>  
>   snprintf(filename, ATH3K_NAME_LEN, "ar3k/AthrBT_0x%08x.dfu",
> - le32_to_cpu(fw_version.rom_version));
> + fw_version.rom_version);
>  
>   ret = request_firmware(, filename, >dev);
>   if (ret < 0) {
> @@ -429,7 +429,7 @@ static int ath3k_load_syscfg(struct usb_device *udev)
>   }
>  
>   snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s",
> - le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
> +  fw_version.rom_version, clk_value, ".dfu");
>  
>   ret = request_firmware(, filename, >dev);
>   if (ret < 0) {

Are you sure this doesn't introduce a bug on big endian systems? We just
recently applied commit b9e2535acad8f52a17e2aa843d45a6b756b59592 which
adds this le32_to_cpu conversion. Probably the correct fix is to update
this fw_version struct definition to use __le32 for any member that's
expected to be in little endian format?

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   >