linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
@ 2015-06-26  9:27 Jörg Otte
  2015-06-26  9:37 ` Marcel Holtmann
  0 siblings, 1 reply; 13+ messages in thread
From: Jörg Otte @ 2015-06-26  9:27 UTC (permalink / raw)
  To: Alexey Dobriyan, Marcel Holtmann, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List
  Cc: Linus Torvalds

Bluetooth is inoperable in current Linus tree and the
first bad commit is:

835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
Author: Alexey Dobriyan <adobriyan@gmail.com>
Date:   Wed Jun 10 20:28:33 2015 +0300

    Bluetooth: Stop sabotaging list poisoning

    list_del() poisons pointers with special values, no need to overwrite t=
hem.

    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

My BT adapter is an intel 8087:07da
I reverted that commit and this fixed the problem for me.

Thanks, J=C3=B6rg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-26  9:27 [4.1.0-07254-gc13c810] Regression: Bluetooth not working Jörg Otte
@ 2015-06-26  9:37 ` Marcel Holtmann
  2015-06-26 10:03   ` Jörg Otte
  0 siblings, 1 reply; 13+ messages in thread
From: Marcel Holtmann @ 2015-06-26  9:37 UTC (permalink / raw)
  To: Jörg Otte
  Cc: Alexey Dobriyan, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

Hi Joerg,

> Bluetooth is inoperable in current Linus tree and the
> first bad commit is:
> 
> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
> Author: Alexey Dobriyan <adobriyan@gmail.com>
> Date:   Wed Jun 10 20:28:33 2015 +0300
> 
>    Bluetooth: Stop sabotaging list poisoning
> 
>    list_del() poisons pointers with special values, no need to overwrite them.
> 
>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> 
> My BT adapter is an intel 8087:07da
> I reverted that commit and this fixed the problem for me.

today we had a patch from Tedd fixing the list initialization in the HIDP code.

diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 9070dfd6b4ad..f1a117f8cad2 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session **out, const bdaddr_t *bdaddr,
        session->conn = l2cap_conn_get(conn);
        session->user.probe = hidp_session_probe;
        session->user.remove = hidp_session_remove;
+       INIT_LIST_HEAD(&session->user.list);
        session->ctrl_sock = ctrl_sock;
        session->intr_sock = intr_sock;
        skb_queue_head_init(&session->ctrl_transmit);

Could this be fixing it for you as well?

Regards

Marcel


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-26  9:37 ` Marcel Holtmann
@ 2015-06-26 10:03   ` Jörg Otte
  2015-06-26 10:27     ` Alexey Dobriyan
  2015-06-26 14:28     ` Jörg Otte
  0 siblings, 2 replies; 13+ messages in thread
From: Jörg Otte @ 2015-06-26 10:03 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Alexey Dobriyan, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>:
> Hi Joerg,
>
>> Bluetooth is inoperable in current Linus tree and the
>> first bad commit is:
>>
>> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
>> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
>> Author: Alexey Dobriyan <adobriyan@gmail.com>
>> Date:   Wed Jun 10 20:28:33 2015 +0300
>>
>>    Bluetooth: Stop sabotaging list poisoning
>>
>>    list_del() poisons pointers with special values, no need to overwrite=
 them.
>>
>>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
>>
>> My BT adapter is an intel 8087:07da
>> I reverted that commit and this fixed the problem for me.
>
> today we had a patch from Tedd fixing the list initialization in the HIDP=
 code.
>
> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
> index 9070dfd6b4ad..f1a117f8cad2 100644
> --- a/net/bluetooth/hidp/core.c
> +++ b/net/bluetooth/hidp/core.c
> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session **out=
, const bdaddr_t *bdaddr,
>         session->conn =3D l2cap_conn_get(conn);
>         session->user.probe =3D hidp_session_probe;
>         session->user.remove =3D hidp_session_remove;
> +       INIT_LIST_HEAD(&session->user.list);
>         session->ctrl_sock =3D ctrl_sock;
>         session->intr_sock =3D intr_sock;
>         skb_queue_head_init(&session->ctrl_transmit);
>
> Could this be fixing it for you as well?
>
I will check this when I am at home in the
afternoon.

Thanks, J=C3=B6rg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-26 10:03   ` Jörg Otte
@ 2015-06-26 10:27     ` Alexey Dobriyan
  2015-06-26 14:28     ` Jörg Otte
  1 sibling, 0 replies; 13+ messages in thread
From: Alexey Dobriyan @ 2015-06-26 10:27 UTC (permalink / raw)
  To: Jörg Otte
  Cc: Marcel Holtmann, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

On Fri, Jun 26, 2015 at 1:03 PM, J=C3=B6rg Otte <jrg.otte@gmail.com> wrote:
> 2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>:

>> --- a/net/bluetooth/hidp/core.c
>> +++ b/net/bluetooth/hidp/core.c
>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session **ou=
t, const bdaddr_t *bdaddr,
>>         session->conn =3D l2cap_conn_get(conn);
>>         session->user.probe =3D hidp_session_probe;
>>         session->user.remove =3D hidp_session_remove;
>> +       INIT_LIST_HEAD(&session->user.list);

Heh, I checked every list.next/prev instance except init bit.
Sorry for the breakage.

  Alexey

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-26 10:03   ` Jörg Otte
  2015-06-26 10:27     ` Alexey Dobriyan
@ 2015-06-26 14:28     ` Jörg Otte
  2015-06-28 15:36       ` Jörg Otte
  1 sibling, 1 reply; 13+ messages in thread
From: Jörg Otte @ 2015-06-26 14:28 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Alexey Dobriyan, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

2015-06-26 12:03 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
> 2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>:
>> Hi Joerg,
>>
>>> Bluetooth is inoperable in current Linus tree and the
>>> first bad commit is:
>>>
>>> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
>>> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
>>> Author: Alexey Dobriyan <adobriyan@gmail.com>
>>> Date:   Wed Jun 10 20:28:33 2015 +0300
>>>
>>>    Bluetooth: Stop sabotaging list poisoning
>>>
>>>    list_del() poisons pointers with special values, no need to overwrit=
e them.
>>>
>>>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>>>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
>>>
>>> My BT adapter is an intel 8087:07da
>>> I reverted that commit and this fixed the problem for me.
>>
>> today we had a patch from Tedd fixing the list initialization in the HID=
P code.
>>
>> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
>> index 9070dfd6b4ad..f1a117f8cad2 100644
>> --- a/net/bluetooth/hidp/core.c
>> +++ b/net/bluetooth/hidp/core.c
>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session **ou=
t, const bdaddr_t *bdaddr,
>>         session->conn =3D l2cap_conn_get(conn);
>>         session->user.probe =3D hidp_session_probe;
>>         session->user.remove =3D hidp_session_remove;
>> +       INIT_LIST_HEAD(&session->user.list);
>>         session->ctrl_sock =3D ctrl_sock;
>>         session->intr_sock =3D intr_sock;
>>         skb_queue_head_init(&session->ctrl_transmit);
>>
>> Could this be fixing it for you as well?
>>
> I will check this when I am at home in the
> afternoon.
>

The patch works for me too.

Thanks, J=C3=B6rg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-26 14:28     ` Jörg Otte
@ 2015-06-28 15:36       ` Jörg Otte
  2015-06-28 16:09         ` Alexey Dobriyan
  0 siblings, 1 reply; 13+ messages in thread
From: Jörg Otte @ 2015-06-28 15:36 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Alexey Dobriyan, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

2015-06-26 16:28 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
> 2015-06-26 12:03 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
>> 2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>:
>>> Hi Joerg,
>>>
>>>> Bluetooth is inoperable in current Linus tree and the
>>>> first bad commit is:
>>>>
>>>> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
>>>> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
>>>> Author: Alexey Dobriyan <adobriyan@gmail.com>
>>>> Date:   Wed Jun 10 20:28:33 2015 +0300
>>>>
>>>>    Bluetooth: Stop sabotaging list poisoning
>>>>
>>>>    list_del() poisons pointers with special values, no need to overwri=
te them.
>>>>
>>>>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>>>>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
>>>>
>>>> My BT adapter is an intel 8087:07da
>>>> I reverted that commit and this fixed the problem for me.
>>>
>>> today we had a patch from Tedd fixing the list initialization in the HI=
DP code.
>>>
>>> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
>>> index 9070dfd6b4ad..f1a117f8cad2 100644
>>> --- a/net/bluetooth/hidp/core.c
>>> +++ b/net/bluetooth/hidp/core.c
>>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session **o=
ut, const bdaddr_t *bdaddr,
>>>         session->conn =3D l2cap_conn_get(conn);
>>>         session->user.probe =3D hidp_session_probe;
>>>         session->user.remove =3D hidp_session_remove;
>>> +       INIT_LIST_HEAD(&session->user.list);
>>>         session->ctrl_sock =3D ctrl_sock;
>>>         session->intr_sock =3D intr_sock;
>>>         skb_queue_head_init(&session->ctrl_transmit);
>>>
>>> Could this be fixing it for you as well?
>>>
>> I will check this when I am at home in the
>> afternoon.
>>
>
> The patch works for me too.
>
Ok, this was a little bit hasty!
I now see the following additional problems:

- System freeze on resume (occures always).
- System freeze on shutdown (occures sometimes)
- System freeze when BT-mouse is connecting (occures sometimes).

Then I can't do anything except power off.

This happens only if Bluetooth AND BT-mouse is activated.

Thanks, J=C3=B6rg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-28 15:36       ` Jörg Otte
@ 2015-06-28 16:09         ` Alexey Dobriyan
  2015-06-29  9:00           ` Jörg Otte
  0 siblings, 1 reply; 13+ messages in thread
From: Alexey Dobriyan @ 2015-06-28 16:09 UTC (permalink / raw)
  To: Jörg Otte
  Cc: Marcel Holtmann, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

On Sun, Jun 28, 2015 at 05:36:04PM +0200, Jörg Otte wrote:
> 2015-06-26 16:28 GMT+02:00 Jörg Otte <jrg.otte@gmail.com>:
> > 2015-06-26 12:03 GMT+02:00 Jörg Otte <jrg.otte@gmail.com>:
> >> 2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>:
> >>> Hi Joerg,
> >>>
> >>>> Bluetooth is inoperable in current Linus tree and the
> >>>> first bad commit is:
> >>>>
> >>>> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
> >>>> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
> >>>> Author: Alexey Dobriyan <adobriyan@gmail.com>
> >>>> Date:   Wed Jun 10 20:28:33 2015 +0300
> >>>>
> >>>>    Bluetooth: Stop sabotaging list poisoning
> >>>>
> >>>>    list_del() poisons pointers with special values, no need to overwrite them.
> >>>>
> >>>>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> >>>>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> >>>>
> >>>> My BT adapter is an intel 8087:07da
> >>>> I reverted that commit and this fixed the problem for me.
> >>>
> >>> today we had a patch from Tedd fixing the list initialization in the HIDP code.
> >>>
> >>> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
> >>> index 9070dfd6b4ad..f1a117f8cad2 100644
> >>> --- a/net/bluetooth/hidp/core.c
> >>> +++ b/net/bluetooth/hidp/core.c
> >>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session **out, const bdaddr_t *bdaddr,
> >>>         session->conn = l2cap_conn_get(conn);
> >>>         session->user.probe = hidp_session_probe;
> >>>         session->user.remove = hidp_session_remove;
> >>> +       INIT_LIST_HEAD(&session->user.list);
> >>>         session->ctrl_sock = ctrl_sock;
> >>>         session->intr_sock = intr_sock;
> >>>         skb_queue_head_init(&session->ctrl_transmit);
> >>>
> >>> Could this be fixing it for you as well?
> >>>
> >> I will check this when I am at home in the
> >> afternoon.
> >>
> >
> > The patch works for me too.
> >
> Ok, this was a little bit hasty!
> I now see the following additional problems:
> 
> - System freeze on resume (occures always).
> - System freeze on shutdown (occures sometimes)
> - System freeze when BT-mouse is connecting (occures sometimes).
> 
> Then I can't do anything except power off.
> 
> This happens only if Bluetooth AND BT-mouse is activated.

OK, what happens if you just revert only list_del patch?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-28 16:09         ` Alexey Dobriyan
@ 2015-06-29  9:00           ` Jörg Otte
  2015-06-29 10:30             ` Alexey Dobriyan
  0 siblings, 1 reply; 13+ messages in thread
From: Jörg Otte @ 2015-06-29  9:00 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: Marcel Holtmann, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

2015-06-28 18:09 GMT+02:00 Alexey Dobriyan <adobriyan@gmail.com>:
> On Sun, Jun 28, 2015 at 05:36:04PM +0200, J=C3=B6rg Otte wrote:
>> 2015-06-26 16:28 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
>> > 2015-06-26 12:03 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
>> >> 2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>:
>> >>> Hi Joerg,
>> >>>
>> >>>> Bluetooth is inoperable in current Linus tree and the
>> >>>> first bad commit is:
>> >>>>
>> >>>> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
>> >>>> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
>> >>>> Author: Alexey Dobriyan <adobriyan@gmail.com>
>> >>>> Date:   Wed Jun 10 20:28:33 2015 +0300
>> >>>>
>> >>>>    Bluetooth: Stop sabotaging list poisoning
>> >>>>
>> >>>>    list_del() poisons pointers with special values, no need to over=
write them.
>> >>>>
>> >>>>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>> >>>>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
>> >>>>
>> >>>> My BT adapter is an intel 8087:07da
>> >>>> I reverted that commit and this fixed the problem for me.
>> >>>
>> >>> today we had a patch from Tedd fixing the list initialization in the=
 HIDP code.
>> >>>
>> >>> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
>> >>> index 9070dfd6b4ad..f1a117f8cad2 100644
>> >>> --- a/net/bluetooth/hidp/core.c
>> >>> +++ b/net/bluetooth/hidp/core.c
>> >>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session =
**out, const bdaddr_t *bdaddr,
>> >>>         session->conn =3D l2cap_conn_get(conn);
>> >>>         session->user.probe =3D hidp_session_probe;
>> >>>         session->user.remove =3D hidp_session_remove;
>> >>> +       INIT_LIST_HEAD(&session->user.list);
>> >>>         session->ctrl_sock =3D ctrl_sock;
>> >>>         session->intr_sock =3D intr_sock;
>> >>>         skb_queue_head_init(&session->ctrl_transmit);
>> >>>
>> >>> Could this be fixing it for you as well?
>> >>>
>> >> I will check this when I am at home in the
>> >> afternoon.
>> >>
>> >
>> > The patch works for me too.
>> >
>> Ok, this was a little bit hasty!
>> I now see the following additional problems:
>>
>> - System freeze on resume (occures always).
>> - System freeze on shutdown (occures sometimes)
>> - System freeze when BT-mouse is connecting (occures sometimes).
>>
>> Then I can't do anything except power off.
>>
>> This happens only if Bluetooth AND BT-mouse is activated.
>
> OK, what happens if you just revert only list_del patch?

I have applied this patch:

diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 9070dfd6b4ad..f1a117f8cad2 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session
**out, const bdaddr_t *bdaddr,
        session->conn =3D l2cap_conn_get(conn);
        session->user.probe =3D hidp_session_probe;
        session->user.remove =3D hidp_session_remove;
+       INIT_LIST_HEAD(&session->user.list);
        session->ctrl_sock =3D ctrl_sock;
        session->intr_sock =3D intr_sock;
        skb_queue_head_init(&session->ctrl_transmit);

without this patch bluetooth doesn't work at all for me.

Thanks, J=C3=B6rg

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-29  9:00           ` Jörg Otte
@ 2015-06-29 10:30             ` Alexey Dobriyan
  2015-06-29 14:37               ` Jörg Otte
  0 siblings, 1 reply; 13+ messages in thread
From: Alexey Dobriyan @ 2015-06-29 10:30 UTC (permalink / raw)
  To: Jörg Otte
  Cc: Marcel Holtmann, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

On Mon, Jun 29, 2015 at 12:00 PM, J=C3=B6rg Otte <jrg.otte@gmail.com> wrote=
:
> 2015-06-28 18:09 GMT+02:00 Alexey Dobriyan <adobriyan@gmail.com>:
>> On Sun, Jun 28, 2015 at 05:36:04PM +0200, J=C3=B6rg Otte wrote:
>>> 2015-06-26 16:28 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
>>> > 2015-06-26 12:03 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
>>> >> 2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>:
>>> >>> Hi Joerg,
>>> >>>
>>> >>>> Bluetooth is inoperable in current Linus tree and the
>>> >>>> first bad commit is:
>>> >>>>
>>> >>>> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
>>> >>>> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
>>> >>>> Author: Alexey Dobriyan <adobriyan@gmail.com>
>>> >>>> Date:   Wed Jun 10 20:28:33 2015 +0300
>>> >>>>
>>> >>>>    Bluetooth: Stop sabotaging list poisoning
>>> >>>>
>>> >>>>    list_del() poisons pointers with special values, no need to ove=
rwrite them.
>>> >>>>
>>> >>>>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>>> >>>>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
>>> >>>>
>>> >>>> My BT adapter is an intel 8087:07da
>>> >>>> I reverted that commit and this fixed the problem for me.
>>> >>>
>>> >>> today we had a patch from Tedd fixing the list initialization in th=
e HIDP code.
>>> >>>
>>> >>> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
>>> >>> index 9070dfd6b4ad..f1a117f8cad2 100644
>>> >>> --- a/net/bluetooth/hidp/core.c
>>> >>> +++ b/net/bluetooth/hidp/core.c
>>> >>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session=
 **out, const bdaddr_t *bdaddr,
>>> >>>         session->conn =3D l2cap_conn_get(conn);
>>> >>>         session->user.probe =3D hidp_session_probe;
>>> >>>         session->user.remove =3D hidp_session_remove;
>>> >>> +       INIT_LIST_HEAD(&session->user.list);
>>> >>>         session->ctrl_sock =3D ctrl_sock;
>>> >>>         session->intr_sock =3D intr_sock;
>>> >>>         skb_queue_head_init(&session->ctrl_transmit);
>>> >>>
>>> >>> Could this be fixing it for you as well?
>>> >>>
>>> >> I will check this when I am at home in the
>>> >> afternoon.
>>> >>
>>> >
>>> > The patch works for me too.
>>> >
>>> Ok, this was a little bit hasty!
>>> I now see the following additional problems:
>>>
>>> - System freeze on resume (occures always).
>>> - System freeze on shutdown (occures sometimes)
>>> - System freeze when BT-mouse is connecting (occures sometimes).
>>>
>>> Then I can't do anything except power off.
>>>
>>> This happens only if Bluetooth AND BT-mouse is activated.
>>
>> OK, what happens if you just revert only list_del patch?
>
> I have applied this patch:
>
> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
> index 9070dfd6b4ad..f1a117f8cad2 100644
> --- a/net/bluetooth/hidp/core.c
> +++ b/net/bluetooth/hidp/core.c
> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session
> **out, const bdaddr_t *bdaddr,
>         session->conn =3D l2cap_conn_get(conn);
>         session->user.probe =3D hidp_session_probe;
>         session->user.remove =3D hidp_session_remove;
> +       INIT_LIST_HEAD(&session->user.list);
>         session->ctrl_sock =3D ctrl_sock;
>         session->intr_sock =3D intr_sock;
>         skb_queue_head_init(&session->ctrl_transmit);
>
> without this patch bluetooth doesn't work at all for me.

Sure.

Please drop this patch, and do

  git-revert 835a6a2f8603237a3e6cded5a6765090ecb06ea5

Maybe it's some other changes causing hangs.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-29 10:30             ` Alexey Dobriyan
@ 2015-06-29 14:37               ` Jörg Otte
  2015-06-29 21:13                 ` Tedd Ho-Jeong An
  0 siblings, 1 reply; 13+ messages in thread
From: Jörg Otte @ 2015-06-29 14:37 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: Marcel Holtmann, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

2015-06-29 12:30 GMT+02:00 Alexey Dobriyan <adobriyan@gmail.com>:
> On Mon, Jun 29, 2015 at 12:00 PM, J=C3=B6rg Otte <jrg.otte@gmail.com> wro=
te:
>> 2015-06-28 18:09 GMT+02:00 Alexey Dobriyan <adobriyan@gmail.com>:
>>> On Sun, Jun 28, 2015 at 05:36:04PM +0200, J=C3=B6rg Otte wrote:
>>>> 2015-06-26 16:28 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
>>>> > 2015-06-26 12:03 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
>>>> >> 2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>:
>>>> >>> Hi Joerg,
>>>> >>>
>>>> >>>> Bluetooth is inoperable in current Linus tree and the
>>>> >>>> first bad commit is:
>>>> >>>>
>>>> >>>> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
>>>> >>>> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
>>>> >>>> Author: Alexey Dobriyan <adobriyan@gmail.com>
>>>> >>>> Date:   Wed Jun 10 20:28:33 2015 +0300
>>>> >>>>
>>>> >>>>    Bluetooth: Stop sabotaging list poisoning
>>>> >>>>
>>>> >>>>    list_del() poisons pointers with special values, no need to ov=
erwrite them.
>>>> >>>>
>>>> >>>>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>>>> >>>>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
>>>> >>>>
>>>> >>>> My BT adapter is an intel 8087:07da
>>>> >>>> I reverted that commit and this fixed the problem for me.
>>>> >>>
>>>> >>> today we had a patch from Tedd fixing the list initialization in t=
he HIDP code.
>>>> >>>
>>>> >>> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
>>>> >>> index 9070dfd6b4ad..f1a117f8cad2 100644
>>>> >>> --- a/net/bluetooth/hidp/core.c
>>>> >>> +++ b/net/bluetooth/hidp/core.c
>>>> >>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_sessio=
n **out, const bdaddr_t *bdaddr,
>>>> >>>         session->conn =3D l2cap_conn_get(conn);
>>>> >>>         session->user.probe =3D hidp_session_probe;
>>>> >>>         session->user.remove =3D hidp_session_remove;
>>>> >>> +       INIT_LIST_HEAD(&session->user.list);
>>>> >>>         session->ctrl_sock =3D ctrl_sock;
>>>> >>>         session->intr_sock =3D intr_sock;
>>>> >>>         skb_queue_head_init(&session->ctrl_transmit);
>>>> >>>
>>>> >>> Could this be fixing it for you as well?
>>>> >>>
>>>> >> I will check this when I am at home in the
>>>> >> afternoon.
>>>> >>
>>>> >
>>>> > The patch works for me too.
>>>> >
>>>> Ok, this was a little bit hasty!
>>>> I now see the following additional problems:
>>>>
>>>> - System freeze on resume (occures always).
>>>> - System freeze on shutdown (occures sometimes)
>>>> - System freeze when BT-mouse is connecting (occures sometimes).
>>>>
>>>> Then I can't do anything except power off.
>>>>
>>>> This happens only if Bluetooth AND BT-mouse is activated.
>>>
>>> OK, what happens if you just revert only list_del patch?
>>
>> I have applied this patch:
>>
>> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
>> index 9070dfd6b4ad..f1a117f8cad2 100644
>> --- a/net/bluetooth/hidp/core.c
>> +++ b/net/bluetooth/hidp/core.c
>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session
>> **out, const bdaddr_t *bdaddr,
>>         session->conn =3D l2cap_conn_get(conn);
>>         session->user.probe =3D hidp_session_probe;
>>         session->user.remove =3D hidp_session_remove;
>> +       INIT_LIST_HEAD(&session->user.list);
>>         session->ctrl_sock =3D ctrl_sock;
>>         session->intr_sock =3D intr_sock;
>>         skb_queue_head_init(&session->ctrl_transmit);
>>
>> without this patch bluetooth doesn't work at all for me.
>
> Sure.
>
> Please drop this patch, and do
>
>   git-revert 835a6a2f8603237a3e6cded5a6765090ecb06ea5
>
> Maybe it's some other changes causing hangs.

Looks good so far. The system freeze on resume is gone.

Thanks, J=C3=B6rg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-29 14:37               ` Jörg Otte
@ 2015-06-29 21:13                 ` Tedd Ho-Jeong An
  2015-06-30 14:58                   ` Jörg Otte
  0 siblings, 1 reply; 13+ messages in thread
From: Tedd Ho-Jeong An @ 2015-06-29 21:13 UTC (permalink / raw)
  To: Jörg Otte
  Cc: Alexey Dobriyan, Marcel Holtmann, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

Hi Jorg

On Mon, 29 Jun 2015 16:37:32 +0200
J=C3=B6rg Otte <jrg.otte@gmail.com> wrote:

> 2015-06-29 12:30 GMT+02:00 Alexey Dobriyan <adobriyan@gmail.com>:
> > On Mon, Jun 29, 2015 at 12:00 PM, J=C3=B6rg Otte <jrg.otte@gmail.com> w=
rote:
> >> 2015-06-28 18:09 GMT+02:00 Alexey Dobriyan <adobriyan@gmail.com>:
> >>> On Sun, Jun 28, 2015 at 05:36:04PM +0200, J=C3=B6rg Otte wrote:
> >>>> 2015-06-26 16:28 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
> >>>> > 2015-06-26 12:03 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
> >>>> >> 2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>:
> >>>> >>> Hi Joerg,
> >>>> >>>
> >>>> >>>> Bluetooth is inoperable in current Linus tree and the
> >>>> >>>> first bad commit is:
> >>>> >>>>
> >>>> >>>> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad commit
> >>>> >>>> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
> >>>> >>>> Author: Alexey Dobriyan <adobriyan@gmail.com>
> >>>> >>>> Date:   Wed Jun 10 20:28:33 2015 +0300
> >>>> >>>>
> >>>> >>>>    Bluetooth: Stop sabotaging list poisoning
> >>>> >>>>
> >>>> >>>>    list_del() poisons pointers with special values, no need to =
overwrite them.
> >>>> >>>>
> >>>> >>>>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> >>>> >>>>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> >>>> >>>>
> >>>> >>>> My BT adapter is an intel 8087:07da
> >>>> >>>> I reverted that commit and this fixed the problem for me.
> >>>> >>>
> >>>> >>> today we had a patch from Tedd fixing the list initialization in=
 the HIDP code.
> >>>> >>>
> >>>> >>> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core=
.c
> >>>> >>> index 9070dfd6b4ad..f1a117f8cad2 100644
> >>>> >>> --- a/net/bluetooth/hidp/core.c
> >>>> >>> +++ b/net/bluetooth/hidp/core.c
> >>>> >>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_sess=
ion **out, const bdaddr_t *bdaddr,
> >>>> >>>         session->conn =3D l2cap_conn_get(conn);
> >>>> >>>         session->user.probe =3D hidp_session_probe;
> >>>> >>>         session->user.remove =3D hidp_session_remove;
> >>>> >>> +       INIT_LIST_HEAD(&session->user.list);
> >>>> >>>         session->ctrl_sock =3D ctrl_sock;
> >>>> >>>         session->intr_sock =3D intr_sock;
> >>>> >>>         skb_queue_head_init(&session->ctrl_transmit);
> >>>> >>>
> >>>> >>> Could this be fixing it for you as well?
> >>>> >>>
> >>>> >> I will check this when I am at home in the
> >>>> >> afternoon.
> >>>> >>
> >>>> >
> >>>> > The patch works for me too.
> >>>> >
> >>>> Ok, this was a little bit hasty!
> >>>> I now see the following additional problems:
> >>>>
> >>>> - System freeze on resume (occures always).
> >>>> - System freeze on shutdown (occures sometimes)
> >>>> - System freeze when BT-mouse is connecting (occures sometimes).
> >>>>
> >>>> Then I can't do anything except power off.
> >>>>
> >>>> This happens only if Bluetooth AND BT-mouse is activated.
> >>>
> >>> OK, what happens if you just revert only list_del patch?
> >>
> >> I have applied this patch:
> >>
> >> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
> >> index 9070dfd6b4ad..f1a117f8cad2 100644
> >> --- a/net/bluetooth/hidp/core.c
> >> +++ b/net/bluetooth/hidp/core.c
> >> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session
> >> **out, const bdaddr_t *bdaddr,
> >>         session->conn =3D l2cap_conn_get(conn);
> >>         session->user.probe =3D hidp_session_probe;
> >>         session->user.remove =3D hidp_session_remove;
> >> +       INIT_LIST_HEAD(&session->user.list);
> >>         session->ctrl_sock =3D ctrl_sock;
> >>         session->intr_sock =3D intr_sock;
> >>         skb_queue_head_init(&session->ctrl_transmit);
> >>
> >> without this patch bluetooth doesn't work at all for me.
> >
> > Sure.
> >
> > Please drop this patch, and do
> >
> >   git-revert 835a6a2f8603237a3e6cded5a6765090ecb06ea5
> >
> > Maybe it's some other changes causing hangs.
>=20
> Looks good so far. The system freeze on resume is gone.
>=20
> Thanks, J=C3=B6rg

Regarding the system hang issue, it looks like the problem is caused by the=
 list_del().
According to the list.h, this macro puts the entry into invalid state and i=
t causes the device hang in the l2cap_core.c

    /**
     * list_del - deletes entry from list.
     * @entry: the element to delete from the list.
     * Note: list_empty() on entry does not return true after this, the ent=
ry is
     * in an undefined state.
     */
   =20
So, one way to fix this issue is using the list_del_init() instead.

Can you try this patch to see if it resolve the issue? No need to revert an=
y patch.
I ran a quick test with a different scenarios and it looks good to me so fa=
r.

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 51594fb..45fffa4 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1634,7 +1634,7 @@ void l2cap_unregister_user(struct l2cap_conn *conn, s=
truct l2cap_user *user)
        if (list_empty(&user->list))
                goto out_unlock;
=20
-       list_del(&user->list);
+       list_del_init(&user->list);
        user->remove(conn, user);
=20
 out_unlock:
@@ -1648,7 +1648,7 @@ static void l2cap_unregister_all_users(struct l2cap_c=
onn *conn)
=20
        while (!list_empty(&conn->users)) {
                user =3D list_first_entry(&conn->users, struct l2cap_user, =
list);
-               list_del(&user->list);
+               list_del_init(&user->list);
                user->remove(conn, user);
        }
 }

Regards,
Tedd Ho-Jeong An

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-29 21:13                 ` Tedd Ho-Jeong An
@ 2015-06-30 14:58                   ` Jörg Otte
  2015-06-30 18:47                     ` Tedd Ho-Jeong An
  0 siblings, 1 reply; 13+ messages in thread
From: Jörg Otte @ 2015-06-30 14:58 UTC (permalink / raw)
  To: Tedd Ho-Jeong An
  Cc: Alexey Dobriyan, Marcel Holtmann, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

2015-06-29 23:13 GMT+02:00 Tedd Ho-Jeong An <tedd.an@intel.com>:
> Hi Jorg
>
> On Mon, 29 Jun 2015 16:37:32 +0200
> J=C3=B6rg Otte <jrg.otte@gmail.com> wrote:
>
>> 2015-06-29 12:30 GMT+02:00 Alexey Dobriyan <adobriyan@gmail.com>:
>> > On Mon, Jun 29, 2015 at 12:00 PM, J=C3=B6rg Otte <jrg.otte@gmail.com> =
wrote:
>> >> 2015-06-28 18:09 GMT+02:00 Alexey Dobriyan <adobriyan@gmail.com>:
>> >>> On Sun, Jun 28, 2015 at 05:36:04PM +0200, J=C3=B6rg Otte wrote:
>> >>>> 2015-06-26 16:28 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
>> >>>> > 2015-06-26 12:03 GMT+02:00 J=C3=B6rg Otte <jrg.otte@gmail.com>:
>> >>>> >> 2015-06-26 11:37 GMT+02:00 Marcel Holtmann <marcel@holtmann.org>=
:
>> >>>> >>> Hi Joerg,
>> >>>> >>>
>> >>>> >>>> Bluetooth is inoperable in current Linus tree and the
>> >>>> >>>> first bad commit is:
>> >>>> >>>>
>> >>>> >>>> 835a6a2f8603237a3e6cded5a6765090ecb06ea5 is the first bad comm=
it
>> >>>> >>>> commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5
>> >>>> >>>> Author: Alexey Dobriyan <adobriyan@gmail.com>
>> >>>> >>>> Date:   Wed Jun 10 20:28:33 2015 +0300
>> >>>> >>>>
>> >>>> >>>>    Bluetooth: Stop sabotaging list poisoning
>> >>>> >>>>
>> >>>> >>>>    list_del() poisons pointers with special values, no need to=
 overwrite them.
>> >>>> >>>>
>> >>>> >>>>    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>> >>>> >>>>    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
>> >>>> >>>>
>> >>>> >>>> My BT adapter is an intel 8087:07da
>> >>>> >>>> I reverted that commit and this fixed the problem for me.
>> >>>> >>>
>> >>>> >>> today we had a patch from Tedd fixing the list initialization i=
n the HIDP code.
>> >>>> >>>
>> >>>> >>> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/cor=
e.c
>> >>>> >>> index 9070dfd6b4ad..f1a117f8cad2 100644
>> >>>> >>> --- a/net/bluetooth/hidp/core.c
>> >>>> >>> +++ b/net/bluetooth/hidp/core.c
>> >>>> >>> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_ses=
sion **out, const bdaddr_t *bdaddr,
>> >>>> >>>         session->conn =3D l2cap_conn_get(conn);
>> >>>> >>>         session->user.probe =3D hidp_session_probe;
>> >>>> >>>         session->user.remove =3D hidp_session_remove;
>> >>>> >>> +       INIT_LIST_HEAD(&session->user.list);
>> >>>> >>>         session->ctrl_sock =3D ctrl_sock;
>> >>>> >>>         session->intr_sock =3D intr_sock;
>> >>>> >>>         skb_queue_head_init(&session->ctrl_transmit);
>> >>>> >>>
>> >>>> >>> Could this be fixing it for you as well?
>> >>>> >>>
>> >>>> >> I will check this when I am at home in the
>> >>>> >> afternoon.
>> >>>> >>
>> >>>> >
>> >>>> > The patch works for me too.
>> >>>> >
>> >>>> Ok, this was a little bit hasty!
>> >>>> I now see the following additional problems:
>> >>>>
>> >>>> - System freeze on resume (occures always).
>> >>>> - System freeze on shutdown (occures sometimes)
>> >>>> - System freeze when BT-mouse is connecting (occures sometimes).
>> >>>>
>> >>>> Then I can't do anything except power off.
>> >>>>
>> >>>> This happens only if Bluetooth AND BT-mouse is activated.
>> >>>
>> >>> OK, what happens if you just revert only list_del patch?
>> >>
>> >> I have applied this patch:
>> >>
>> >> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
>> >> index 9070dfd6b4ad..f1a117f8cad2 100644
>> >> --- a/net/bluetooth/hidp/core.c
>> >> +++ b/net/bluetooth/hidp/core.c
>> >> @@ -915,6 +915,7 @@ static int hidp_session_new(struct hidp_session
>> >> **out, const bdaddr_t *bdaddr,
>> >>         session->conn =3D l2cap_conn_get(conn);
>> >>         session->user.probe =3D hidp_session_probe;
>> >>         session->user.remove =3D hidp_session_remove;
>> >> +       INIT_LIST_HEAD(&session->user.list);
>> >>         session->ctrl_sock =3D ctrl_sock;
>> >>         session->intr_sock =3D intr_sock;
>> >>         skb_queue_head_init(&session->ctrl_transmit);
>> >>
>> >> without this patch bluetooth doesn't work at all for me.
>> >
>> > Sure.
>> >
>> > Please drop this patch, and do
>> >
>> >   git-revert 835a6a2f8603237a3e6cded5a6765090ecb06ea5
>> >
>> > Maybe it's some other changes causing hangs.
>>
>> Looks good so far. The system freeze on resume is gone.
>>
>> Thanks, J=C3=B6rg
>
> Regarding the system hang issue, it looks like the problem is caused by t=
he list_del().
> According to the list.h, this macro puts the entry into invalid state and=
 it causes the device hang in the l2cap_core.c
>
>     /**
>      * list_del - deletes entry from list.
>      * @entry: the element to delete from the list.
>      * Note: list_empty() on entry does not return true after this, the e=
ntry is
>      * in an undefined state.
>      */
>
> So, one way to fix this issue is using the list_del_init() instead.
>
> Can you try this patch to see if it resolve the issue? No need to revert =
any patch.
> I ran a quick test with a different scenarios and it looks good to me so =
far.
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index 51594fb..45fffa4 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -1634,7 +1634,7 @@ void l2cap_unregister_user(struct l2cap_conn *conn,=
 struct l2cap_user *user)
>         if (list_empty(&user->list))
>                 goto out_unlock;
>
> -       list_del(&user->list);
> +       list_del_init(&user->list);
>         user->remove(conn, user);
>
>  out_unlock:
> @@ -1648,7 +1648,7 @@ static void l2cap_unregister_all_users(struct l2cap=
_conn *conn)
>
>         while (!list_empty(&conn->users)) {
>                 user =3D list_first_entry(&conn->users, struct l2cap_user=
, list);
> -               list_del(&user->list);
> +               list_del_init(&user->list);
>                 user->remove(conn, user);
>         }
>  }
>
> Regards,
> Tedd Ho-Jeong An

I now have both patche applied and no revert. Looks good so far.

Thanks, J=C3=B6rg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.
  2015-06-30 14:58                   ` Jörg Otte
@ 2015-06-30 18:47                     ` Tedd Ho-Jeong An
  0 siblings, 0 replies; 13+ messages in thread
From: Tedd Ho-Jeong An @ 2015-06-30 18:47 UTC (permalink / raw)
  To: Jörg Otte
  Cc: Alexey Dobriyan, Marcel Holtmann, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	inux Kernel Mailing List, Linus Torvalds

Hi J=C3=B6rg

On Tue, 30 Jun 2015 16:58:13 +0200
J=C3=B6rg Otte <jrg.otte@gmail.com> wrote:

> > Regarding the system hang issue, it looks like the problem is caused by=
 the list_del().
> > According to the list.h, this macro puts the entry into invalid state a=
nd it causes the device hang in the l2cap_core.c
> >
> >     /**
> >      * list_del - deletes entry from list.
> >      * @entry: the element to delete from the list.
> >      * Note: list_empty() on entry does not return true after this, the=
 entry is
> >      * in an undefined state.
> >      */
> >
> > So, one way to fix this issue is using the list_del_init() instead.
> >
> > Can you try this patch to see if it resolve the issue? No need to rever=
t any patch.
> > I ran a quick test with a different scenarios and it looks good to me s=
o far.
> >
> > diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> > index 51594fb..45fffa4 100644
> > --- a/net/bluetooth/l2cap_core.c
> > +++ b/net/bluetooth/l2cap_core.c
> > @@ -1634,7 +1634,7 @@ void l2cap_unregister_user(struct l2cap_conn *con=
n, struct l2cap_user *user)
> >         if (list_empty(&user->list))
> >                 goto out_unlock;
> >
> > -       list_del(&user->list);
> > +       list_del_init(&user->list);
> >         user->remove(conn, user);
> >
> >  out_unlock:
> > @@ -1648,7 +1648,7 @@ static void l2cap_unregister_all_users(struct l2c=
ap_conn *conn)
> >
> >         while (!list_empty(&conn->users)) {
> >                 user =3D list_first_entry(&conn->users, struct l2cap_us=
er, list);
> > -               list_del(&user->list);
> > +               list_del_init(&user->list);
> >                 user->remove(conn, user);
> >         }
> >  }
> >
> > Regards,
> > Tedd Ho-Jeong An
>=20
> I now have both patche applied and no revert. Looks good so far.
>=20
> Thanks, J=C3=B6rg

Thanks for testing the patch. I submitted the patch just in case.
Now, I am tossing the ball to Marcel. :)

Regards,
Tedd

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-06-30 18:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-26  9:27 [4.1.0-07254-gc13c810] Regression: Bluetooth not working Jörg Otte
2015-06-26  9:37 ` Marcel Holtmann
2015-06-26 10:03   ` Jörg Otte
2015-06-26 10:27     ` Alexey Dobriyan
2015-06-26 14:28     ` Jörg Otte
2015-06-28 15:36       ` Jörg Otte
2015-06-28 16:09         ` Alexey Dobriyan
2015-06-29  9:00           ` Jörg Otte
2015-06-29 10:30             ` Alexey Dobriyan
2015-06-29 14:37               ` Jörg Otte
2015-06-29 21:13                 ` Tedd Ho-Jeong An
2015-06-30 14:58                   ` Jörg Otte
2015-06-30 18:47                     ` Tedd Ho-Jeong An

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).