Skip to contentSkip to conversation

Bluetooth broken post rc7

BUG Ed Tomlinson 5 participants 6 messages Jul 15, 2011 – Jul 19, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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]>

Fixes the bug here (things work like rc7).

Do we really need 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95 in 3.0?

Thanks,

Ed Tomlinson

#1 lore raw

Hi,

Quoted 23 lines · Ed Tomlinson

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]>

Quoted 8 lines

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:

net/bluetooth/l2cap_core.c +0 -0
index ebff14c..f88b9c8 100644
@@ -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.

Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw
Quoted 53 lines · On Friday 15 July 2011 06:11:04 Luiz Augusto von Dentz wrote:

Hi,

Quoted 23 lines · Ed Tomlinson

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]>

Quoted 8 lines

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:

net/bluetooth/l2cap_core.c +0 -0
index ebff14c..f88b9c8 100644
@@ -2323,8 +2323,7 @@ static inline int l2cap_config_req(struct

l2cap_conn *conn, struct l2cap_cmd_hdr

        sk = chan->sk;
net/bluetooth/l2cap_core.c +1 -2
-       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);
Quoted 1 line

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

#3 lore raw

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

Quoted 53 lines · Ed Tomlinson
Quoted 49 lines
Quoted 22 lines

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]>

Quoted 8 lines

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:

net/bluetooth/l2cap_core.c +0 -0
index ebff14c..f88b9c8 100644
@@ -2323,8 +2323,7 @@ static inline int l2cap_config_req(struct

l2cap_conn *conn, struct l2cap_cmd_hdr

        sk = chan->sk;
net/bluetooth/l2cap_core.c +1 -2
-       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);
Quoted 1 line

Seems to work fine.

And here too. You can can my tested by

Quoted 6 lines

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,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#4 lore raw

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

Quoted 2 lines

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.

#5 lore raw
Quoted 6 lines · David Miller

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

Quoted 2 lines

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?

Quoted 6 lines

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 ??