Skip to contentSkip to conversation

Bluetooth: Convert internal SCO spinlock into a mutex

PATCH New Marcel Holtmann 1 participant 1 message Jul 13, 2014

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Convert internal SCO spinlock into a mutex

Since the HCI even processing is done in a workqueue, there is no need to use a spinlock inside the SCO support. Convert this into a mutex.

---
 net/bluetooth/sco.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
net/bluetooth/sco.c +4 -4
index 4d67b0354d23..e35be32ab0b5 100644
@@ -44,14 +44,14 @@ static struct bt_sock_list sco_sk_list = {
 struct sco_conn {
 	struct hci_conn	*hcon;
 
-	spinlock_t	lock;
+	struct mutex	lock;
 	struct sock	*sk;
 
 	unsigned int    mtu;
 };
 
-#define sco_conn_lock(c)	spin_lock(&c->lock);
-#define sco_conn_unlock(c)	spin_unlock(&c->lock);
+#define sco_conn_lock(c)	mutex_lock(&c->lock);
+#define sco_conn_unlock(c)	mutex_unlock(&c->lock);
 
 static void sco_sock_close(struct sock *sk);
 static void sco_sock_kill(struct sock *sk);
@@ -112,7 +112,7 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon)
 	if (!conn)
 		return NULL;
 
-	spin_lock_init(&conn->lock);
+	mutex_init(&conn->lock);
 
 	hcon->sco_data = conn;
 	conn->hcon = hcon;
Signature · 1 line
1.9.3