* [PATCH 3/3] Bluetooth: Remove l2cap_sk_list
From: Gustavo F. Padovan @ 2011-04-27 21:49 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1303940957-22694-2-git-send-email-padovan@profusion.mobi>
A new list was added to replace the socket based one. This new list
doesn't depent on sock and then fits better inside l2cap_core.c code.
It also rename l2cap_chan_alloc() to l2cap_chan_create() and
l2cap_chan_free() to l2cap_chan_destruct()
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
include/net/bluetooth/l2cap.h | 6 +-
net/bluetooth/l2cap_core.c | 165 ++++++++++++++++++++++-------------------
net/bluetooth/l2cap_sock.c | 6 +-
3 files changed, 95 insertions(+), 82 deletions(-)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index fb3f90e..2ba675c 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -350,6 +350,7 @@ struct l2cap_chan {
struct list_head srej_l;
struct list_head list;
+ struct list_head global_l;
};
struct l2cap_conn {
@@ -441,7 +442,6 @@ static inline int l2cap_tx_window_full(struct l2cap_chan *ch)
#define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START)
extern int disable_ertm;
-extern struct bt_sock_list l2cap_sk_list;
int l2cap_init_sockets(void);
void l2cap_cleanup_sockets(void);
@@ -469,9 +469,9 @@ void l2cap_sock_init(struct sock *sk, struct sock *parent);
struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
int proto, gfp_t prio);
void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err);
-struct l2cap_chan *l2cap_chan_alloc(struct sock *sk);
+struct l2cap_chan *l2cap_chan_create(struct sock *sk);
void l2cap_chan_del(struct l2cap_chan *chan, int err);
-void l2cap_chan_free(struct l2cap_chan *chan);
+void l2cap_chan_destruct(struct l2cap_chan *chan);
int l2cap_chan_connect(struct l2cap_chan *chan);
#endif /* __L2CAP_H */
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 9e3f64f..c1d08f1 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -62,9 +62,8 @@ static u8 l2cap_fixed_chan[8] = { 0x02, };
static struct workqueue_struct *_busy_wq;
-struct bt_sock_list l2cap_sk_list = {
- .lock = __RW_LOCK_UNLOCKED(l2cap_sk_list.lock)
-};
+LIST_HEAD(chan_list);
+DEFINE_RWLOCK(chan_list_lock);
static void l2cap_busy_work(struct work_struct *work);
@@ -135,29 +134,27 @@ static inline struct l2cap_chan *l2cap_get_chan_by_ident(struct l2cap_conn *conn
return c;
}
-static struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src)
+static struct l2cap_chan *__l2cap_global_chan_by_addr(__le16 psm, bdaddr_t *src)
{
- struct sock *sk;
- struct hlist_node *node;
- sk_for_each(sk, node, &l2cap_sk_list.head) {
- struct l2cap_chan *chan = l2cap_pi(sk)->chan;
+ struct l2cap_chan *c;
- if (chan->sport == psm && !bacmp(&bt_sk(sk)->src, src))
+ list_for_each_entry(c, &chan_list, global_l) {
+ if (c->sport == psm && !bacmp(&bt_sk(c->sk)->src, src))
goto found;
}
- sk = NULL;
+ c = NULL;
found:
- return sk;
+ return c;
}
int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm)
{
int err;
- write_lock_bh(&l2cap_sk_list.lock);
+ write_lock_bh(&chan_list_lock);
- if (psm && __l2cap_get_sock_by_addr(psm, src)) {
+ if (psm && __l2cap_global_chan_by_addr(psm, src)) {
err = -EADDRINUSE;
goto done;
}
@@ -171,7 +168,7 @@ int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm)
err = -EINVAL;
for (p = 0x1001; p < 0x1100; p += 2)
- if (!__l2cap_get_sock_by_addr(cpu_to_le16(p), src)) {
+ if (!__l2cap_global_chan_by_addr(cpu_to_le16(p), src)) {
chan->psm = cpu_to_le16(p);
chan->sport = cpu_to_le16(p);
err = 0;
@@ -180,17 +177,17 @@ int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm)
}
done:
- write_unlock_bh(&l2cap_sk_list.lock);
+ write_unlock_bh(&chan_list_lock);
return err;
}
int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid)
{
- write_lock_bh(&l2cap_sk_list.lock);
+ write_lock_bh(&chan_list_lock);
chan->scid = scid;
- write_unlock_bh(&l2cap_sk_list.lock);
+ write_unlock_bh(&chan_list_lock);
return 0;
}
@@ -207,7 +204,7 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn)
return 0;
}
-struct l2cap_chan *l2cap_chan_alloc(struct sock *sk)
+struct l2cap_chan *l2cap_chan_create(struct sock *sk)
{
struct l2cap_chan *chan;
@@ -217,11 +214,19 @@ struct l2cap_chan *l2cap_chan_alloc(struct sock *sk)
chan->sk = sk;
+ write_lock_bh(&chan_list_lock);
+ list_add(&chan->global_l, &chan_list);
+ write_unlock_bh(&chan_list_lock);
+
return chan;
}
-void l2cap_chan_free(struct l2cap_chan *chan)
+void l2cap_chan_destruct(struct l2cap_chan *chan)
{
+ write_lock_bh(&chan_list_lock);
+ list_del(&chan->global_l);
+ write_unlock_bh(&chan_list_lock);
+
kfree(chan);
}
@@ -651,48 +656,51 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
/* Find socket with cid and source bdaddr.
* Returns closest match, locked.
*/
-static struct sock *l2cap_get_sock_by_scid(int state, __le16 cid, bdaddr_t *src)
+static struct l2cap_chan *l2cap_global_chan_by_scid(int state, __le16 cid, bdaddr_t *src)
{
- struct sock *sk = NULL, *sk1 = NULL;
- struct hlist_node *node;
+ struct l2cap_chan *c, *c1 = NULL;
- read_lock(&l2cap_sk_list.lock);
+ read_lock(&chan_list_lock);
- sk_for_each(sk, node, &l2cap_sk_list.head) {
- struct l2cap_chan *chan = l2cap_pi(sk)->chan;
+ list_for_each_entry(c, &chan_list, global_l) {
+ struct sock *sk = c->sk;
if (state && sk->sk_state != state)
continue;
- if (chan->scid == cid) {
+ if (c->scid == cid) {
/* Exact match. */
- if (!bacmp(&bt_sk(sk)->src, src))
- break;
+ if (!bacmp(&bt_sk(sk)->src, src)) {
+ read_unlock(&chan_list_lock);
+ return c;
+ }
/* Closest match */
if (!bacmp(&bt_sk(sk)->src, BDADDR_ANY))
- sk1 = sk;
+ c1 = c;
}
}
- read_unlock(&l2cap_sk_list.lock);
+ read_unlock(&chan_list_lock);
- return node ? sk : sk1;
+ return c1;
}
static void l2cap_le_conn_ready(struct l2cap_conn *conn)
{
struct sock *parent, *sk;
- struct l2cap_chan *chan;
+ struct l2cap_chan *chan, *pchan;
BT_DBG("");
/* Check if we have socket listening on cid */
- parent = l2cap_get_sock_by_scid(BT_LISTEN, L2CAP_CID_LE_DATA,
+ pchan = l2cap_global_chan_by_scid(BT_LISTEN, L2CAP_CID_LE_DATA,
conn->src);
- if (!parent)
+ if (!pchan)
return;
+ parent = pchan->sk;
+
bh_lock_sock(parent);
/* Check for backlog size */
@@ -705,7 +713,7 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn)
if (!sk)
goto clean;
- chan = l2cap_chan_alloc(sk);
+ chan = l2cap_chan_create(sk);
if (!chan) {
l2cap_sock_kill(sk);
goto clean;
@@ -883,33 +891,34 @@ static inline void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *ch
/* Find socket with psm and source bdaddr.
* Returns closest match.
*/
-static struct sock *l2cap_get_sock_by_psm(int state, __le16 psm, bdaddr_t *src)
+static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm, bdaddr_t *src)
{
- struct sock *sk = NULL, *sk1 = NULL;
- struct hlist_node *node;
+ struct l2cap_chan *c, *c1 = NULL;
- read_lock(&l2cap_sk_list.lock);
+ read_lock(&chan_list_lock);
- sk_for_each(sk, node, &l2cap_sk_list.head) {
- struct l2cap_chan *chan = l2cap_pi(sk)->chan;
+ list_for_each_entry(c, &chan_list, global_l) {
+ struct sock *sk = c->sk;
if (state && sk->sk_state != state)
continue;
- if (chan->psm == psm) {
+ if (c->psm == psm) {
/* Exact match. */
- if (!bacmp(&bt_sk(sk)->src, src))
- break;
+ if (!bacmp(&bt_sk(sk)->src, src)) {
+ read_unlock_bh(&chan_list_lock);
+ return c;
+ }
/* Closest match */
if (!bacmp(&bt_sk(sk)->src, BDADDR_ANY))
- sk1 = sk;
+ c1 = c;
}
}
- read_unlock(&l2cap_sk_list.lock);
+ read_unlock(&chan_list_lock);
- return node ? sk : sk1;
+ return c1;
}
int l2cap_chan_connect(struct l2cap_chan *chan)
@@ -2079,22 +2088,26 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
{
struct l2cap_conn_req *req = (struct l2cap_conn_req *) data;
struct l2cap_conn_rsp rsp;
- struct l2cap_chan *chan = NULL;
+ struct l2cap_chan *chan = NULL, *pchan;
struct sock *parent, *sk = NULL;
int result, status = L2CAP_CS_NO_INFO;
u16 dcid = 0, scid = __le16_to_cpu(req->scid);
__le16 psm = req->psm;
- BT_DBG("psm 0x%2.2x scid 0x%4.4x", psm, scid);
+ BT_ERR("psm 0x%2.2x scid 0x%4.4x", psm, scid);
/* Check if we have socket listening on psm */
- parent = l2cap_get_sock_by_psm(BT_LISTEN, psm, conn->src);
- if (!parent) {
+ pchan = l2cap_global_chan_by_psm(BT_LISTEN, psm, conn->src);
+ if (!pchan) {
result = L2CAP_CR_BAD_PSM;
goto sendresp;
}
+ BT_ERR("%p 0x%2.2x", pchan, pchan->psm);
+
+ parent = pchan->sk;
+
bh_lock_sock(parent);
/* Check if the ACL is secure enough (if not SDP) */
@@ -2117,7 +2130,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
if (!sk)
goto response;
- chan = l2cap_chan_alloc(sk);
+ chan = l2cap_chan_create(sk);
if (!chan) {
l2cap_sock_kill(sk);
goto response;
@@ -3745,11 +3758,14 @@ done:
static inline int l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm, struct sk_buff *skb)
{
struct sock *sk;
+ struct l2cap_chan *chan;
- sk = l2cap_get_sock_by_psm(0, psm, conn->src);
- if (!sk)
+ chan = l2cap_global_chan_by_psm(0, psm, conn->src);
+ if (!chan)
goto drop;
+ sk = chan->sk;
+
bh_lock_sock(sk);
BT_DBG("sk %p, len %d", sk, skb->len);
@@ -3775,11 +3791,14 @@ done:
static inline int l2cap_att_channel(struct l2cap_conn *conn, __le16 cid, struct sk_buff *skb)
{
struct sock *sk;
+ struct l2cap_chan *chan;
- sk = l2cap_get_sock_by_scid(0, cid, conn->src);
- if (!sk)
+ chan = l2cap_global_chan_by_scid(0, cid, conn->src);
+ if (!chan)
goto drop;
+ sk = chan->sk;
+
bh_lock_sock(sk);
BT_DBG("sk %p, len %d", sk, skb->len);
@@ -3846,8 +3865,7 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb)
static int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type)
{
int exact = 0, lm1 = 0, lm2 = 0;
- register struct sock *sk;
- struct hlist_node *node;
+ struct l2cap_chan *c;
if (type != ACL_LINK)
return -EINVAL;
@@ -3855,25 +3873,25 @@ static int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type)
BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr));
/* Find listening sockets and check their link_mode */
- read_lock(&l2cap_sk_list.lock);
- sk_for_each(sk, node, &l2cap_sk_list.head) {
- struct l2cap_chan *chan = l2cap_pi(sk)->chan;
+ read_lock(&chan_list_lock);
+ list_for_each_entry(c, &chan_list, global_l) {
+ struct sock *sk = c->sk;
if (sk->sk_state != BT_LISTEN)
continue;
if (!bacmp(&bt_sk(sk)->src, &hdev->bdaddr)) {
lm1 |= HCI_LM_ACCEPT;
- if (chan->role_switch)
+ if (c->role_switch)
lm1 |= HCI_LM_MASTER;
exact++;
} else if (!bacmp(&bt_sk(sk)->src, BDADDR_ANY)) {
lm2 |= HCI_LM_ACCEPT;
- if (chan->role_switch)
+ if (c->role_switch)
lm2 |= HCI_LM_MASTER;
}
}
- read_unlock(&l2cap_sk_list.lock);
+ read_unlock(&chan_list_lock);
return exact ? lm1 : lm2;
}
@@ -4126,25 +4144,22 @@ drop:
static int l2cap_debugfs_show(struct seq_file *f, void *p)
{
- struct sock *sk;
- struct hlist_node *node;
+ struct l2cap_chan *c;
- read_lock_bh(&l2cap_sk_list.lock);
+ read_lock_bh(&chan_list_lock);
- sk_for_each(sk, node, &l2cap_sk_list.head) {
- struct l2cap_pinfo *pi = l2cap_pi(sk);
- struct l2cap_chan *chan = pi->chan;
+ list_for_each_entry(c, &chan_list, global_l) {
+ struct sock *sk = c->sk;
seq_printf(f, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d %d\n",
batostr(&bt_sk(sk)->src),
batostr(&bt_sk(sk)->dst),
- sk->sk_state, __le16_to_cpu(chan->psm),
- chan->scid, chan->dcid,
- chan->imtu, chan->omtu, chan->sec_level,
- chan->mode);
+ sk->sk_state, __le16_to_cpu(c->psm),
+ c->scid, c->dcid, c->imtu, c->omtu,
+ c->sec_level, c->mode);
}
- read_unlock_bh(&l2cap_sk_list.lock);
+ read_unlock_bh(&chan_list_lock);
return 0;
}
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index aca99cd..3a78e46 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -808,8 +808,7 @@ void l2cap_sock_kill(struct sock *sk)
/* Kill poor orphan */
- l2cap_chan_free(l2cap_pi(sk)->chan);
- bt_sock_unlink(&l2cap_sk_list, sk);
+ l2cap_chan_destruct(l2cap_pi(sk)->chan);
sock_set_flag(sk, SOCK_DEAD);
sock_put(sk);
}
@@ -1025,7 +1024,6 @@ struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int proto, g
setup_timer(&sk->sk_timer, l2cap_sock_timeout, (unsigned long) sk);
- bt_sock_link(&l2cap_sk_list, sk);
return sk;
}
@@ -1052,7 +1050,7 @@ static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol,
if (!sk)
return -ENOMEM;
- chan = l2cap_chan_alloc(sk);
+ chan = l2cap_chan_create(sk);
if (!chan) {
l2cap_sock_kill(sk);
return -ENOMEM;
--
1.7.5.rc1
^ permalink raw reply related
* [PATCH 2/3] Bluetooth: Handle psm == 0 case inside l2cap_add_psm()
From: Gustavo F. Padovan @ 2011-04-27 21:49 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1303940957-22694-1-git-send-email-padovan@profusion.mobi>
When the user doesn't specify a psm we have the choose one for the
channel. Now we do this inside l2cap_add_psm().
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
include/net/bluetooth/l2cap.h | 1 -
net/bluetooth/l2cap_core.c | 32 ++++++++++++++++++++++++--------
net/bluetooth/l2cap_sock.c | 22 ----------------------
3 files changed, 24 insertions(+), 31 deletions(-)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index f5f3c2c..fb3f90e 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -458,7 +458,6 @@ void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb);
void l2cap_streaming_send(struct l2cap_chan *chan);
int l2cap_ertm_send(struct l2cap_chan *chan);
-struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src);
int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm);
int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid);
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 98ddd86..9e3f64f 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -135,7 +135,7 @@ static inline struct l2cap_chan *l2cap_get_chan_by_ident(struct l2cap_conn *conn
return c;
}
-struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src)
+static struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src)
{
struct sock *sk;
struct hlist_node *node;
@@ -153,19 +153,35 @@ found:
int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm)
{
+ int err;
+
write_lock_bh(&l2cap_sk_list.lock);
- if (__l2cap_get_sock_by_addr(psm, src)) {
- write_unlock_bh(&l2cap_sk_list.lock);
- return -EADDRINUSE;
+ if (psm && __l2cap_get_sock_by_addr(psm, src)) {
+ err = -EADDRINUSE;
+ goto done;
}
- chan->psm = psm;
- chan->sport = psm;
+ if (psm) {
+ chan->psm = psm;
+ chan->sport = psm;
+ err = 0;
+ } else {
+ u16 p;
- write_unlock_bh(&l2cap_sk_list.lock);
+ err = -EINVAL;
+ for (p = 0x1001; p < 0x1100; p += 2)
+ if (!__l2cap_get_sock_by_addr(cpu_to_le16(p), src)) {
+ chan->psm = cpu_to_le16(p);
+ chan->sport = cpu_to_le16(p);
+ err = 0;
+ break;
+ }
+ }
- return 0;
+done:
+ write_unlock_bh(&l2cap_sk_list.lock);
+ return err;
}
int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid)
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 2156dce..aca99cd 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -256,28 +256,6 @@ static int l2cap_sock_listen(struct socket *sock, int backlog)
goto done;
}
- if (!chan->psm && !chan->scid) {
- bdaddr_t *src = &bt_sk(sk)->src;
- u16 psm;
-
- err = -EINVAL;
-
- write_lock_bh(&l2cap_sk_list.lock);
-
- for (psm = 0x1001; psm < 0x1100; psm += 2)
- if (!__l2cap_get_sock_by_addr(cpu_to_le16(psm), src)) {
- chan->psm = cpu_to_le16(psm);
- chan->sport = cpu_to_le16(psm);
- err = 0;
- break;
- }
-
- write_unlock_bh(&l2cap_sk_list.lock);
-
- if (err < 0)
- goto done;
- }
-
sk->sk_max_ack_backlog = backlog;
sk->sk_ack_backlog = 0;
sk->sk_state = BT_LISTEN;
--
1.7.5.rc1
^ permalink raw reply related
* [PATCH 1/3] Bluetooth: Add l2cap_add_psm() and l2cap_add_scid()
From: Gustavo F. Padovan @ 2011-04-27 21:49 UTC (permalink / raw)
To: linux-bluetooth
The intention is to get rid of the l2cap_sk_list usage inside
l2cap_core.c. l2cap_sk_list will soon be replaced by a list that does not
depend on socket usage.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
include/net/bluetooth/l2cap.h | 4 +++
net/bluetooth/l2cap_core.c | 44 +++++++++++++++++++++++++++++++++++++++++
net/bluetooth/l2cap_sock.c | 44 ++++++++++------------------------------
3 files changed, 59 insertions(+), 33 deletions(-)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index c34b1c1..f5f3c2c 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -458,6 +458,10 @@ void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb);
void l2cap_streaming_send(struct l2cap_chan *chan);
int l2cap_ertm_send(struct l2cap_chan *chan);
+struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src);
+int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm);
+int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid);
+
void l2cap_sock_set_timer(struct sock *sk, long timeout);
void l2cap_sock_clear_timer(struct sock *sk);
void __l2cap_sock_close(struct sock *sk, int reason);
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 338d8c3..98ddd86 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -135,6 +135,50 @@ static inline struct l2cap_chan *l2cap_get_chan_by_ident(struct l2cap_conn *conn
return c;
}
+struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src)
+{
+ struct sock *sk;
+ struct hlist_node *node;
+ sk_for_each(sk, node, &l2cap_sk_list.head) {
+ struct l2cap_chan *chan = l2cap_pi(sk)->chan;
+
+ if (chan->sport == psm && !bacmp(&bt_sk(sk)->src, src))
+ goto found;
+ }
+
+ sk = NULL;
+found:
+ return sk;
+}
+
+int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm)
+{
+ write_lock_bh(&l2cap_sk_list.lock);
+
+ if (__l2cap_get_sock_by_addr(psm, src)) {
+ write_unlock_bh(&l2cap_sk_list.lock);
+ return -EADDRINUSE;
+ }
+
+ chan->psm = psm;
+ chan->sport = psm;
+
+ write_unlock_bh(&l2cap_sk_list.lock);
+
+ return 0;
+}
+
+int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid)
+{
+ write_lock_bh(&l2cap_sk_list.lock);
+
+ chan->scid = scid;
+
+ write_unlock_bh(&l2cap_sk_list.lock);
+
+ return 0;
+}
+
static u16 l2cap_alloc_cid(struct l2cap_conn *conn)
{
u16 cid = L2CAP_CID_DYN_START;
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 09cc7a0..2156dce 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -78,22 +78,6 @@ void l2cap_sock_clear_timer(struct sock *sk)
sk_stop_timer(sk, &sk->sk_timer);
}
-static struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src)
-{
- struct sock *sk;
- struct hlist_node *node;
- sk_for_each(sk, node, &l2cap_sk_list.head) {
- struct l2cap_chan *chan = l2cap_pi(sk)->chan;
-
- if (chan->sport == psm && !bacmp(&bt_sk(sk)->src, src))
- goto found;
- }
-
- sk = NULL;
-found:
- return sk;
-}
-
static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
{
struct sock *sk = sock->sk;
@@ -136,26 +120,20 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
}
}
- write_lock_bh(&l2cap_sk_list.lock);
+ if (la.l2_cid)
+ err = l2cap_add_scid(chan, la.l2_cid);
+ else
+ err = l2cap_add_psm(chan, &la.l2_bdaddr, la.l2_psm);
- if (la.l2_psm && __l2cap_get_sock_by_addr(la.l2_psm, &la.l2_bdaddr)) {
- err = -EADDRINUSE;
- } else {
- /* Save source address */
- bacpy(&bt_sk(sk)->src, &la.l2_bdaddr);
- chan->psm = la.l2_psm;
- chan->sport = la.l2_psm;
- sk->sk_state = BT_BOUND;
-
- if (__le16_to_cpu(la.l2_psm) == 0x0001 ||
- __le16_to_cpu(la.l2_psm) == 0x0003)
- chan->sec_level = BT_SECURITY_SDP;
- }
+ if (err < 0)
+ goto done;
- if (la.l2_cid)
- chan->scid = la.l2_cid;
+ if (__le16_to_cpu(la.l2_psm) == 0x0001 ||
+ __le16_to_cpu(la.l2_psm) == 0x0003)
+ chan->sec_level = BT_SECURITY_SDP;
- write_unlock_bh(&l2cap_sk_list.lock);
+ bacpy(&bt_sk(sk)->src, &la.l2_bdaddr);
+ sk->sk_state = BT_BOUND;
done:
release_sock(sk);
--
1.7.5.rc1
^ permalink raw reply related
* [PATCH] Use HCI_MAX_EIR_LENGTH instead of hard-coded value
From: Bruna Moreira @ 2011-04-27 20:21 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Bruna Moreira
---
NOTE: the constants EIR_DATA_LENGTH and HCI_MAX_EIR_LENGTH are duplicated.
This will be fixed in next patches of discovery cleanup.
lib/hci.c | 4 ++--
plugins/hciops.c | 2 +-
src/storage.c | 4 ++--
test/hciemu.c | 6 +++---
tools/hciconfig.c | 10 +++++-----
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/lib/hci.c b/lib/hci.c
index eb00730..b122313 100644
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -2291,7 +2291,7 @@ int hci_read_ext_inquiry_response(int dd, uint8_t *fec, uint8_t *data, int to)
}
*fec = rp.fec;
- memcpy(data, rp.data, 240);
+ memcpy(data, rp.data, HCI_MAX_EIR_LENGTH);
return 0;
}
@@ -2304,7 +2304,7 @@ int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to)
memset(&cp, 0, sizeof(cp));
cp.fec = fec;
- memcpy(cp.data, data, 240);
+ memcpy(cp.data, data, HCI_MAX_EIR_LENGTH);
memset(&rq, 0, sizeof(rq));
rq.ogf = OGF_HOST_CTL;
diff --git a/plugins/hciops.c b/plugins/hciops.c
index 2b9be3f..d1156e2 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -96,7 +96,7 @@ static struct dev_info {
int sk;
bdaddr_t bdaddr;
char name[249];
- uint8_t eir[240];
+ uint8_t eir[HCI_MAX_EIR_LENGTH];
uint8_t features[8];
uint8_t ssp_mode;
diff --git a/src/storage.c b/src/storage.c
index 28aea30..d416d75 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -368,7 +368,7 @@ int write_remote_eir(bdaddr_t *local, bdaddr_t *peer, uint8_t *data)
int i;
memset(str, 0, sizeof(str));
- for (i = 0; i < 240; i++)
+ for (i = 0; i < HCI_MAX_EIR_LENGTH; i++)
sprintf(str + (i * 2), "%2.2X", data[i]);
create_filename(filename, PATH_MAX, local, "eir");
@@ -402,7 +402,7 @@ int read_remote_eir(bdaddr_t *local, bdaddr_t *peer, uint8_t *data)
return -EIO;
}
- for (i = 0; i < 240; i++)
+ for (i = 0; i < HCI_MAX_EIR_LENGTH; i++)
sscanf(str + (i * 2), "%02hhX", &data[i]);
free(str);
diff --git a/test/hciemu.c b/test/hciemu.c
index 9950372..66f99a9 100644
--- a/test/hciemu.c
+++ b/test/hciemu.c
@@ -68,7 +68,7 @@ struct vhci_device {
uint8_t dev_class[3];
uint8_t inq_mode;
uint8_t eir_fec;
- uint8_t eir_data[240];
+ uint8_t eir_data[HCI_MAX_EIR_LENGTH];
uint16_t acl_cnt;
bdaddr_t bdaddr;
int fd;
@@ -714,14 +714,14 @@ static void hci_host_control(uint16_t ocf, int plen, uint8_t *data)
case OCF_READ_EXT_INQUIRY_RESPONSE:
ir.status = 0x00;
ir.fec = vdev.eir_fec;
- memcpy(ir.data, vdev.eir_data, 240);
+ memcpy(ir.data, vdev.eir_data, HCI_MAX_EIR_LENGTH);
command_complete(ogf, ocf, sizeof(ir), &ir);
break;
case OCF_WRITE_EXT_INQUIRY_RESPONSE:
status = 0x00;
vdev.eir_fec = data[0];
- memcpy(vdev.eir_data, data + 1, 240);
+ memcpy(vdev.eir_data, data + 1, HCI_MAX_EIR_LENGTH);
command_complete(ogf, ocf, 1, &status);
break;
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 3db70a4..cbd0d0e 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -1252,7 +1252,7 @@ static void cmd_inq_data(int ctl, int hdev, char *opt)
}
if (opt) {
- uint8_t fec = 0, data[240];
+ uint8_t fec = 0, data[HCI_MAX_EIR_LENGTH];
char tmp[3];
int i, size;
@@ -1260,8 +1260,8 @@ static void cmd_inq_data(int ctl, int hdev, char *opt)
memset(tmp, 0, sizeof(tmp));
size = (strlen(opt) + 1) / 2;
- if (size > 240)
- size = 240;
+ if (size > HCI_MAX_EIR_LENGTH)
+ size = HCI_MAX_EIR_LENGTH;
for (i = 0; i < size; i++) {
memcpy(tmp, opt + (i * 2), 2);
@@ -1274,7 +1274,7 @@ static void cmd_inq_data(int ctl, int hdev, char *opt)
exit(1);
}
} else {
- uint8_t fec, data[240], len, type, *ptr;
+ uint8_t fec, data[HCI_MAX_EIR_LENGTH], len, type, *ptr;
char *str;
if (hci_read_ext_inquiry_response(dd, &fec, data, 1000) < 0) {
@@ -1285,7 +1285,7 @@ static void cmd_inq_data(int ctl, int hdev, char *opt)
print_dev_hdr(&di);
printf("\tFEC %s\n\t\t", fec ? "enabled" : "disabled");
- for (i = 0; i < 240; i++)
+ for (i = 0; i < HCI_MAX_EIR_LENGTH; i++)
printf("%02x%s%s", data[i], (i + 1) % 8 ? "" : " ",
(i + 1) % 16 ? " " : (i < 239 ? "\n\t\t" : "\n"));
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH 1/3] Add support for getting the Encryption Key Size via btio
From: Vinicius Costa Gomes @ 2011-04-27 18:33 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1302826003-5511-1-git-send-email-vinicius.gomes@openbossa.org>
Hi,
On 21:06 Thu 14 Apr, Vinicius Costa Gomes wrote:
> Some profiles specify some restriction depending on the length
> of the key used to encrypt the link, this adds an way to retrieve
> that value from the kernel.
>
> Current kernels don't provide this information so the size is
> always zero.
> ---
> btio/btio.c | 21 +++++++++++++++++++++
> btio/btio.h | 1 +
> lib/bluetooth.h | 1 +
> 3 files changed, 23 insertions(+), 0 deletions(-)
Some tests need this functionality and they will work even without
support in the kernel side. May I send an updated version of these
patches? Or does any one still have comments?
And just to be clear, even the kernel patches just implement the
communication kernel -> userspace, the other direction will be
implemented later.
Cheers,
--
Vinicius
^ permalink raw reply
* Re: kernel panic after unplug usb bluetooth dongle
From: Gustavo F. Padovan @ 2011-04-27 17:54 UTC (permalink / raw)
To: Dave Young; +Cc: Bluettooth Linux, Linux Kernel Mailing List, Thomas Gleixner
In-Reply-To: <BANLkTi=UG0Xy2UEkNj2S_bS-PjOG5krNkQ@mail.gmail.com>
* Dave Young <hidave.darkstar@gmail.com> [2011-04-27 14:35:59 +0800]:
> Hi,
>
> Unplug usb bluetooth dongle make kernel panic as below. Thomas, any
> idea about it?
Commit b79f44c16a4 on
git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-2.6.git
fixes this. The only problem is that it didn't arrive at mainline yet.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* [PATCH v2 2/2] Bluetooth: Add discovering event to the Management interface
From: anderson.briglia @ 2011-04-27 14:29 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Johan Hedberg, Anderson Briglia
From: Johan Hedberg <johan.hedberg@nokia.com>
This patch adds a new event to the Management interface to track when
local adapters are discovering remote devices. For now this only tracks
BR/EDR discovery procedures.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
---
include/net/bluetooth/hci_core.h | 1 +
include/net/bluetooth/mgmt.h | 2 +
net/bluetooth/hci_event.c | 40 ++++++++++++++++++++++++++++++++-----
net/bluetooth/mgmt.c | 6 +++++
4 files changed, 43 insertions(+), 6 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 4093133..69967e5 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -790,6 +790,7 @@ int mgmt_read_local_oob_data_reply_complete(u16 index, u8 *hash, u8 *randomizer,
int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi,
u8 *eir);
int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name);
+int mgmt_discovering(u16 index, u8 discovering);
/* HCI info for socket */
#define hci_pi(sk) ((struct hci_pinfo *) sk)
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index be93dd0..7434406 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -285,3 +285,5 @@ struct mgmt_ev_remote_name {
bdaddr_t bdaddr;
__u8 name[MGMT_MAX_NAME_LENGTH];
} __packed;
+
+#define MGMT_EV_DISCOVERING 0x0014
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index cb25628..e64a3de 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -56,7 +56,9 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb)
if (status)
return;
- clear_bit(HCI_INQUIRY, &hdev->flags);
+ if (test_bit(HCI_MGMT, &hdev->flags) &&
+ test_and_clear_bit(HCI_INQUIRY, &hdev->flags))
+ mgmt_discovering(hdev->id, 0);
hci_req_complete(hdev, HCI_OP_INQUIRY_CANCEL, status);
@@ -72,7 +74,9 @@ static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb)
if (status)
return;
- clear_bit(HCI_INQUIRY, &hdev->flags);
+ if (test_bit(HCI_MGMT, &hdev->flags) &&
+ test_and_clear_bit(HCI_INQUIRY, &hdev->flags))
+ mgmt_discovering(hdev->id, 0);
hci_conn_check_pending(hdev);
}
@@ -841,10 +845,14 @@ static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
if (status) {
hci_req_complete(hdev, HCI_OP_INQUIRY, status);
-
hci_conn_check_pending(hdev);
- } else
- set_bit(HCI_INQUIRY, &hdev->flags);
+ return;
+ }
+
+ if (test_bit(HCI_MGMT, &hdev->flags) &&
+ !test_and_set_bit(HCI_INQUIRY,
+ &hdev->flags))
+ mgmt_discovering(hdev->id, 1);
}
static inline void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
@@ -1208,7 +1216,9 @@ static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff
BT_DBG("%s status %d", hdev->name, status);
- clear_bit(HCI_INQUIRY, &hdev->flags);
+ if (test_bit(HCI_MGMT, &hdev->flags) &&
+ test_and_clear_bit(HCI_INQUIRY, &hdev->flags))
+ mgmt_discovering(hdev->id, 0);
hci_req_complete(hdev, HCI_OP_INQUIRY, status);
@@ -1228,6 +1238,12 @@ static inline void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *
hci_dev_lock(hdev);
+ if (!test_and_set_bit(HCI_INQUIRY, &hdev->flags)) {
+
+ if (test_bit(HCI_MGMT, &hdev->flags))
+ mgmt_discovering(hdev->id, 1);
+ }
+
for (; num_rsp; num_rsp--, info++) {
bacpy(&data.bdaddr, &info->bdaddr);
data.pscan_rep_mode = info->pscan_rep_mode;
@@ -2158,6 +2174,12 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
hci_dev_lock(hdev);
+ if (!test_and_set_bit(HCI_INQUIRY, &hdev->flags)) {
+
+ if (test_bit(HCI_MGMT, &hdev->flags))
+ mgmt_discovering(hdev->id, 1);
+ }
+
if ((skb->len - 1) / num_rsp != sizeof(struct inquiry_info_with_rssi)) {
struct inquiry_info_with_rssi_and_pscan_mode *info;
info = (void *) (skb->data + 1);
@@ -2320,6 +2342,12 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct
if (!num_rsp)
return;
+ if (!test_and_set_bit(HCI_INQUIRY, &hdev->flags)) {
+
+ if (test_bit(HCI_MGMT, &hdev->flags))
+ mgmt_discovering(hdev->id, 1);
+ }
+
hci_dev_lock(hdev);
for (; num_rsp; num_rsp--, info++) {
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index dbc248f..4542396 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2149,3 +2149,9 @@ int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name)
return mgmt_event(MGMT_EV_REMOTE_NAME, index, &ev, sizeof(ev), NULL);
}
+
+int mgmt_discovering(u16 index, u8 discovering)
+{
+ return mgmt_event(MGMT_EV_DISCOVERING, index, &discovering,
+ sizeof(discovering), NULL);
+}
--
1.7.1
^ permalink raw reply related
* [PATCH v2 1/2] Bluetooth: Add basic discovery commands to the management interface
From: anderson.briglia @ 2011-04-27 14:29 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Johan Hedberg, Anderson Briglia
From: Johan Hedberg <johan.hedberg@nokia.com>
This patch adds start_discovery and stop_discovery commands to the
management interface. Right now their implementation is fairly
simplistic and the parameters are fixed to what user space has
defaulted to so far.
This is the very initial phase for discovery implementation into
the kernel. Next steps include name resolution, LE scanning and
bdaddr type handling.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
---
include/net/bluetooth/mgmt.h | 4 ++
net/bluetooth/mgmt.c | 76 +++++++++++++++++++++++++++++++++++++++++-
2 files changed, 79 insertions(+), 1 deletions(-)
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 6b6ff92..be93dd0 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -195,6 +195,10 @@ struct mgmt_cp_remove_remote_oob_data {
bdaddr_t bdaddr;
} __packed;
+#define MGMT_OP_START_DISCOVERY 0x001B
+
+#define MGMT_OP_STOP_DISCOVERY 0x001C
+
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
__le16 opcode;
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index c304688..dbc248f 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1569,6 +1569,75 @@ static int remove_remote_oob_data(struct sock *sk, u16 index,
return err;
}
+static int start_discovery(struct sock *sk, u16 index)
+{
+ u8 lap[3] = { 0x33, 0x8b, 0x9e };
+ struct hci_cp_inquiry cp;
+ struct pending_cmd *cmd;
+ struct hci_dev *hdev;
+ int err;
+
+ BT_DBG("hci%u", index);
+
+ hdev = hci_dev_get(index);
+ if (!hdev)
+ return cmd_status(sk, index, MGMT_OP_START_DISCOVERY, ENODEV);
+
+ hci_dev_lock_bh(hdev);
+
+ cmd = mgmt_pending_add(sk, MGMT_OP_START_DISCOVERY, index, NULL, 0);
+ if (!cmd) {
+ err = -ENOMEM;
+ goto failed;
+ }
+
+ memset(&cp, 0, sizeof(cp));
+ memcpy(&cp.lap, lap, 3);
+ cp.length = 0x08;
+ cp.num_rsp = 0x00;
+
+ err = hci_send_cmd(hdev, HCI_OP_INQUIRY, sizeof(cp), &cp);
+ if (err < 0)
+ mgmt_pending_remove(cmd);
+
+failed:
+ hci_dev_unlock_bh(hdev);
+ hci_dev_put(hdev);
+
+ return err;
+}
+
+static int stop_discovery(struct sock *sk, u16 index)
+{
+ struct hci_dev *hdev;
+ struct pending_cmd *cmd;
+ int err;
+
+ BT_DBG("hci%u", index);
+
+ hdev = hci_dev_get(index);
+ if (!hdev)
+ return cmd_status(sk, index, MGMT_OP_STOP_DISCOVERY, ENODEV);
+
+ hci_dev_lock_bh(hdev);
+
+ cmd = mgmt_pending_add(sk, MGMT_OP_STOP_DISCOVERY, index, NULL, 0);
+ if (!cmd) {
+ err = -ENOMEM;
+ goto failed;
+ }
+
+ err = hci_send_cmd(hdev, HCI_OP_INQUIRY_CANCEL, 0, NULL);
+ if (err < 0)
+ mgmt_pending_remove(cmd);
+
+failed:
+ hci_dev_unlock_bh(hdev);
+ hci_dev_put(hdev);
+
+ return err;
+}
+
int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
{
unsigned char *buf;
@@ -1677,7 +1746,12 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
err = remove_remote_oob_data(sk, index, buf + sizeof(*hdr),
len);
break;
-
+ case MGMT_OP_START_DISCOVERY:
+ err = start_discovery(sk, index);
+ break;
+ case MGMT_OP_STOP_DISCOVERY:
+ err = stop_discovery(sk, index);
+ break;
default:
BT_DBG("Unknown op %u", opcode);
err = cmd_status(sk, index, opcode, 0x01);
--
1.7.1
^ permalink raw reply related
* [PATCH] Change attrib server to use ATT CID & PSM defined in att.h
From: Claudio Takahasi @ 2011-04-27 13:07 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
src/attrib-server.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/attrib-server.c b/src/attrib-server.c
index 7ee496e..c55167f 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -47,9 +47,6 @@
#include "attrib-server.h"
-#define GATT_PSM 0x1f
-#define GATT_CID 4
-
static GSList *database = NULL;
struct gatt_channel {
@@ -97,7 +94,7 @@ static sdp_record_t *server_record_new(uuid_t *uuid, uint16_t start, uint16_t en
uuid_t root_uuid, proto_uuid, l2cap;
sdp_record_t *record;
sdp_data_t *psm, *sh, *eh;
- uint16_t lp = GATT_PSM;
+ uint16_t lp = ATT_PSM;
if (uuid == NULL)
return NULL;
@@ -949,7 +946,7 @@ static void connect_event(GIOChannel *io, GError *err, void *user_data)
if (channel->mtu > ATT_MAX_MTU)
channel->mtu = ATT_MAX_MTU;
- if (cid != GATT_CID)
+ if (cid != ATT_CID)
channel->le = FALSE;
else
channel->le = TRUE;
@@ -1089,7 +1086,7 @@ int attrib_server_init(void)
l2cap_io = bt_io_listen(BT_IO_L2CAP, NULL, confirm_event,
NULL, NULL, &gerr,
BT_IO_OPT_SOURCE_BDADDR, BDADDR_ANY,
- BT_IO_OPT_PSM, GATT_PSM,
+ BT_IO_OPT_PSM, ATT_PSM,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
BT_IO_OPT_INVALID);
if (l2cap_io == NULL) {
@@ -1108,7 +1105,7 @@ int attrib_server_init(void)
le_io = bt_io_listen(BT_IO_L2CAP, NULL, confirm_event,
&le_io, NULL, &gerr,
BT_IO_OPT_SOURCE_BDADDR, BDADDR_ANY,
- BT_IO_OPT_CID, GATT_CID,
+ BT_IO_OPT_CID, ATT_CID,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
BT_IO_OPT_INVALID);
if (le_io == NULL) {
--
1.7.5.rc1
^ permalink raw reply related
* Re: [BUG] bluetooth doesn't work from 2.6.39-rc1+ to 2.6.39-rc3+
From: Ed Tomlinson @ 2011-04-27 11:00 UTC (permalink / raw)
To: Dave Young; +Cc: Hui Zhu, linux-kernel, Bluettooth Linux
In-Reply-To: <BANLkTim-49ZdSLnyjs_kjLxuvyCe=oUdGA@mail.gmail.com>
On Tuesday 26 April 2011 22:55:22 Dave Young wrote:
> On Sun, Apr 24, 2011 at 9:52 PM, Ed Tomlinson <edt@aei.ca> wrote:
> > On Tuesday 19 April 2011 11:34:30 Hui Zhu wrote:
> >> Do you part is OK?
> >>
> >> I think it will be very easy to reproduce.
> >>
> >> Thanks,
> >> Hui
> >>
> >> On Tue, Apr 19, 2011 at 15:46, Dave Young <hidave.darkstar@gmail.com> wrote:
> >> > On Tue, Apr 19, 2011 at 10:53 AM, Hui Zhu <teawater@gmail.com> wrote:
> >> >> Cannot connect to any outside devices through bluetooth.
> >> >>
> >> >> And I think this is not a bug of low level driver. Because both my
> >> >> laptop and a usb bluetooth card cannot work.
> >> >
> >> > Hi, please explain the "cannot work" in detail,
> >> > Firstly check dmesg and hciconfig to see if there's anything wrong.
> >
> > I am also seeing problems with bluetooth in .39-rc4+
> >
> > [54511.033258] usb 2-4.4: USB disconnect, device number 5
> > [54513.920060] usb 2-4.3: new full speed USB device number 6 using ehci_hcd
> > [54514.063057] usb 2-4.3: New USB device found, idVendor=0a12, idProduct=0001
> > [54514.070281] usb 2-4.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> > grover ~ # hciconfig -a
> > hci0: Type: BR/EDR Bus: USB
> > BD Address: 00:0A:3A:55:07:5A ACL MTU: 192:8 SCO MTU: 64:8
> > DOWN
> > RX bytes:718 acl:0 sco:0 events:25 errors:0
> > TX bytes:108 acl:0 sco:0 commands:24 errors:0
> > Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
> > Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
> > Link policy: CONFIG_BT_HCIBTUSB=m
> > Link mode: SLAVE ACCEPT
> >
> > grover ~ # hciconfig hci0 up
> > Can't init device hci0: Invalid argument (22)
> >
> > The same error happens If I just try a hciconfig hci0 up after boot (without replugging the adaptor).
>
> I did not see your problem, my usb dongle usbid is 0a12:0001 as well,
> maybe bisect is the way to go.
I can try but this bug was introduced during the .38 to rc1 window. I've not had much luck
bisecting through pre rc1...
Is there any good way to trace what is giving the 'Invalid argument 22'?
Ed
> >
> > CONFIG_BT_HCIBTSDIO=m
> > CONFIG_BT_HCIUART=m
> > CONFIG_BT_HCIUART_H4=y
> > CONFIG_BT_HCIUART_BCSP=y
> > # CONFIG_BT_HCIUART_ATH3K is not set
> > CONFIG_BT_HCIUART_LL=y
> > CONFIG_BT_HCIBCM203X=m
> > CONFIG_BT_HCIBPA10X=m
> > CONFIG_BT_HCIBFUSB=m
> > CONFIG_BT_HCIVHCI=m
> >
> > and bluez-4.91 is installed
> >
> > Ideas?
> > Ed Tomlinson
> >
>
>
>
>
^ permalink raw reply
* Re: [BUG] bluetooth doesn't work from 2.6.39-rc1+ to 2.6.39-rc3+
From: Ed Tomlinson @ 2011-04-27 10:57 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: Hui Zhu, Dave Young, linux-kernel, Bluettooth Linux
In-Reply-To: <20110426161330.GC2242@joana>
On Tuesday 26 April 2011 12:13:30 Gustavo F. Padovan wrote:
> * Ed Tomlinson <edt@aei.ca> [2011-04-24 09:52:14 -0400]:
>
> > On Tuesday 19 April 2011 11:34:30 Hui Zhu wrote:
> > > Do you part is OK?
> > >
> > > I think it will be very easy to reproduce.
> > >
> > > Thanks,
> > > Hui
> > >
> > > On Tue, Apr 19, 2011 at 15:46, Dave Young <hidave.darkstar@gmail.com> wrote:
> > > > On Tue, Apr 19, 2011 at 10:53 AM, Hui Zhu <teawater@gmail.com> wrote:
> > > >> Cannot connect to any outside devices through bluetooth.
> > > >>
> > > >> And I think this is not a bug of low level driver. Because both my
> > > >> laptop and a usb bluetooth card cannot work.
> > > >
> > > > Hi, please explain the "cannot work" in detail,
> > > > Firstly check dmesg and hciconfig to see if there's anything wrong.
> >
> > I am also seeing problems with bluetooth in .39-rc4+
> >
> > [54511.033258] usb 2-4.4: USB disconnect, device number 5
> > [54513.920060] usb 2-4.3: new full speed USB device number 6 using ehci_hcd
> > [54514.063057] usb 2-4.3: New USB device found, idVendor=0a12, idProduct=0001
> > [54514.070281] usb 2-4.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> > grover ~ # hciconfig -a
> > hci0: Type: BR/EDR Bus: USB
> > BD Address: 00:0A:3A:55:07:5A ACL MTU: 192:8 SCO MTU: 64:8
> > DOWN
> > RX bytes:718 acl:0 sco:0 events:25 errors:0
> > TX bytes:108 acl:0 sco:0 commands:24 errors:0
> > Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
> > Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
> > Link policy: CONFIG_BT_HCIBTUSB=m
> > Link mode: SLAVE ACCEPT
> >
> > grover ~ # hciconfig hci0 up
> > Can't init device hci0: Invalid argument (22)
>
> does dmesg show something? I'm using a -rc kernel and bluetooth is working to
> me.
What dmesg shows is included above. The tell tail for this bug is the error 22 from
user space. I see nothing on the kernel side.
Ed
^ permalink raw reply
* [PATCH] Remove grouping by phone number in call-history results
From: Radoslaw Jablonski @ 2011-04-27 10:52 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Radoslaw Jablonski
Now call history entries are distinguished also by call
date (previously only contact-id was compared, so calls with
different date were grouped into one entry in pull results).
This change is needed for headsets with PBAP support that are
confused when number of "new missed calls" is different than
number of returned entries by pull call-history response (by
example Nokia BH-903 hangs when this happens).
---
plugins/phonebook-tracker.c | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index 2fced7a..d72c04e 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -1208,13 +1208,36 @@ static void set_call_type(struct phonebook_contact *contact,
contact->datetime = iso8601_utc_to_localtime(datetime);
}
-static struct phonebook_contact *find_contact(GSList *contacts, const char *id)
+static gboolean contact_matches(struct contact_data *c_data, const char *id,
+ const char *datetime)
+{
+ char *localtime;
+ int cmp_ret;
+
+ if (g_strcmp0(c_data->id, id) != 0)
+ return FALSE;
+
+ /* id is equal and not call history entry => contact matches */
+ if (c_data->contact->calltype == CALL_TYPE_NOT_A_CALL)
+ return TRUE;
+
+ /* for call history entries have to compare also timestamps of calls */
+ localtime = iso8601_utc_to_localtime(datetime);
+ cmp_ret = g_strcmp0(c_data->contact->datetime, localtime);
+ g_free(localtime);
+
+ return (cmp_ret == 0) ? TRUE : FALSE;
+}
+
+static struct phonebook_contact *find_contact(GSList *contacts, const char *id,
+ const char *datetime)
{
GSList *l;
for (l = contacts; l; l = l->next) {
struct contact_data *c_data = l->data;
- if (g_strcmp0(c_data->id, id) == 0)
+
+ if (contact_matches(c_data, id, datetime))
return c_data->contact;
}
@@ -1609,7 +1632,8 @@ static int pull_contacts(const char **reply, int num_fields, void *user_data)
/* Trying to find contact in recently added contacts. It is needed for
* contacts that have more than one telephone number filled */
- contact = find_contact(data->contacts, reply[CONTACTS_ID_COL]);
+ contact = find_contact(data->contacts, reply[CONTACTS_ID_COL],
+ reply[COL_DATE]);
/* If contact is already created then adding only new phone numbers */
if (contact) {
--
1.7.0.4
^ permalink raw reply related
* Re: kernel panic after unplug usb bluetooth dongle
From: Dave Young @ 2011-04-27 7:14 UTC (permalink / raw)
To: Yong Zhang; +Cc: Bluettooth Linux, Linux Kernel Mailing List, Thomas Gleixner
In-Reply-To: <BANLkTi=otVX5RS9zFEfTzbXyy1JeCUbZHQ@mail.gmail.com>
On Wed, Apr 27, 2011 at 3:14 PM, Yong Zhang <yong.zhang0@gmail.com> wrote:
> On Wed, Apr 27, 2011 at 3:11 PM, Dave Young <hidave.darkstar@gmail.com> wrote:
>> On Wed, Apr 27, 2011 at 2:41 PM, Yong Zhang <yong.zhang0@gmail.com> wrote:
>>> On Wed, Apr 27, 2011 at 2:35 PM, Dave Young <hidave.darkstar@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> Unplug usb bluetooth dongle make kernel panic as below. Thomas, any
>>>> idea about it?
>>>>
>>>> usb 6-1: USB disconnect, device number 3
>>>> btusb_intr_complete: hci0 urb ffff8801275bb9c0 failed to resubmit (19)
>>>> btusb_bulk_complete: hci0 urb ffff8801275bb540 failed to resubmit (19)
>>>> btusb_bulk_complete: hci0 urb ffff8801275bb6c0 failed to resubmit (19)
>>>> btusb_send_frame: hci0 urb ffff8801275bb6c0 submission failed
>>>> BUG: unable to handle kernel NULL pointer dereference at (null)
>>>> IP: [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
>>>
>>> Seems a hrtimer is freed abnormaly.
>>>
>>> Could you try to build your kernel with CONFIG_DEBUG_OBJECTS_TIMERS=y
>>>
>>
>> Tried, did not see any new stuff in dmesg.
>
> So this means you still got the PANIC, but don't see any additional output?
>
Yes
> Thanks,
> Yong
>
>>
>>> Thanks,
>>> Yong
>>>
>>>> PGD 12609c067 PUD 1260b5067 PMD 0
>>>> Oops: 0000 [#1] SMP
>>>> last sysfs file: /sys/devices/virtual/dmi/id/chassis_type
>>>> CPU 0
>>>> Modules linked in: tun rfcomm bnep snd_pcm_oss snd_mixer_oss kvm_intel
>>>> kvm btusb bluetooth snd_hda_codec_analog snd_hda_intel dell_wmi
>>>> sparse_keymap snd_hda_codec snd_hwdep e1000e snd_pcm wmi snd_timer
>>>> 8139too rfkill snd_page_alloc
>>>>
>>>> Pid: 0, comm: swapper Not tainted 2.6.39-rc5 #224 Dell Inc. OptiPlex
>>>> 780 /0V4W66
>>>> RIP: 0010:[<ffffffff81048988>] [<ffffffff81048988>]
>>>> get_next_timer_interrupt+0x13d/0x21d
>>>> RSP: 0018:ffffffff817dddf8 EFLAGS: 00010097
>>>> RAX: 0000000000000000 RBX: ffffffff819adb80 RCX: 000000000000003e
>>>> RDX: 0000000000000000 RSI: 000000000000003e RDI: 0000000000000000
>>>> RBP: ffffffff817dde58 R08: ffffffff817dde08 R09: 00000000010000fe
>>>> R10: 0000000000000000 R11: 0000000000000001 R12: 000000010000fdf7
>>>> R13: ffffffff819aefb0 R14: ffffffff819aebd0 R15: 0000000000000040
>>>> FS: 0000000000000000(0000) GS:ffff880127c00000(0000) knlGS:0000000000000000
>>>> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
>>>> CR2: 0000000000000000 CR3: 000000012605a000 CR4: 00000000000406b0
>>>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>>>> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
>>>> Process swapper (pid: 0, threadinfo ffffffff817dc000, task ffffffff81800020)
>>>> Stack:
>>>> ffffffff817dde28 ffffffff8105c769 ffffffff819aebd0 ffffffff819aefd0
>>>> ffffffff819af3d0 ffffffff819af7d0 ffffffff817dde48 000000000000ccc0
>>>> ffff880127c0e2a0 00000000a983c6e8 0000000000000000 000000010000fdf7
>>>> Call Trace:
>>>> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
>>>> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
>>>> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
>>>> [<ffffffff814fd409>] rest_init+0xad/0xb1
>>>> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
>>>> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
>>>> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
>>>> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
>>>> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
>>>> Code: 04 4a 8b 14 30 4d 8d 2c 06 eb 20 4c 89 d0 f6 42 18 01 75 11 48
>>>> 8b 42 10 41 bb 01 00 00 00 4c 39 d0 49 0f 49 c2 48 89 fa 49 89 c2
>>>> 8b 3a 4c 39 ea 0f 18 0f 75 d5 45 85 db 74 10 85 f6 74 04 39
>>>> RIP [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
>>>> RSP <ffffffff817dddf8>
>>>> CR2: 0000000000000000
>>>> ---[ end trace 5621bb82abfeb30f ]---
>>>> Kernel panic - not syncing: Attempted to kill the idle task!
>>>> Pid: 0, comm: swapper Tainted: G D 2.6.39-rc5 #224
>>>> Call Trace:
>>>> [<ffffffff8151a544>] panic+0xb7/0x1c9
>>>> [<ffffffff8103ef48>] do_exit+0xb6/0x7b3
>>>> [<ffffffff8103bd25>] ? kmsg_dump+0x120/0x12f
>>>> [<ffffffff8103bc96>] ? kmsg_dump+0x91/0x12f
>>>> [<ffffffff8151e23f>] oops_end+0xc1/0xc9
>>>> [<ffffffff810228c3>] no_context+0x1f3/0x202
>>>> [<ffffffff81022a8d>] __bad_area_nosemaphore+0x1bb/0x1e1
>>>> [<ffffffff810685c8>] ? mark_lock+0x22/0x261
>>>> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
>>>> [<ffffffff81022ac1>] bad_area_nosemaphore+0xe/0x10
>>>> [<ffffffff815202a3>] do_page_fault+0x20b/0x421
>>>> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
>>>> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
>>>> [<ffffffff8151d020>] ? _raw_spin_unlock_irq+0x2b/0x37
>>>> [<ffffffff812816fd>] ? trace_hardirqs_off_thunk+0x3a/0x3c
>>>> [<ffffffff8151d5e5>] page_fault+0x25/0x30
>>>> [<ffffffff81048988>] ? get_next_timer_interrupt+0x13d/0x21d
>>>> [<ffffffff81048894>] ? get_next_timer_interrupt+0x49/0x21d
>>>> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
>>>> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
>>>> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
>>>> [<ffffffff814fd409>] rest_init+0xad/0xb1
>>>> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
>>>> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
>>>> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
>>>> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
>>>> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
>>>>
>>>> --
>>>> Regards
>>>> dave
>>>> --
>>>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>>>> the body of a message to majordomo@vger.kernel.org
>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>> Please read the FAQ at http://www.tux.org/lkml/
>>>>
>>>
>>>
>>>
>>> --
>>> Only stand for myself
>>>
>>
>>
>>
>> --
>> Regards
>> dave
>>
>
>
>
> --
> Only stand for myself
>
--
Regards
dave
^ permalink raw reply
* Re: kernel panic after unplug usb bluetooth dongle
From: Yong Zhang @ 2011-04-27 7:14 UTC (permalink / raw)
To: Dave Young; +Cc: Bluettooth Linux, Linux Kernel Mailing List, Thomas Gleixner
In-Reply-To: <BANLkTi=kQdvdUAA-RT-UVcpSx7E8domMJw@mail.gmail.com>
On Wed, Apr 27, 2011 at 3:11 PM, Dave Young <hidave.darkstar@gmail.com> wrote:
> On Wed, Apr 27, 2011 at 2:41 PM, Yong Zhang <yong.zhang0@gmail.com> wrote:
>> On Wed, Apr 27, 2011 at 2:35 PM, Dave Young <hidave.darkstar@gmail.com> wrote:
>>> Hi,
>>>
>>> Unplug usb bluetooth dongle make kernel panic as below. Thomas, any
>>> idea about it?
>>>
>>> usb 6-1: USB disconnect, device number 3
>>> btusb_intr_complete: hci0 urb ffff8801275bb9c0 failed to resubmit (19)
>>> btusb_bulk_complete: hci0 urb ffff8801275bb540 failed to resubmit (19)
>>> btusb_bulk_complete: hci0 urb ffff8801275bb6c0 failed to resubmit (19)
>>> btusb_send_frame: hci0 urb ffff8801275bb6c0 submission failed
>>> BUG: unable to handle kernel NULL pointer dereference at (null)
>>> IP: [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
>>
>> Seems a hrtimer is freed abnormaly.
>>
>> Could you try to build your kernel with CONFIG_DEBUG_OBJECTS_TIMERS=y
>>
>
> Tried, did not see any new stuff in dmesg.
So this means you still got the PANIC, but don't see any additional output?
Thanks,
Yong
>
>> Thanks,
>> Yong
>>
>>> PGD 12609c067 PUD 1260b5067 PMD 0
>>> Oops: 0000 [#1] SMP
>>> last sysfs file: /sys/devices/virtual/dmi/id/chassis_type
>>> CPU 0
>>> Modules linked in: tun rfcomm bnep snd_pcm_oss snd_mixer_oss kvm_intel
>>> kvm btusb bluetooth snd_hda_codec_analog snd_hda_intel dell_wmi
>>> sparse_keymap snd_hda_codec snd_hwdep e1000e snd_pcm wmi snd_timer
>>> 8139too rfkill snd_page_alloc
>>>
>>> Pid: 0, comm: swapper Not tainted 2.6.39-rc5 #224 Dell Inc. OptiPlex
>>> 780 /0V4W66
>>> RIP: 0010:[<ffffffff81048988>] [<ffffffff81048988>]
>>> get_next_timer_interrupt+0x13d/0x21d
>>> RSP: 0018:ffffffff817dddf8 EFLAGS: 00010097
>>> RAX: 0000000000000000 RBX: ffffffff819adb80 RCX: 000000000000003e
>>> RDX: 0000000000000000 RSI: 000000000000003e RDI: 0000000000000000
>>> RBP: ffffffff817dde58 R08: ffffffff817dde08 R09: 00000000010000fe
>>> R10: 0000000000000000 R11: 0000000000000001 R12: 000000010000fdf7
>>> R13: ffffffff819aefb0 R14: ffffffff819aebd0 R15: 0000000000000040
>>> FS: 0000000000000000(0000) GS:ffff880127c00000(0000) knlGS:0000000000000000
>>> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
>>> CR2: 0000000000000000 CR3: 000000012605a000 CR4: 00000000000406b0
>>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>>> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
>>> Process swapper (pid: 0, threadinfo ffffffff817dc000, task ffffffff81800020)
>>> Stack:
>>> ffffffff817dde28 ffffffff8105c769 ffffffff819aebd0 ffffffff819aefd0
>>> ffffffff819af3d0 ffffffff819af7d0 ffffffff817dde48 000000000000ccc0
>>> ffff880127c0e2a0 00000000a983c6e8 0000000000000000 000000010000fdf7
>>> Call Trace:
>>> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
>>> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
>>> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
>>> [<ffffffff814fd409>] rest_init+0xad/0xb1
>>> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
>>> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
>>> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
>>> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
>>> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
>>> Code: 04 4a 8b 14 30 4d 8d 2c 06 eb 20 4c 89 d0 f6 42 18 01 75 11 48
>>> 8b 42 10 41 bb 01 00 00 00 4c 39 d0 49 0f 49 c2 48 89 fa 49 89 c2
>>> 8b 3a 4c 39 ea 0f 18 0f 75 d5 45 85 db 74 10 85 f6 74 04 39
>>> RIP [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
>>> RSP <ffffffff817dddf8>
>>> CR2: 0000000000000000
>>> ---[ end trace 5621bb82abfeb30f ]---
>>> Kernel panic - not syncing: Attempted to kill the idle task!
>>> Pid: 0, comm: swapper Tainted: G D 2.6.39-rc5 #224
>>> Call Trace:
>>> [<ffffffff8151a544>] panic+0xb7/0x1c9
>>> [<ffffffff8103ef48>] do_exit+0xb6/0x7b3
>>> [<ffffffff8103bd25>] ? kmsg_dump+0x120/0x12f
>>> [<ffffffff8103bc96>] ? kmsg_dump+0x91/0x12f
>>> [<ffffffff8151e23f>] oops_end+0xc1/0xc9
>>> [<ffffffff810228c3>] no_context+0x1f3/0x202
>>> [<ffffffff81022a8d>] __bad_area_nosemaphore+0x1bb/0x1e1
>>> [<ffffffff810685c8>] ? mark_lock+0x22/0x261
>>> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
>>> [<ffffffff81022ac1>] bad_area_nosemaphore+0xe/0x10
>>> [<ffffffff815202a3>] do_page_fault+0x20b/0x421
>>> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
>>> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
>>> [<ffffffff8151d020>] ? _raw_spin_unlock_irq+0x2b/0x37
>>> [<ffffffff812816fd>] ? trace_hardirqs_off_thunk+0x3a/0x3c
>>> [<ffffffff8151d5e5>] page_fault+0x25/0x30
>>> [<ffffffff81048988>] ? get_next_timer_interrupt+0x13d/0x21d
>>> [<ffffffff81048894>] ? get_next_timer_interrupt+0x49/0x21d
>>> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
>>> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
>>> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
>>> [<ffffffff814fd409>] rest_init+0xad/0xb1
>>> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
>>> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
>>> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
>>> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
>>> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
>>>
>>> --
>>> Regards
>>> dave
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>> Please read the FAQ at http://www.tux.org/lkml/
>>>
>>
>>
>>
>> --
>> Only stand for myself
>>
>
>
>
> --
> Regards
> dave
>
--
Only stand for myself
^ permalink raw reply
* Re: kernel panic after unplug usb bluetooth dongle
From: Dave Young @ 2011-04-27 7:11 UTC (permalink / raw)
To: Yong Zhang; +Cc: Bluettooth Linux, Linux Kernel Mailing List, Thomas Gleixner
In-Reply-To: <BANLkTimfJXQdJHbG7J8frwPrBKOMxVjQUg@mail.gmail.com>
On Wed, Apr 27, 2011 at 2:41 PM, Yong Zhang <yong.zhang0@gmail.com> wrote:
> On Wed, Apr 27, 2011 at 2:35 PM, Dave Young <hidave.darkstar@gmail.com> wrote:
>> Hi,
>>
>> Unplug usb bluetooth dongle make kernel panic as below. Thomas, any
>> idea about it?
>>
>> usb 6-1: USB disconnect, device number 3
>> btusb_intr_complete: hci0 urb ffff8801275bb9c0 failed to resubmit (19)
>> btusb_bulk_complete: hci0 urb ffff8801275bb540 failed to resubmit (19)
>> btusb_bulk_complete: hci0 urb ffff8801275bb6c0 failed to resubmit (19)
>> btusb_send_frame: hci0 urb ffff8801275bb6c0 submission failed
>> BUG: unable to handle kernel NULL pointer dereference at (null)
>> IP: [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
>
> Seems a hrtimer is freed abnormaly.
>
> Could you try to build your kernel with CONFIG_DEBUG_OBJECTS_TIMERS=y
>
Tried, did not see any new stuff in dmesg.
> Thanks,
> Yong
>
>> PGD 12609c067 PUD 1260b5067 PMD 0
>> Oops: 0000 [#1] SMP
>> last sysfs file: /sys/devices/virtual/dmi/id/chassis_type
>> CPU 0
>> Modules linked in: tun rfcomm bnep snd_pcm_oss snd_mixer_oss kvm_intel
>> kvm btusb bluetooth snd_hda_codec_analog snd_hda_intel dell_wmi
>> sparse_keymap snd_hda_codec snd_hwdep e1000e snd_pcm wmi snd_timer
>> 8139too rfkill snd_page_alloc
>>
>> Pid: 0, comm: swapper Not tainted 2.6.39-rc5 #224 Dell Inc. OptiPlex
>> 780 /0V4W66
>> RIP: 0010:[<ffffffff81048988>] [<ffffffff81048988>]
>> get_next_timer_interrupt+0x13d/0x21d
>> RSP: 0018:ffffffff817dddf8 EFLAGS: 00010097
>> RAX: 0000000000000000 RBX: ffffffff819adb80 RCX: 000000000000003e
>> RDX: 0000000000000000 RSI: 000000000000003e RDI: 0000000000000000
>> RBP: ffffffff817dde58 R08: ffffffff817dde08 R09: 00000000010000fe
>> R10: 0000000000000000 R11: 0000000000000001 R12: 000000010000fdf7
>> R13: ffffffff819aefb0 R14: ffffffff819aebd0 R15: 0000000000000040
>> FS: 0000000000000000(0000) GS:ffff880127c00000(0000) knlGS:0000000000000000
>> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
>> CR2: 0000000000000000 CR3: 000000012605a000 CR4: 00000000000406b0
>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
>> Process swapper (pid: 0, threadinfo ffffffff817dc000, task ffffffff81800020)
>> Stack:
>> ffffffff817dde28 ffffffff8105c769 ffffffff819aebd0 ffffffff819aefd0
>> ffffffff819af3d0 ffffffff819af7d0 ffffffff817dde48 000000000000ccc0
>> ffff880127c0e2a0 00000000a983c6e8 0000000000000000 000000010000fdf7
>> Call Trace:
>> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
>> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
>> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
>> [<ffffffff814fd409>] rest_init+0xad/0xb1
>> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
>> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
>> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
>> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
>> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
>> Code: 04 4a 8b 14 30 4d 8d 2c 06 eb 20 4c 89 d0 f6 42 18 01 75 11 48
>> 8b 42 10 41 bb 01 00 00 00 4c 39 d0 49 0f 49 c2 48 89 fa 49 89 c2
>> 8b 3a 4c 39 ea 0f 18 0f 75 d5 45 85 db 74 10 85 f6 74 04 39
>> RIP [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
>> RSP <ffffffff817dddf8>
>> CR2: 0000000000000000
>> ---[ end trace 5621bb82abfeb30f ]---
>> Kernel panic - not syncing: Attempted to kill the idle task!
>> Pid: 0, comm: swapper Tainted: G D 2.6.39-rc5 #224
>> Call Trace:
>> [<ffffffff8151a544>] panic+0xb7/0x1c9
>> [<ffffffff8103ef48>] do_exit+0xb6/0x7b3
>> [<ffffffff8103bd25>] ? kmsg_dump+0x120/0x12f
>> [<ffffffff8103bc96>] ? kmsg_dump+0x91/0x12f
>> [<ffffffff8151e23f>] oops_end+0xc1/0xc9
>> [<ffffffff810228c3>] no_context+0x1f3/0x202
>> [<ffffffff81022a8d>] __bad_area_nosemaphore+0x1bb/0x1e1
>> [<ffffffff810685c8>] ? mark_lock+0x22/0x261
>> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
>> [<ffffffff81022ac1>] bad_area_nosemaphore+0xe/0x10
>> [<ffffffff815202a3>] do_page_fault+0x20b/0x421
>> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
>> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
>> [<ffffffff8151d020>] ? _raw_spin_unlock_irq+0x2b/0x37
>> [<ffffffff812816fd>] ? trace_hardirqs_off_thunk+0x3a/0x3c
>> [<ffffffff8151d5e5>] page_fault+0x25/0x30
>> [<ffffffff81048988>] ? get_next_timer_interrupt+0x13d/0x21d
>> [<ffffffff81048894>] ? get_next_timer_interrupt+0x49/0x21d
>> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
>> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
>> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
>> [<ffffffff814fd409>] rest_init+0xad/0xb1
>> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
>> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
>> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
>> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
>> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
>>
>> --
>> Regards
>> dave
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>>
>
>
>
> --
> Only stand for myself
>
--
Regards
dave
^ permalink raw reply
* Re: kernel panic after unplug usb bluetooth dongle
From: Yong Zhang @ 2011-04-27 6:41 UTC (permalink / raw)
To: Dave Young; +Cc: Bluettooth Linux, Linux Kernel Mailing List, Thomas Gleixner
In-Reply-To: <BANLkTi=UG0Xy2UEkNj2S_bS-PjOG5krNkQ@mail.gmail.com>
On Wed, Apr 27, 2011 at 2:35 PM, Dave Young <hidave.darkstar@gmail.com> wrote:
> Hi,
>
> Unplug usb bluetooth dongle make kernel panic as below. Thomas, any
> idea about it?
>
> usb 6-1: USB disconnect, device number 3
> btusb_intr_complete: hci0 urb ffff8801275bb9c0 failed to resubmit (19)
> btusb_bulk_complete: hci0 urb ffff8801275bb540 failed to resubmit (19)
> btusb_bulk_complete: hci0 urb ffff8801275bb6c0 failed to resubmit (19)
> btusb_send_frame: hci0 urb ffff8801275bb6c0 submission failed
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
Seems a hrtimer is freed abnormaly.
Could you try to build your kernel with CONFIG_DEBUG_OBJECTS_TIMERS=y
Thanks,
Yong
> PGD 12609c067 PUD 1260b5067 PMD 0
> Oops: 0000 [#1] SMP
> last sysfs file: /sys/devices/virtual/dmi/id/chassis_type
> CPU 0
> Modules linked in: tun rfcomm bnep snd_pcm_oss snd_mixer_oss kvm_intel
> kvm btusb bluetooth snd_hda_codec_analog snd_hda_intel dell_wmi
> sparse_keymap snd_hda_codec snd_hwdep e1000e snd_pcm wmi snd_timer
> 8139too rfkill snd_page_alloc
>
> Pid: 0, comm: swapper Not tainted 2.6.39-rc5 #224 Dell Inc. OptiPlex
> 780 /0V4W66
> RIP: 0010:[<ffffffff81048988>] [<ffffffff81048988>]
> get_next_timer_interrupt+0x13d/0x21d
> RSP: 0018:ffffffff817dddf8 EFLAGS: 00010097
> RAX: 0000000000000000 RBX: ffffffff819adb80 RCX: 000000000000003e
> RDX: 0000000000000000 RSI: 000000000000003e RDI: 0000000000000000
> RBP: ffffffff817dde58 R08: ffffffff817dde08 R09: 00000000010000fe
> R10: 0000000000000000 R11: 0000000000000001 R12: 000000010000fdf7
> R13: ffffffff819aefb0 R14: ffffffff819aebd0 R15: 0000000000000040
> FS: 0000000000000000(0000) GS:ffff880127c00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 0000000000000000 CR3: 000000012605a000 CR4: 00000000000406b0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process swapper (pid: 0, threadinfo ffffffff817dc000, task ffffffff81800020)
> Stack:
> ffffffff817dde28 ffffffff8105c769 ffffffff819aebd0 ffffffff819aefd0
> ffffffff819af3d0 ffffffff819af7d0 ffffffff817dde48 000000000000ccc0
> ffff880127c0e2a0 00000000a983c6e8 0000000000000000 000000010000fdf7
> Call Trace:
> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
> [<ffffffff814fd409>] rest_init+0xad/0xb1
> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
> Code: 04 4a 8b 14 30 4d 8d 2c 06 eb 20 4c 89 d0 f6 42 18 01 75 11 48
> 8b 42 10 41 bb 01 00 00 00 4c 39 d0 49 0f 49 c2 48 89 fa 49 89 c2
> 8b 3a 4c 39 ea 0f 18 0f 75 d5 45 85 db 74 10 85 f6 74 04 39
> RIP [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
> RSP <ffffffff817dddf8>
> CR2: 0000000000000000
> ---[ end trace 5621bb82abfeb30f ]---
> Kernel panic - not syncing: Attempted to kill the idle task!
> Pid: 0, comm: swapper Tainted: G D 2.6.39-rc5 #224
> Call Trace:
> [<ffffffff8151a544>] panic+0xb7/0x1c9
> [<ffffffff8103ef48>] do_exit+0xb6/0x7b3
> [<ffffffff8103bd25>] ? kmsg_dump+0x120/0x12f
> [<ffffffff8103bc96>] ? kmsg_dump+0x91/0x12f
> [<ffffffff8151e23f>] oops_end+0xc1/0xc9
> [<ffffffff810228c3>] no_context+0x1f3/0x202
> [<ffffffff81022a8d>] __bad_area_nosemaphore+0x1bb/0x1e1
> [<ffffffff810685c8>] ? mark_lock+0x22/0x261
> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
> [<ffffffff81022ac1>] bad_area_nosemaphore+0xe/0x10
> [<ffffffff815202a3>] do_page_fault+0x20b/0x421
> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
> [<ffffffff8151d020>] ? _raw_spin_unlock_irq+0x2b/0x37
> [<ffffffff812816fd>] ? trace_hardirqs_off_thunk+0x3a/0x3c
> [<ffffffff8151d5e5>] page_fault+0x25/0x30
> [<ffffffff81048988>] ? get_next_timer_interrupt+0x13d/0x21d
> [<ffffffff81048894>] ? get_next_timer_interrupt+0x49/0x21d
> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
> [<ffffffff814fd409>] rest_init+0xad/0xb1
> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
>
> --
> Regards
> dave
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Only stand for myself
^ permalink raw reply
* Re: kernel panic after unplug usb bluetooth dongle
From: Dave Young @ 2011-04-27 6:38 UTC (permalink / raw)
To: Bluettooth Linux, Linux Kernel Mailing List, Thomas Gleixner
In-Reply-To: <BANLkTi=UG0Xy2UEkNj2S_bS-PjOG5krNkQ@mail.gmail.com>
On Wed, Apr 27, 2011 at 2:35 PM, Dave Young <hidave.darkstar@gmail.com> wrote:
> Hi,
>
> Unplug usb bluetooth dongle make kernel panic as below. Thomas, any
> idea about it?
BTW, addr2line -e vmlinux 0xffffffff81048988 show:
kernel/timer.c:1183:
list_for_each_entry(nte, varp->vec + slot, entry) {
>
> usb 6-1: USB disconnect, device number 3
> btusb_intr_complete: hci0 urb ffff8801275bb9c0 failed to resubmit (19)
> btusb_bulk_complete: hci0 urb ffff8801275bb540 failed to resubmit (19)
> btusb_bulk_complete: hci0 urb ffff8801275bb6c0 failed to resubmit (19)
> btusb_send_frame: hci0 urb ffff8801275bb6c0 submission failed
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
> PGD 12609c067 PUD 1260b5067 PMD 0
> Oops: 0000 [#1] SMP
> last sysfs file: /sys/devices/virtual/dmi/id/chassis_type
> CPU 0
> Modules linked in: tun rfcomm bnep snd_pcm_oss snd_mixer_oss kvm_intel
> kvm btusb bluetooth snd_hda_codec_analog snd_hda_intel dell_wmi
> sparse_keymap snd_hda_codec snd_hwdep e1000e snd_pcm wmi snd_timer
> 8139too rfkill snd_page_alloc
>
> Pid: 0, comm: swapper Not tainted 2.6.39-rc5 #224 Dell Inc. OptiPlex
> 780 /0V4W66
> RIP: 0010:[<ffffffff81048988>] [<ffffffff81048988>]
> get_next_timer_interrupt+0x13d/0x21d
> RSP: 0018:ffffffff817dddf8 EFLAGS: 00010097
> RAX: 0000000000000000 RBX: ffffffff819adb80 RCX: 000000000000003e
> RDX: 0000000000000000 RSI: 000000000000003e RDI: 0000000000000000
> RBP: ffffffff817dde58 R08: ffffffff817dde08 R09: 00000000010000fe
> R10: 0000000000000000 R11: 0000000000000001 R12: 000000010000fdf7
> R13: ffffffff819aefb0 R14: ffffffff819aebd0 R15: 0000000000000040
> FS: 0000000000000000(0000) GS:ffff880127c00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 0000000000000000 CR3: 000000012605a000 CR4: 00000000000406b0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process swapper (pid: 0, threadinfo ffffffff817dc000, task ffffffff81800020)
> Stack:
> ffffffff817dde28 ffffffff8105c769 ffffffff819aebd0 ffffffff819aefd0
> ffffffff819af3d0 ffffffff819af7d0 ffffffff817dde48 000000000000ccc0
> ffff880127c0e2a0 00000000a983c6e8 0000000000000000 000000010000fdf7
> Call Trace:
> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
> [<ffffffff814fd409>] rest_init+0xad/0xb1
> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
> Code: 04 4a 8b 14 30 4d 8d 2c 06 eb 20 4c 89 d0 f6 42 18 01 75 11 48
> 8b 42 10 41 bb 01 00 00 00 4c 39 d0 49 0f 49 c2 48 89 fa 49 89 c2
> 8b 3a 4c 39 ea 0f 18 0f 75 d5 45 85 db 74 10 85 f6 74 04 39
> RIP [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
> RSP <ffffffff817dddf8>
> CR2: 0000000000000000
> ---[ end trace 5621bb82abfeb30f ]---
> Kernel panic - not syncing: Attempted to kill the idle task!
> Pid: 0, comm: swapper Tainted: G D 2.6.39-rc5 #224
> Call Trace:
> [<ffffffff8151a544>] panic+0xb7/0x1c9
> [<ffffffff8103ef48>] do_exit+0xb6/0x7b3
> [<ffffffff8103bd25>] ? kmsg_dump+0x120/0x12f
> [<ffffffff8103bc96>] ? kmsg_dump+0x91/0x12f
> [<ffffffff8151e23f>] oops_end+0xc1/0xc9
> [<ffffffff810228c3>] no_context+0x1f3/0x202
> [<ffffffff81022a8d>] __bad_area_nosemaphore+0x1bb/0x1e1
> [<ffffffff810685c8>] ? mark_lock+0x22/0x261
> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
> [<ffffffff81022ac1>] bad_area_nosemaphore+0xe/0x10
> [<ffffffff815202a3>] do_page_fault+0x20b/0x421
> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
> [<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
> [<ffffffff8151d020>] ? _raw_spin_unlock_irq+0x2b/0x37
> [<ffffffff812816fd>] ? trace_hardirqs_off_thunk+0x3a/0x3c
> [<ffffffff8151d5e5>] page_fault+0x25/0x30
> [<ffffffff81048988>] ? get_next_timer_interrupt+0x13d/0x21d
> [<ffffffff81048894>] ? get_next_timer_interrupt+0x49/0x21d
> [<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
> [<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
> [<ffffffff81001e77>] cpu_idle+0x2f/0x9a
> [<ffffffff814fd409>] rest_init+0xad/0xb1
> [<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
> [<ffffffff818b0c49>] start_kernel+0x399/0x3a4
> [<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
> [<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
> [<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
>
> --
> Regards
> dave
>
--
Regards
dave
^ permalink raw reply
* kernel panic after unplug usb bluetooth dongle
From: Dave Young @ 2011-04-27 6:35 UTC (permalink / raw)
To: Bluettooth Linux, Linux Kernel Mailing List, Thomas Gleixner
Hi,
Unplug usb bluetooth dongle make kernel panic as below. Thomas, any
idea about it?
usb 6-1: USB disconnect, device number 3
btusb_intr_complete: hci0 urb ffff8801275bb9c0 failed to resubmit (19)
btusb_bulk_complete: hci0 urb ffff8801275bb540 failed to resubmit (19)
btusb_bulk_complete: hci0 urb ffff8801275bb6c0 failed to resubmit (19)
btusb_send_frame: hci0 urb ffff8801275bb6c0 submission failed
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
PGD 12609c067 PUD 1260b5067 PMD 0
Oops: 0000 [#1] SMP
last sysfs file: /sys/devices/virtual/dmi/id/chassis_type
CPU 0
Modules linked in: tun rfcomm bnep snd_pcm_oss snd_mixer_oss kvm_intel
kvm btusb bluetooth snd_hda_codec_analog snd_hda_intel dell_wmi
sparse_keymap snd_hda_codec snd_hwdep e1000e snd_pcm wmi snd_timer
8139too rfkill snd_page_alloc
Pid: 0, comm: swapper Not tainted 2.6.39-rc5 #224 Dell Inc. OptiPlex
780 /0V4W66
RIP: 0010:[<ffffffff81048988>] [<ffffffff81048988>]
get_next_timer_interrupt+0x13d/0x21d
RSP: 0018:ffffffff817dddf8 EFLAGS: 00010097
RAX: 0000000000000000 RBX: ffffffff819adb80 RCX: 000000000000003e
RDX: 0000000000000000 RSI: 000000000000003e RDI: 0000000000000000
RBP: ffffffff817dde58 R08: ffffffff817dde08 R09: 00000000010000fe
R10: 0000000000000000 R11: 0000000000000001 R12: 000000010000fdf7
R13: ffffffff819aefb0 R14: ffffffff819aebd0 R15: 0000000000000040
FS: 0000000000000000(0000) GS:ffff880127c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000000 CR3: 000000012605a000 CR4: 00000000000406b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffffffff817dc000, task ffffffff81800020)
Stack:
ffffffff817dde28 ffffffff8105c769 ffffffff819aebd0 ffffffff819aefd0
ffffffff819af3d0 ffffffff819af7d0 ffffffff817dde48 000000000000ccc0
ffff880127c0e2a0 00000000a983c6e8 0000000000000000 000000010000fdf7
Call Trace:
[<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
[<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
[<ffffffff81001e77>] cpu_idle+0x2f/0x9a
[<ffffffff814fd409>] rest_init+0xad/0xb1
[<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
[<ffffffff818b0c49>] start_kernel+0x399/0x3a4
[<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
[<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
[<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
Code: 04 4a 8b 14 30 4d 8d 2c 06 eb 20 4c 89 d0 f6 42 18 01 75 11 48
8b 42 10 41 bb 01 00 00 00 4c 39 d0 49 0f 49 c2 48 89 fa 49 89 c2
8b 3a 4c 39 ea 0f 18 0f 75 d5 45 85 db 74 10 85 f6 74 04 39
RIP [<ffffffff81048988>] get_next_timer_interrupt+0x13d/0x21d
RSP <ffffffff817dddf8>
CR2: 0000000000000000
---[ end trace 5621bb82abfeb30f ]---
Kernel panic - not syncing: Attempted to kill the idle task!
Pid: 0, comm: swapper Tainted: G D 2.6.39-rc5 #224
Call Trace:
[<ffffffff8151a544>] panic+0xb7/0x1c9
[<ffffffff8103ef48>] do_exit+0xb6/0x7b3
[<ffffffff8103bd25>] ? kmsg_dump+0x120/0x12f
[<ffffffff8103bc96>] ? kmsg_dump+0x91/0x12f
[<ffffffff8151e23f>] oops_end+0xc1/0xc9
[<ffffffff810228c3>] no_context+0x1f3/0x202
[<ffffffff81022a8d>] __bad_area_nosemaphore+0x1bb/0x1e1
[<ffffffff810685c8>] ? mark_lock+0x22/0x261
[<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
[<ffffffff81022ac1>] bad_area_nosemaphore+0xe/0x10
[<ffffffff815202a3>] do_page_fault+0x20b/0x421
[<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
[<ffffffff8106a49c>] ? __lock_acquire+0xe05/0xe14
[<ffffffff8151d020>] ? _raw_spin_unlock_irq+0x2b/0x37
[<ffffffff812816fd>] ? trace_hardirqs_off_thunk+0x3a/0x3c
[<ffffffff8151d5e5>] page_fault+0x25/0x30
[<ffffffff81048988>] ? get_next_timer_interrupt+0x13d/0x21d
[<ffffffff81048894>] ? get_next_timer_interrupt+0x49/0x21d
[<ffffffff8105c769>] ? sched_clock_local+0x1c/0x80
[<ffffffff810652c4>] tick_nohz_stop_sched_tick+0x370/0x390
[<ffffffff81001e77>] cpu_idle+0x2f/0x9a
[<ffffffff814fd409>] rest_init+0xad/0xb1
[<ffffffff814fd35c>] ? csum_partial_copy_generic+0x16c/0x16c
[<ffffffff818b0c49>] start_kernel+0x399/0x3a4
[<ffffffff818b0140>] ? early_idt_handlers+0x140/0x140
[<ffffffff818b02af>] x86_64_start_reservations+0xb6/0xba
[<ffffffff818b03b3>] x86_64_start_kernel+0x100/0x10f
--
Regards
dave
^ permalink raw reply
* Re: [BUG] bluetooth doesn't work from 2.6.39-rc1+ to 2.6.39-rc3+
From: Dave Young @ 2011-04-27 2:55 UTC (permalink / raw)
To: Ed Tomlinson; +Cc: Hui Zhu, linux-kernel, Bluettooth Linux
In-Reply-To: <201104240952.14848.edt@aei.ca>
On Sun, Apr 24, 2011 at 9:52 PM, Ed Tomlinson <edt@aei.ca> wrote:
> On Tuesday 19 April 2011 11:34:30 Hui Zhu wrote:
>> Do you part is OK?
>>
>> I think it will be very easy to reproduce.
>>
>> Thanks,
>> Hui
>>
>> On Tue, Apr 19, 2011 at 15:46, Dave Young <hidave.darkstar@gmail.com> wrote:
>> > On Tue, Apr 19, 2011 at 10:53 AM, Hui Zhu <teawater@gmail.com> wrote:
>> >> Cannot connect to any outside devices through bluetooth.
>> >>
>> >> And I think this is not a bug of low level driver. Because both my
>> >> laptop and a usb bluetooth card cannot work.
>> >
>> > Hi, please explain the "cannot work" in detail,
>> > Firstly check dmesg and hciconfig to see if there's anything wrong.
>
> I am also seeing problems with bluetooth in .39-rc4+
>
> [54511.033258] usb 2-4.4: USB disconnect, device number 5
> [54513.920060] usb 2-4.3: new full speed USB device number 6 using ehci_hcd
> [54514.063057] usb 2-4.3: New USB device found, idVendor=0a12, idProduct=0001
> [54514.070281] usb 2-4.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> grover ~ # hciconfig -a
> hci0: Type: BR/EDR Bus: USB
> BD Address: 00:0A:3A:55:07:5A ACL MTU: 192:8 SCO MTU: 64:8
> DOWN
> RX bytes:718 acl:0 sco:0 events:25 errors:0
> TX bytes:108 acl:0 sco:0 commands:24 errors:0
> Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
> Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
> Link policy: CONFIG_BT_HCIBTUSB=m
> Link mode: SLAVE ACCEPT
>
> grover ~ # hciconfig hci0 up
> Can't init device hci0: Invalid argument (22)
>
> The same error happens If I just try a hciconfig hci0 up after boot (without replugging the adaptor).
I did not see your problem, my usb dongle usbid is 0a12:0001 as well,
maybe bisect is the way to go.
>
> CONFIG_BT_HCIBTSDIO=m
> CONFIG_BT_HCIUART=m
> CONFIG_BT_HCIUART_H4=y
> CONFIG_BT_HCIUART_BCSP=y
> # CONFIG_BT_HCIUART_ATH3K is not set
> CONFIG_BT_HCIUART_LL=y
> CONFIG_BT_HCIBCM203X=m
> CONFIG_BT_HCIBPA10X=m
> CONFIG_BT_HCIBFUSB=m
> CONFIG_BT_HCIVHCI=m
>
> and bluez-4.91 is installed
>
> Ideas?
> Ed Tomlinson
>
--
Regards
dave
^ permalink raw reply
* Re: [PATCH v2 6/6] Bluetooth: Respect local MITM req in io_cap reply
From: Johan Hedberg @ 2011-04-26 23:59 UTC (permalink / raw)
To: Waldemar Rymarkiewicz; +Cc: linux-bluetooth, padovan
In-Reply-To: <1303372461-11848-6-git-send-email-waldemar.rymarkiewicz@tieto.com>
Hi Waldek,
On Thu, Apr 21, 2011, Waldemar Rymarkiewicz wrote:
> If host requires MITM protection notify that to controller in
> io capabilities reply even if the remote device requires no bonding.
>
> If it is not respected, host can get an unauthenticated link key while
> it expects authenticated one.
>
> Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
> ---
> net/bluetooth/hci_event.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 087953e..3ee0060 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -2369,7 +2369,7 @@ static inline u8 hci_get_auth_req(struct hci_conn *conn)
>
> /* If remote requests no-bonding follow that lead */
> if (conn->remote_auth == 0x00 || conn->remote_auth == 0x01)
> - return 0x00;
> + return conn->auth_type & 0x01;
I had to change this to:
return conn->remote_auth | (conn->auth_type & 0x01);
I.e. follow remote requirement and apply the MITM bit to it if the local
requirement has it. Otherwise TP/SEC/SEM/BV-04-C doesn't want to pass
(test vector used is 1.0.39.0). It seems to require us to mirror the
remote MITM requirement. Not sure why hciops is working and I haven't
had the chance to check the logs there. I'm still continuing testing so
we'll see if there are further issues with other test cases.
Johan
^ permalink raw reply
* RE: [PATCH] linux-firmware: Add sysconfig file
From: Jothikumar Mothilal @ 2011-04-26 21:00 UTC (permalink / raw)
To: dwmw2@infradead.org
Cc: Shanmugamkamatchi Balashanmugam, linux-bluetooth@vger.kernel.org
In-Reply-To: <1302507848-3197-1-git-send-email-jkumar@atheros.com>
Hi David,
-----Original Message-----
>From: Jothikumar Mothilal
>Sent: Monday, April 11, 2011 1:14 PM
>To: dwmw2@infradead.org
>Cc: Jothikumar Mothilal; Shanmugamkamatchi Balashanmugam
>Subject: [PATCH] linux-firmware: Add sysconfig file
>
>Added sysconfig file for new clock frequency.
>Signed-off-by: Jothikumar Mothilal <jkumar@atheros.com>
>---
>WHENCE | 1 +
> ar3k/ramps_0x01020200_40.dfu | Bin 0 -> 1204 bytes
> 2 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 ar3k/ramps_0x01020200_40.dfu
>
>diff --git a/WHENCE b/WHENCE
>index f6a0ec1..9c682bf 100644
>--- a/WHENCE
>+++ b/WHENCE
>@@ -1557,6 +1557,7 @@ File: ar3k/AthrBT_0x01020001.dfu
> File: ar3k/ramps_0x01020001_26.dfu
> File: ar3k/AthrBT_0x01020200.dfu
> File: ar3k/ramps_0x01020200_26.dfu
>+File: ar3k/ramps_0x01020200_40.dfu
>
> Licence: Redistributable. See LICENCE.atheros_firmware for details
>
>diff --git a/ar3k/ramps_0x01020200_40.dfu b/ar3k/ramps_0x01020200_40.dfu new file mode 100644 index >0000000000000000000000000000000000000000..02166c073dff1feebb4307294db7a95d837eb107
>GIT binary patch
>literal 1204
>zcmXxiTTC2P7zgnG%+AN0p-Wj{El5D8mZE8wOVk+CK$pfQwxlt{U_|6$lM-4hE5!If
>zOqFdyA|ek2No))c`(TKd)<Q!F52P#&4`@!Bf<BPantiC&OKCTz4~=$u{BPHu&Hm1r
>z@7%tbbI|-23`^R<qhizZ|7>3gv!41t28_v=6SMAMZmt~j>fyupu?z5Rggr!oamB%H
>zDK!LGBdTH0KRBxV_~`LMd`flh?VUWU)?SM>POG-IYq5-4D6z1r`nML6YijGIpORW7
>z*oN1ENyqX0qev+)JMi|eh4mxenNV{s>ZMYzpvvQ3shYg-y?nNB0tp+AySnljY5<wA
>zPNJ_bYxP6xFphEb@$ImS5}+BIgLm6cV|Jr^ZV118*o7Wgh+2oaO62AU;<;N+1`}2c
>z*Rk1Fga#{zQM{gP-8qFrMO+B}^cp5`<Hi?7oyg93h`6n3v_{=@%0iV}`Nn#<#!c?w
>za?;LJ92uiZexzY3uH`P$PNP!INR@Qc8u^m?a*ftWHG7|vZW@z)j5NzB`l5VGUzR^<
>zi|k`>o1CJD<p3i`WIsJ7@6rzWj&{mlv`hALOpo-?gv1!>m413s&e49UWqeQ?*#1D0
>zbV$zAM(b~!mTk6D(!dcTlBA>3%E-8UL?`5XIwg1LS!rbNw7f^ta*&a)<YW4^T%zZs
>ziO$LZotF!AQSQ<uY2x^d4A51%K-XlMA5Dv4?^TIgz|S&FH)WY#7eliW=W*YZ;d0=2
>zS!VmT7@CuK2)HN1^u8?92V!Xc^4f^Nx{`@R;qo!<;13g8a?BxKR3>0!(PE8@7b}p%
z%8G9<@oq0NkvYqU(YAK5@b5Ph*o~~wN<W3v2;43Cyv*pGTH&@y^HwwkD@6{HLC*Nx>
>zq$Ai}?_eOfXYi_n13~J9gHMC|COhMxJV<|{&=ou|nHhz?AmMu05ipT@54Az!*%E{
>z2mY-Hyr7_hf1->t3L0IiEf&`ay@2BU3nr2|^yOcH#psBB=1jUYjpt#j;$Gh`Hok9k
>z8Rr;Xu04xi#h8%M721AsaYq#6s4UF}g<n??4f6lay=Cdiy26SD?Ow+Y8He+#wPQcd
>z?{Q{ES7{3((PE=3wa=Y)X%|1t&NH7VdyIa9D%Q2E^Q8(cEfsiYoagbI(R*~}=+z@e
>iU%p(4daSSeur1pQqwZ-Qvz0%l{2S+I^5IcyW8*)wU^<Tg
>
>literal 0
>HcmV?d00001
>
>--
>1.6.3.3
>
This is my next firmware patch to add upstream. Let me know if you have any issue.
Thanks,
Jothi
^ permalink raw reply
* RE: [PATCH] linux-firmware: Add patch and sysconfig files
From: Jothikumar Mothilal @ 2011-04-26 20:54 UTC (permalink / raw)
To: dwmw2@infradead.org
Cc: linux-bluetooth@vger.kernel.org, Shanmugamkamatchi Balashanmugam
In-Reply-To: <44EE5C37ADC36343B0625A05DD408C4850EF09CA00@CHEXMB-01.global.atheros.com>
Hi David,
>-----Original Message-----
>From: Jothikumar Mothilal
>Sent: Thursday, April 07, 2011 3:29 PM
>To: Jothikumar Mothilal; dwmw2@infradead.org
>Cc: linux-bluetooth@vger.kernel.org; Shanmugamkamatchi Balashanmugam
>Subject: RE: [PATCH] linux-firmware: Add patch and sysconfig files
>
>Hi David,
>
-----Original Message-----
>From: Jothikumar Mothilal
>Sent: Monday, April 04, 2011 12:29 PM
>To: Jothikumar Mothilal; dwmw2@infradead.org
>Cc: linux-bluetooth@vger.kernel.org; Shanmugamkamatchi Balashanmugam
>Subject: RE: [PATCH] linux-firmware: Add patch and sysconfig files
>Hi David,
-----Original Message-----
From: Jothikumar Mothilal
Sent: Friday, April 01, 2011 2:45 PM
To: dwmw2@infradead.org
Cc: linux-bluetooth@vger.kernel.org; Shanmugamkamatchi Balashanmugam; Jothikumar Mothilal
>Subject: [PATCH] linux-firmware: Add patch and sysconfig files
>Added files for AR3012 version 2.2
>Signed-off-by: Jothikumar Mothilal <jkumar@atheros.com>
>---
> WHENCE | 2 ++
> ar3k/AthrBT_0x01020200.dfu | Bin 0 -> 40596 bytes
> ar3k/ramps_0x01020200_26.dfu | Bin 0 -> 1262 bytes
> 3 files changed, 2 insertions(+), 0 deletions(-)
> create mode 100644 ar3k/AthrBT_0x01020200.dfu
>create mode 100644 ar3k/ramps_0x01020200_26.dfu
>diff --git a/WHENCE b/WHENCE
>index 6632b85..f6a0ec1 100644
>--- a/WHENCE
>+++ b/WHENCE
>@@ -1555,6 +1555,8 @@ Driver: DFU Driver for Atheros bluetooth chipset AR3012
> File: ar3k/AthrBT_0x01020001.dfu
> File: ar3k/ramps_0x01020001_26.dfu
>+File: ar3k/AthrBT_0x01020200.dfu
>+File: ar3k/ramps_0x01020200_26.dfu
>Licence: Redistributable. See LICENCE.atheros_firmware for details
>diff --git a/ar3k/AthrBT_0x01020200.dfu b/ar3k/AthrBT_0x01020200.dfu
>new file mode 100644
> literal 0
>HcmV?d00001
> --
> 1.6.3.3
>Can you please push this firmware patch upstream if you have no comments.
Did you get a chance to push this firmware patch upstream?
Please let me know if you have any issue.
Thanks,
Jothi
^ permalink raw reply
* Re: [PATCH] Fix segfault when removing device
From: Johan Hedberg @ 2011-04-26 20:26 UTC (permalink / raw)
To: Bruna Moreira; +Cc: linux-bluetooth
In-Reply-To: <1303757290-4147-1-git-send-email-bruna.moreira@openbossa.org>
Hi Bruna,
On Mon, Apr 25, 2011, Bruna Moreira wrote:
> The device_register_services() function uses g_slist_concat(), therefore
> the passed list should not be freed. The primary_cb() function from GATT
> library was freeing the services list using discover_primary_free(). To
> fix this, the device_register_services() function receives a copy of
> services list if called from inside a gatt_discover_primary() callback.
> ---
> src/device.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH] Check session->msg at sync_getphonebook_callback() in file client/sync.c
From: Vinicius Costa Gomes @ 2011-04-26 18:41 UTC (permalink / raw)
To: Zheng, Wu; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <CE761E84DADF2947A4AF22FB8D97A47357356695@shsmsx501.ccr.corp.intel.com>
Hi,
On 11:03 Tue 26 Apr, Zheng, Wu wrote:
> Otherwise,session->msg will be NULL and cause segmentation fault error.The reason is that the condition of transfer->fd>0 && session->msg is ok and session->msg will be set to NULL in the func of session_notify_progress when sync profile is used.
Please try to keep your commit title to less than 72 characters (if possible
less than 50) and the commit message to less than 72 characters.
>
> ---
> client/sync.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/client/sync.c b/client/sync.c
> index 3622a3d..28ace61 100644
> --- a/client/sync.c
> +++ b/client/sync.c
> @@ -78,6 +78,9 @@ static void sync_getphonebook_callback(struct session_data *session,
> DBusMessage *reply;
> char *buf = NULL;
>
> + if (session->msg == NULL)
> + goto done;
> +
> reply = dbus_message_new_method_return(session->msg);
>
> if (transfer->filled > 0)
> @@ -91,6 +94,8 @@ static void sync_getphonebook_callback(struct session_data *session,
> g_dbus_send_message(session->conn, reply);
> dbus_message_unref(session->msg);
> session->msg = NULL;
Add an empty line here.
> +done:
> + transfer_unregister(transfer);
There's a trailing space here.
Also, taking a look at the code, if the reply is big enough (is it possible?),
the callback could be called more than one time for one transfer, right? Seems
it would cause some unexpected problems.
> }
>
> static DBusMessage *sync_getphonebook(DBusConnection *connection,
> --
> 1.7.3.4
>
> --
> 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
Cheers,
--
Vinicius
^ permalink raw reply
* Re: [BUG] bluetooth doesn't work from 2.6.39-rc1+ to 2.6.39-rc3+
From: Gustavo F. Padovan @ 2011-04-26 16:13 UTC (permalink / raw)
To: Ed Tomlinson; +Cc: Hui Zhu, Dave Young, linux-kernel, Bluettooth Linux
In-Reply-To: <201104240952.14848.edt@aei.ca>
* Ed Tomlinson <edt@aei.ca> [2011-04-24 09:52:14 -0400]:
> On Tuesday 19 April 2011 11:34:30 Hui Zhu wrote:
> > Do you part is OK?
> >
> > I think it will be very easy to reproduce.
> >
> > Thanks,
> > Hui
> >
> > On Tue, Apr 19, 2011 at 15:46, Dave Young <hidave.darkstar@gmail.com> wrote:
> > > On Tue, Apr 19, 2011 at 10:53 AM, Hui Zhu <teawater@gmail.com> wrote:
> > >> Cannot connect to any outside devices through bluetooth.
> > >>
> > >> And I think this is not a bug of low level driver. Because both my
> > >> laptop and a usb bluetooth card cannot work.
> > >
> > > Hi, please explain the "cannot work" in detail,
> > > Firstly check dmesg and hciconfig to see if there's anything wrong.
>
> I am also seeing problems with bluetooth in .39-rc4+
>
> [54511.033258] usb 2-4.4: USB disconnect, device number 5
> [54513.920060] usb 2-4.3: new full speed USB device number 6 using ehci_hcd
> [54514.063057] usb 2-4.3: New USB device found, idVendor=0a12, idProduct=0001
> [54514.070281] usb 2-4.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> grover ~ # hciconfig -a
> hci0: Type: BR/EDR Bus: USB
> BD Address: 00:0A:3A:55:07:5A ACL MTU: 192:8 SCO MTU: 64:8
> DOWN
> RX bytes:718 acl:0 sco:0 events:25 errors:0
> TX bytes:108 acl:0 sco:0 commands:24 errors:0
> Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
> Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
> Link policy: CONFIG_BT_HCIBTUSB=m
> Link mode: SLAVE ACCEPT
>
> grover ~ # hciconfig hci0 up
> Can't init device hci0: Invalid argument (22)
does dmesg show something? I'm using a -rc kernel and bluetooth is working to
me.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox