Return-Path: MIME-Version: 1.0 In-Reply-To: <02B0CA51-A2BB-47D0-B526-229C12C8195C@holtmann.org> References: <1402049971-7762-1-git-send-email-kiran.kumar@linaro.org> <02B0CA51-A2BB-47D0-B526-229C12C8195C@holtmann.org> Date: Fri, 6 Jun 2014 16:42:06 +0530 Message-ID: Subject: Re: [RFC] Bluetooth: Do not attempt to send dlci disconnect when in BT_CONFIG. From: Kiran Raparthy To: Marcel Holtmann Cc: linux-kernel@vger.kernel.org, Nick Pelly , "Gustavo F. Padovan" , Johan Hedberg , "David S. Miller" , Peter Hurley , Seung-Woo Kim , "open list:BLUETOOTH SUBSYSTEM" , "open list:NETWORKING [GENERAL]" , Android Kernel Team , John Stultz Content-Type: multipart/alternative; boundary=047d7bdc80fc8bff6904fb28eedd List-ID: --047d7bdc80fc8bff6904fb28eedd Content-Type: text/plain; charset=UTF-8 Hi Marcel, Below are the traces used by author for submitting patch previously. [ 132.856414] rfcomm:rfcomm_sock_shutdown: sock c5cb3a20, sk c63fca00 [ 132.856933] rfcomm:__rfcomm_sock_close: sk c63fca00 state 5 socket c5cb3a20 [ 132.857788] rfcomm:__rfcomm_dlc_close: dlc c61ea240 state 7 dlci 38 err 0 session c63d4ba0 [ 132.858612] rfcomm:rfcomm_send_disc: c63d4ba0 dlci 38 [ 132.859069] rfcomm:rfcomm_send_frame: session c63d4ba0 len 4 [ 132.859893] l2cap:l2cap_sock_sendmsg: sock c5cb38c0, sk c63fc800 [ 132.860351] rfcomm:rfcomm_dlc_set_timer: dlc c61ea240 state 8 timeout 2000 [ 133.863739] rfcomm:rfcomm_sock_release: sock c5cb3a20, sk c63fca00 [ 133.864257] rfcomm:rfcomm_sock_shutdown: sock c5cb3a20, sk c63fca00 [ 133.865081] rfcomm:rfcomm_sock_kill: sk c63fca00 state 5 refcnt 2 [ 133.865539] rfcomm:rfcomm_sock_destruct: sk c63fca00 dlc c61ea240 Regards, Kiran On 6 June 2014 16:16, Marcel Holtmann wrote: > Hi Kiran, > > > Do not attempt to send dlci disconnect when in BT_CONFIG. > > > > This fixes a bug where shutdown() and close() on a rfcomm socket during > ACL > > connection would not cause HCI Create Connection Cancel. > > > > This is one of the number of patches from the Android AOSP common.git > tree, > > which is used on almost all Android devices. so I wanted to submit it > for > > review to see if it should go upstream. > > > > Cc: Marcel Holtmann > > Cc: Gustavo Padovan > > Cc: Johan Hedberg > > Cc: David S. Miller > > Cc: Peter Hurley > > Cc: Seung-Woo Kim > > Cc: Nick Pelly > > Cc: linux-bluetooth@vger.kernel.org > > Cc: netdev@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > Cc: Android Kernel Team > > Cc: John Stultz > > Signed-off-by: Nick Pelly > > [kiran: Added context to commit message] > > Signed-off-by: Kiran Raparthy > > --- > > net/bluetooth/rfcomm/core.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c > > index cf62026..6a531e7 100644 > > --- a/net/bluetooth/rfcomm/core.c > > +++ b/net/bluetooth/rfcomm/core.c > > @@ -456,7 +456,6 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, > int err) > > > > switch (d->state) { > > case BT_CONNECT: > > - case BT_CONFIG: > > case BT_OPEN: > > case BT_CONNECT2: > > if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) { > > you can include traces and a test program that will demonstrate this > behavior. I am hearing about this one for the first time. Nobody else has > indicated an issue like this before. > > Regards > > Marcel > > --047d7bdc80fc8bff6904fb28eedd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Marcel,
Below are the traces used by author for sub= mitting patch previously.

[=C2=A0 132.856414] rfcomm:rfcomm_sock_shutdown: sock c5cb3a20, sk =
c63fca00
[=C2=A0 132.856933] rfcomm:__rfcomm_sock_close: sk c63fca00 state 5 socket =
c5cb3a20
[=C2=A0 132.857788] rfcomm:__rfcomm_dlc_close: dlc c61ea240 state 7 dlci 38
err 0 session c63d4ba0
[=C2=A0 132.858612] rfcomm:rfcomm_send_disc: c63d4ba0 dlci 38
[=C2=A0 132.859069] rfcomm:rfcomm_send_frame: session c63d4ba0 len 4
[=C2=A0 132.859893] l2cap:l2cap_sock_sendmsg: sock c5cb38c0, sk c63fc800
[=C2=A0 132.860351] rfcomm:rfcomm_dlc_set_timer: dlc c61ea240 state 8 timeo=
ut 2000
[  133.863739] rfcomm:rfcomm_sock_release: sock c5cb3a20, sk c63fca00
[  133.864257] rfcomm:rfcomm_sock_shutdown: sock c5cb3a20, sk c63fca00
[  133.865081] rfcomm:rfcomm_sock_kill: sk c63fca00 state 5 refcnt 2
[  133.865539] rfcomm:rfcomm_sock_destruct: sk c63fca00 dlc c61ea240
<= div style>Regards,
Kiran


On 6 June 2014 16:16, Marcel H= oltmann <marcel@holtmann.org> wrote:
Hi Kiran,

> Do not attempt to send dlci disconnect when in BT_CONFIG.
>
> This fixes a bug where shutdown() and close() on a rfcomm socket durin= g ACL
> connection would not cause HCI Create Connection Cancel.
>
> This is one of the number of patches from the Android AOSP common.git = tree,
> which is used on almost all Android devices. =C2=A0so I wanted to subm= it it for
> review to see if it should go upstream.
>
> Cc: Marcel Holtmann <marcel@= holtmann.org>
> Cc: Gustavo Padovan <gustavo= @padovan.org>
> Cc: Johan Hedberg <johan= .hedberg@gmail.com>
> Cc: David S. Miller <davem@d= avemloft.net>
> Cc: Peter Hurley <peter= @hurleysoftware.com>
> Cc: Seung-Woo Kim <sw0312= .kim@samsung.com>
> Cc: Nick Pelly <npelly@google.= com>
> Cc: linux-bluetooth= @vger.kernel.org
> Cc: netdev@vger.kernel.org
> Cc:
linux-kernel@vger.= kernel.org
> Cc: Android Kernel Team <kernel-team@android.com>
> Cc: John Stultz <john.stu= ltz@linaro.org>
> Signed-off-by: Nick Pelly <npe= lly@google.com>
> [kiran: Added context to commit message]
> Signed-off-by: Kiran Raparthy <kiran.kumar@linaro.org>
> ---
> net/bluetooth/rfcomm/core.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c=
> index cf62026..6a531e7 100644
> --- a/net/bluetooth/rfcomm/core.c
> +++ b/net/bluetooth/rfcomm/core.c
> @@ -456,7 +456,6 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d= , int err)
>
> =C2=A0 =C2=A0 =C2=A0 switch (d->state) {
> =C2=A0 =C2=A0 =C2=A0 case BT_CONNECT:
> - =C2=A0 =C2=A0 case BT_CONFIG:
> =C2=A0 =C2=A0 =C2=A0 case BT_OPEN:
> =C2=A0 =C2=A0 =C2=A0 case BT_CONNECT2:
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (test_and_clear_bi= t(RFCOMM_DEFER_SETUP, &d->flags)) {

you can include traces and a test program that will demonstrate= this behavior. I am hearing about this one for the first time. Nobody else= has indicated an issue like this before.

Regards

Marcel


--047d7bdc80fc8bff6904fb28eedd--