2011-07-15 03:18:32

by Ed Tomlinson

[permalink] [raw]
Subject: [BUG] Bluetooth broken post rc7

Hi,

I booted to todays linux git and bluetooth is no longer working. My magic mouse will not connect correctly.

Reverting:

commit 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95
Author: Gustavo F. Padovan <[email protected]>
Date: Thu Jun 30 16:11:30 2011 -0300

Bluetooth: Fix regression with incoming L2CAP connections

PTS test A2DP/SRC/SRC_SET/TC_SRC_SET_BV_02_I revealed that
( probably after the df3c3931e commit ) the l2cap connection
could not be established in case when the "Auth Complete" HCI
event does not arive before the initiator send "Configuration
request", in which case l2cap replies with "Command rejected"
since the channel is still in BT_CONNECT2 state.

Based on patch from: Ilia Kolomisnky <[email protected]>

Signed-off-by: Gustavo F. Padovan <[email protected]>

Fixes the bug here (things work like rc7).

Do we really need 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95 in 3.0?

Thanks,

Ed Tomlinson


2011-07-19 18:58:26

by Pavan Savoy

[permalink] [raw]
Subject: Re: [BUG] Bluetooth broken post rc7

On Sat, Jul 16, 2011 at 3:17 PM, David Miller <[email protected]> wrote:
> From: Jiri Kosina <[email protected]>
> Date: Sat, 16 Jul 2011 21:43:06 +0200 (CEST)
>
>> could you please repost the patch with proper changelog and your
>> Signed-off-by, so that it could (hopefully) be applied for 3.0 still?
>
> It's already in my networking tree and on the way to Linus, and has
> been so for half a day.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

I can't seem to get BNEP working, and I have a feeling it has got to
do something with this patch.
I actually hit the error condition NULL @ [ 8882.843017] chan->scid 64
[ 8882.845977] Bluetooth: parent is NULL
[ 8882.850067] conn e53e5e00, code 0x03, ident 0x66, len 8
[ 8882.855895] code 0x03
[ 8882.858581] hci0: type 2 len 21

which is at +//
parent->sk_data_ready(parent, 0);
+ if (parent) {
+ BT_ERR("hitting condition @\
+ %d", __LINE__);
+ parent->sk_data_ready(parent,
+ 0);
+ } else {
+ BT_ERR("parent is NULL");
+ }

my l2cap_config_req does say this now,
@@ -2524,7 +2525,7 @@ static inline int l2cap_config_req(struct
l2cap_conn *conn, struct l2cap_cmd_hdr

sk = chan->sk;

- if (chan->state != BT_CONFIG) {
+ if (chan->state != BT_CONFIG && sk->sk_state != BT_CONNECT2) {
struct l2cap_cmd_rej rej;


However, I can seem to connect because of the following reason,
[ 8887.914703] l2cap_chan_timeout: reason: 110
[ 8887.919342] chan e26fc800 state 6 socket cfc38a00
[ 8887.924560] conn e53e5e00, code 0x03, ident 0x66, len 8
[ 8887.930328] code 0x03
[ 8887.932830] chan e26fc800 state 8
[ 8887.936614] chan e26fc800, conn e53e5e00, err 110
[ 8887.941925] hci0: type 2 len 21
[ 8891.047576] hcon d44c7000 reason 19
[ 8891.051666] hcon d44c7000 conn e53e5e00, err 104
[ 8942.897979] chan e26fc800 state 9 socket cfc38a00


Any suggestions ??

2011-07-16 20:17:33

by David Miller

[permalink] [raw]
Subject: Re: [BUG] Bluetooth broken post rc7

From: Jiri Kosina <[email protected]>
Date: Sat, 16 Jul 2011 21:43:06 +0200 (CEST)

> could you please repost the patch with proper changelog and your
> Signed-off-by, so that it could (hopefully) be applied for 3.0 still?

It's already in my networking tree and on the way to Linus, and has
been so for half a day.

2011-07-16 19:43:06

by Jiri Kosina

[permalink] [raw]
Subject: Re: [BUG] Bluetooth broken post rc7


[ adding Linus to CC ... would be good to have this fixed before 3.0-final
indeed ]

On Fri, 15 Jul 2011, Ed Tomlinson wrote:

> > > I booted to todays linux git and bluetooth is no longer working.
> > > My magic mouse will not connect correctly.
> > >
> > > Reverting:
> > >
> > > commit 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95
> > > Author: Gustavo F. Padovan <[email protected]>
> > > Date: Thu Jun 30 16:11:30 2011 -0300
> > >
> > > Bluetooth: Fix regression with incoming L2CAP connections
> > >
> > > PTS test A2DP/SRC/SRC_SET/TC_SRC_SET_BV_02_I revealed that
> > > ( probably after the df3c3931e commit ) the l2cap connection
> > > could not be established in case when the "Auth Complete" HCI
> > > event does not arive before the initiator send "Configuration
> > > request", in which case l2cap replies with "Command rejected"
> > > since the channel is still in BT_CONNECT2 state.
> > >
> > > Based on patch from: Ilia Kolomisnky <[email protected]>
> > >
> > > Signed-off-by: Gustavo F. Padovan <[email protected]>
> > >
> > > Fixes the bug here (things work like rc7).
> > >
> > > Do we really need 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95 in 3.0?
> > >
> > > Thanks,
> > >
> > > Ed Tomlinson
> > > --
> >
> > I've changed the check to something like this:
> >
> > diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> > index ebff14c..f88b9c8 100644
> > --- a/net/bluetooth/l2cap_core.c
> > +++ b/net/bluetooth/l2cap_core.c
> > @@ -2323,8 +2323,7 @@ static inline int l2cap_config_req(struct
> > l2cap_conn *conn, struct l2cap_cmd_hdr
> >
> > sk = chan->sk;
> >
> > - if ((bt_sk(sk)->defer_setup && sk->sk_state != BT_CONNECT2) ||
> > - (!bt_sk(sk)->defer_setup && sk->sk_state != BT_CONFIG)) {
> > + if ((sk->sk_state != BT_CONNECT2) && (sk->sk_state != BT_CONFIG)) {
> > struct l2cap_cmd_rej rej;
> >
> > rej.reason = cpu_to_le16(0x0002);
> >
> > Seems to work fine.
>
> And here too. You can can my tested by
>
> Tested By: Ed Tomlinson <[email protected]>
>
> IMHO this should be in 3.0.0
>
> Thanks!
> Ed Tomlinson

Luiz,

could you please repost the patch with proper changelog and your
Signed-off-by, so that it could (hopefully) be applied for 3.0 still?

Thanks,

--
Jiri Kosina
SUSE Labs


2011-07-15 11:28:03

by Ed Tomlinson

[permalink] [raw]
Subject: Re: [BUG] Bluetooth broken post rc7

On Friday 15 July 2011 06:11:04 Luiz Augusto von Dentz wrote:
> Hi,
>
> On Fri, Jul 15, 2011 at 6:18 AM, Ed Tomlinson <[email protected]> wrote:
> > Hi,
> >
> > I booted to todays linux git and bluetooth is no longer working. My magic mouse will not connect correctly.
> >
> > Reverting:
> >
> > commit 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95
> > Author: Gustavo F. Padovan <[email protected]>
> > Date: Thu Jun 30 16:11:30 2011 -0300
> >
> > Bluetooth: Fix regression with incoming L2CAP connections
> >
> > PTS test A2DP/SRC/SRC_SET/TC_SRC_SET_BV_02_I revealed that
> > ( probably after the df3c3931e commit ) the l2cap connection
> > could not be established in case when the "Auth Complete" HCI
> > event does not arive before the initiator send "Configuration
> > request", in which case l2cap replies with "Command rejected"
> > since the channel is still in BT_CONNECT2 state.
> >
> > Based on patch from: Ilia Kolomisnky <[email protected]>
> >
> > Signed-off-by: Gustavo F. Padovan <[email protected]>
> >
> > Fixes the bug here (things work like rc7).
> >
> > Do we really need 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95 in 3.0?
> >
> > Thanks,
> >
> > Ed Tomlinson
> > --
>
> I've changed the check to something like this:
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index ebff14c..f88b9c8 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -2323,8 +2323,7 @@ static inline int l2cap_config_req(struct
> l2cap_conn *conn, struct l2cap_cmd_hdr
>
> sk = chan->sk;
>
> - if ((bt_sk(sk)->defer_setup && sk->sk_state != BT_CONNECT2) ||
> - (!bt_sk(sk)->defer_setup && sk->sk_state != BT_CONFIG)) {
> + if ((sk->sk_state != BT_CONNECT2) && (sk->sk_state != BT_CONFIG)) {
> struct l2cap_cmd_rej rej;
>
> rej.reason = cpu_to_le16(0x0002);
>
> Seems to work fine.

And here too. You can can my tested by

Tested By: Ed Tomlinson <[email protected]>

IMHO this should be in 3.0.0

Thanks!
Ed Tomlinson


2011-07-15 10:11:04

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [BUG] Bluetooth broken post rc7

Hi,

On Fri, Jul 15, 2011 at 6:18 AM, Ed Tomlinson <[email protected]> wrote:
> Hi,
>
> I booted to todays linux git and bluetooth is no longer working. ?My magic mouse will not connect correctly.
>
> Reverting:
>
> commit 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95
> Author: Gustavo F. Padovan <[email protected]>
> Date: ? Thu Jun 30 16:11:30 2011 -0300
>
> ? ?Bluetooth: Fix regression with incoming L2CAP connections
>
> ? ?PTS test A2DP/SRC/SRC_SET/TC_SRC_SET_BV_02_I revealed that
> ? ?( probably after the df3c3931e commit ) the l2cap connection
> ? ?could not be established in case when the "Auth Complete" HCI
> ? ?event does not arive before the initiator send "Configuration
> ? ?request", in which case l2cap replies with "Command rejected"
> ? ?since the channel is still in BT_CONNECT2 state.
>
> ? ?Based on patch from: Ilia Kolomisnky <[email protected]>
>
> ? ?Signed-off-by: Gustavo F. Padovan <[email protected]>
>
> Fixes the bug here (things work like rc7).
>
> Do we really need 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95 in 3.0?
>
> Thanks,
>
> Ed Tomlinson
> --

I've changed the check to something like this:

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index ebff14c..f88b9c8 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2323,8 +2323,7 @@ static inline int l2cap_config_req(struct
l2cap_conn *conn, struct l2cap_cmd_hdr

sk = chan->sk;

- if ((bt_sk(sk)->defer_setup && sk->sk_state != BT_CONNECT2) ||
- (!bt_sk(sk)->defer_setup && sk->sk_state != BT_CONFIG)) {
+ if ((sk->sk_state != BT_CONNECT2) && (sk->sk_state != BT_CONFIG)) {
struct l2cap_cmd_rej rej;

rej.reason = cpu_to_le16(0x0002);

Seems to work fine.

--
Luiz Augusto von Dentz