public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Ed Tsang <netdesign_98@yahoo.com>
To: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>,
	Marcel Holtmann <marcel@holtmann.org>
Cc: Bluettooth Linux <linux-bluetooth@vger.kernel.org>,
	liejuntao001@gamail.com
Subject: Re: double Connect req: psm 1 scid 0x0040 ?
Date: Wed, 16 Jun 2010 06:39:06 -0700 (PDT)	[thread overview]
Message-ID: <497946.31108.qm@web52603.mail.re2.yahoo.com> (raw)
In-Reply-To: <AANLkTikNH3_CC3OottoqMnZEwu4sbqvchFxZ2Q7-GlRZ@mail.gmail.com>

Anrel,  what kernel version are you using?
Previously it was happening with a Blackberry on 2.6.31-17. I was planning to dig into it, then I upgraded my ubuntu with (2.6.32-22) and the problem disappeared. I am guessing it might be a raising condition with certain phone during certain circumstance. I think Liejun Tao <liejuntao001@gmail.com> has investigate this one too.

Cheers,
Ed



----- Original Message ----
From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Ed Tsang <netdesign_98@yahoo.com>; Bluettooth Linux <linux-bluetooth@vger.kernel.org>
Sent: Wed, June 16, 2010 6:21:55 AM
Subject: Re: double Connect req: psm 1 scid 0x0040 ?

Hi,

On Wed, Feb 3, 2010 at 6:07 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
>> >> In hcidump I seem to see a problem in #3. After the Encrypt Change there seem to be 2 >con. req. psm 1 scid 0x0040
>>
>> >what kernel version is this? I think we fixed that already.
>> It is a ubutunu distribution. 2.6.31-17-generic.
>
> can you test with a 2.6.33-rc6 vanilla kernel. I really thing this got
> fixed and you might see a side effect or bad patch here.

Marcel we are seeing "double L2CAP connect also" when connecting to
some smartphones using contran profile. What about following patch
proposal:

The idea is to use existing flag L2CAP_CONF_CONNECT_PEND to mark that
L2CAP request has been sent.

Currently it is durty hack, I will send modified patch later today.

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index fc81acb..27bff6e 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -394,6 +394,12 @@ static void l2cap_do_start(struct sock *sk)

                        l2cap_pi(sk)->ident = l2cap_get_ident(conn);

+                       if (l2cap_pi(sk)->conf_state &
L2CAP_CONF_CONNECT_PEND) {
+                               printk(KERN_ERR "\n!!! %s: Connection
pending !!!\n", __FUNCTION__);
+                               return;
+                       }
+
+                       l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
                        l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
                                        L2CAP_CONN_REQ, sizeof(req), &req);
                }
@@ -448,6 +454,13 @@ static void l2cap_conn_start(struct l2cap_conn *conn)

                                l2cap_pi(sk)->ident = l2cap_get_ident(conn);

+                               if (l2cap_pi(sk)->conf_state &
L2CAP_CONF_CONNECT_PEND) {
+                                       printk(KERN_ERR "\n!!! %s:
Connection pending !!!\n", __FUNCTION__);
+                                       bh_unlock_sock(sk);
+                                       continue;
+                               }
+
+                               l2cap_pi(sk)->conf_state |=
L2CAP_CONF_CONNECT_PEND;
                                l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
                                        L2CAP_CONN_REQ, sizeof(req), &req);
                        }
@@ -3809,6 +3822,7 @@ static int l2cap_security_cfm(struct hci_conn
*hcon, u8 status, u8 encrypt)
                bh_lock_sock(sk);

                if (l2cap_pi(sk)->conf_state & L2CAP_CONF_CONNECT_PEND) {
+                       printk(KERN_ERR "\n!!! %s: Connection pending
!!!\n", __FUNCTION__);
                        bh_unlock_sock(sk);
                        continue;
                }
@@ -3828,6 +3842,7 @@ static int l2cap_security_cfm(struct hci_conn
*hcon, u8 status, u8 encrypt)

                                l2cap_pi(sk)->ident = l2cap_get_ident(conn);

+                               l2cap_pi(sk)->conf_state |=
L2CAP_CONF_CONNECT_PEND;
                                l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
                                        L2CAP_CONN_REQ, sizeof(req), &req);



>
> Regards
>
> Marcel
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  reply	other threads:[~2010-06-16 13:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 20:33 double Connect req: psm 1 scid 0x0040 ? Ed Tsang
2010-02-02 21:41 ` Liejun Tao
2010-02-03  0:28 ` Marcel Holtmann
2010-02-03 14:54   ` Ed Tsang
2010-02-03 15:07     ` Marcel Holtmann
2010-02-03 16:02       ` Ed Tsang
2010-06-16 10:21       ` Andrei Emeltchenko
2010-06-16 13:39         ` Ed Tsang [this message]
2010-06-16 14:14           ` Andrei Emeltchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=497946.31108.qm@web52603.mail.re2.yahoo.com \
    --to=netdesign_98@yahoo.com \
    --cc=andrei.emeltchenko.news@gmail.com \
    --cc=liejuntao001@gamail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox