[PATCH] Bluetooth: Convert internal SCO spinlock into a mutex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Marcel Holtmann <marcel@xxxxxxxxxxxx>
---
 net/bluetooth/sco.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 4d67b0354d23..e35be32ab0b5 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -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;
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux