aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-11-13 07:37:50 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-11-14 19:53:27 -0500
commit49d1174130df596fcfec3b6a56dce8aa5b997f2d (patch)
tree2a7e2a11f948e14d25fe9041e4b1f2482630daf4 /net/bluetooth/l2cap_sock.c
parentd88b5bbf1a985c338967f3c41351b32b747a55fe (diff)
Bluetooth: Add debug logs to help track locking issues
This patch adds some extra debug logs to L2CAP related code. These are mainly to help track locking issues but will probably be useful for debugging other types of issues as well. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index a5aa9f92b5e2..b0efb7202957 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1102,6 +1102,8 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
1102 chan = l2cap_pi(sk)->chan; 1102 chan = l2cap_pi(sk)->chan;
1103 conn = chan->conn; 1103 conn = chan->conn;
1104 1104
1105 BT_DBG("chan %p state %s", chan, state_to_string(chan->state));
1106
1105 if (conn) 1107 if (conn)
1106 mutex_lock(&conn->chan_lock); 1108 mutex_lock(&conn->chan_lock);
1107 1109
@@ -1159,12 +1161,16 @@ static void l2cap_sock_cleanup_listen(struct sock *parent)
1159{ 1161{
1160 struct sock *sk; 1162 struct sock *sk;
1161 1163
1162 BT_DBG("parent %p", parent); 1164 BT_DBG("parent %p state %s", parent,
1165 state_to_string(parent->sk_state));
1163 1166
1164 /* Close not yet accepted channels */ 1167 /* Close not yet accepted channels */
1165 while ((sk = bt_accept_dequeue(parent, NULL))) { 1168 while ((sk = bt_accept_dequeue(parent, NULL))) {
1166 struct l2cap_chan *chan = l2cap_pi(sk)->chan; 1169 struct l2cap_chan *chan = l2cap_pi(sk)->chan;
1167 1170
1171 BT_DBG("child chan %p state %s", chan,
1172 state_to_string(chan->state));
1173
1168 l2cap_chan_lock(chan); 1174 l2cap_chan_lock(chan);
1169 __clear_chan_timer(chan); 1175 __clear_chan_timer(chan);
1170 l2cap_chan_close(chan, ECONNRESET); 1176 l2cap_chan_close(chan, ECONNRESET);
@@ -1252,6 +1258,8 @@ static void l2cap_sock_teardown_cb(struct l2cap_chan *chan, int err)
1252 struct sock *sk = chan->data; 1258 struct sock *sk = chan->data;
1253 struct sock *parent; 1259 struct sock *parent;
1254 1260
1261 BT_DBG("chan %p state %s", chan, state_to_string(chan->state));
1262
1255 /* This callback can be called both for server (BT_LISTEN) 1263 /* This callback can be called both for server (BT_LISTEN)
1256 * sockets as well as "normal" ones. To avoid lockdep warnings 1264 * sockets as well as "normal" ones. To avoid lockdep warnings
1257 * with child socket locking (through l2cap_sock_cleanup_listen) 1265 * with child socket locking (through l2cap_sock_cleanup_listen)