Thread (13 messages) 13 messages, 4 authors, 2015-06-30

Re: [4.1.0-07254-gc13c810] Regression: Bluetooth not working.

From: Tedd Ho-Jeong An <hidden>
Date: 2015-06-30 18:47:35
Also in: lkml

Hi J=C3=B6rg

On Tue, 30 Jun 2015 16:58:13 +0200
J=C3=B6rg Otte [off-list ref] wrote:
quoted
Regarding the system hang issue, it looks like the problem is caused by=
 the list_del().
quoted
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
quoted
    /**
     * 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
quoted
     * 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.
quoted
I ran a quick test with a different scenarios and it looks good to me s=
o far.
quoted
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)
quoted
        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)
quoted
        while (!list_empty(&conn->users)) {
                user =3D list_first_entry(&conn->users, struct l2cap_us=
er, list);
quoted
-               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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help