Skip to contentSkip to conversation

Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open()

PATCH Applied David Herrmann 3 participants 15 messages Jan 7, 2012 – Jan 8, 2012 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open()

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl() handler and therefore can sleep.

---
 drivers/bluetooth/hci_ll.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/bluetooth/hci_ll.c +1 -1
index 7e4b435..b874c0e 100644
@@ -125,7 +125,7 @@ static int ll_open(struct hci_uart *hu)
 
 	BT_DBG("hu %p", hu);
 
-	ll = kzalloc(sizeof(*ll), GFP_ATOMIC);
+	ll = kzalloc(sizeof(*ll), GFP_KERNEL);
 	if (!ll)
 		return -ENOMEM;
 
Signature · 1 line
1.7.8.1
#1 lore raw

PATCH 1/1 Bluetooth: hci-uart-h4: Use GFP_ATOMIC in open()

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler and therefore can sleep.

---
 drivers/bluetooth/hci_h4.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/bluetooth/hci_h4.c +1 -1
index 2fcd8b3..7483294 100644
@@ -69,7 +69,7 @@ static int h4_open(struct hci_uart *hu)
 
 	BT_DBG("hu %p", hu);
 
-	h4 = kzalloc(sizeof(*h4), GFP_ATOMIC);
+	h4 = kzalloc(sizeof(*h4), GFP_KERNEL);
 	if (!h4)
 		return -ENOMEM;
 
Signature · 1 line
1.7.8.1
#4 lore raw

PATCH 1/1 Bluetooth: hci-uart-bcsp: Use GFP_ATOMIC in open()

In reply to David Herrmann

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler and therefore can sleep.

---
 drivers/bluetooth/hci_bcsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/bluetooth/hci_bcsp.c +1 -1
index 9c5b2dc..8bf0c3e 100644
@@ -692,7 +692,7 @@ static int bcsp_open(struct hci_uart *hu)
 
 	BT_DBG("hu %p", hu);
 
-	bcsp = kzalloc(sizeof(*bcsp), GFP_ATOMIC);
+	bcsp = kzalloc(sizeof(*bcsp), GFP_KERNEL);
 	if (!bcsp)
 		return -ENOMEM;
 
Signature · 1 line
1.7.8.1
#7 lore raw

PATCH 1/1 Bluetooth: hci-uart-ath: Use GFP_ATOMIC in open()

In reply to David Herrmann

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler and therefore can sleep.

---
 drivers/bluetooth/hci_ath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/bluetooth/hci_ath.c +1 -1
index 4093935..12172a6 100644
@@ -112,7 +112,7 @@ static int ath_open(struct hci_uart *hu)
 
 	BT_DBG("hu %p", hu);
 
-	ath = kzalloc(sizeof(*ath), GFP_ATOMIC);
+	ath = kzalloc(sizeof(*ath), GFP_KERNEL);
 	if (!ath)
 		return -ENOMEM;
 
Signature · 1 line
1.7.8.1
#10 lore raw

PATCH 1/1 Bluetooth: dtl1: Fix memleak in probe()

In reply to David Herrmann

We currently leak the driver info structure if dtl1_config fails. If we add a kfree() to dtl1_release to fix this, then dtl1_release and dtl1_detach are identical so this merges both functions.

---
 drivers/bluetooth/dtl1_cs.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)
drivers/bluetooth/dtl1_cs.c +3 -17
index 969bb22..b2db5e9 100644
@@ -83,9 +83,6 @@ typedef struct dtl1_info_t {
 
 
 static int dtl1_config(struct pcmcia_device *link);
-static void dtl1_release(struct pcmcia_device *link);
-
-static void dtl1_detach(struct pcmcia_device *p_dev);
 
 
 /* Transmit states  */
@@ -579,8 +576,8 @@ static void dtl1_detach(struct pcmcia_device *link)
 {
 	dtl1_info_t *info = link->priv;
 
-	dtl1_release(link);
-
+	dtl1_close(info);
+	pcmcia_disable_device(link);
 	kfree(info);
 }
 
@@ -619,21 +616,10 @@ static int dtl1_config(struct pcmcia_device *link)
 	return 0;
 
 failed:
-	dtl1_release(link);
+	dtl1_detach(link);
 	return -ENODEV;
 }
 
-
-static void dtl1_release(struct pcmcia_device *link)
-{
-	dtl1_info_t *info = link->priv;
-
-	dtl1_close(info);
-
-	pcmcia_disable_device(link);
-}
-
-
 static const struct pcmcia_device_id dtl1_ids[] = {
 	PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d),
 	PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-4", 0xe1bfdd64, 0x9102bc82),
Signature · 1 line
1.7.8.1
maintainer Acked-by on v1 1/1
#13 lore raw
In reply to David Herrmann

Hi David,

Quoted 8 lines

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl() handler and therefore can sleep.

---
 drivers/bluetooth/hci_ll.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Regards

Marcel

maintainer Acked-by on v1 1/1
#2 lore raw

Re: [PATCH] Bluetooth: hci-uart-h4: Use GFP_ATOMIC in open()

In reply to David Herrmann

Hi David,

Quoted 8 lines

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler and therefore can sleep.

---
 drivers/bluetooth/hci_h4.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Regards

Marcel

maintainer Acked-by on v1 1/1
#5 lore raw

Re: [PATCH] Bluetooth: hci-uart-bcsp: Use GFP_ATOMIC in open()

In reply to David Herrmann

Hi David,

Quoted 8 lines

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler and therefore can sleep.

---
 drivers/bluetooth/hci_bcsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Regards

Marcel

maintainer Acked-by on v1 1/1
#8 lore raw

Re: [PATCH] Bluetooth: hci-uart-ath: Use GFP_ATOMIC in open()

In reply to David Herrmann

Hi David,

Quoted 8 lines

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler and therefore can sleep.

---
 drivers/bluetooth/hci_ath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Regards

Marcel

maintainer Acked-by on v1 1/1
#11 lore raw

Re: [PATCH] Bluetooth: dtl1: Fix memleak in probe()

In reply to David Herrmann

Hi David,

Quoted 8 lines

We currently leak the driver info structure if dtl1_config fails. If we add a kfree() to dtl1_release to fix this, then dtl1_release and dtl1_detach are identical so this merges both functions.

---
 drivers/bluetooth/dtl1_cs.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)

Regards

Marcel

#14 lore raw
In reply to David Herrmann

Hi David,

Quoted 8 lines · David Herrmann

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl() handler and therefore can sleep.

---
 drivers/bluetooth/hci_ll.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

#3 lore raw

Re: [PATCH] Bluetooth: hci-uart-h4: Use GFP_ATOMIC in open()

In reply to David Herrmann

Hi David,

Quoted 8 lines · David Herrmann

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler and therefore can sleep.

---
 drivers/bluetooth/hci_h4.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

#6 lore raw

Re: [PATCH] Bluetooth: hci-uart-bcsp: Use GFP_ATOMIC in open()

In reply to David Herrmann

Hi David,

Quoted 8 lines · David Herrmann

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler and therefore can sleep.

---
 drivers/bluetooth/hci_bcsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

#9 lore raw

Re: [PATCH] Bluetooth: hci-uart-ath: Use GFP_ATOMIC in open()

In reply to David Herrmann

Hi David,

Quoted 8 lines · David Herrmann

The uart_proto open() callback is not called in atomic context so we can safely sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler and therefore can sleep.

---
 drivers/bluetooth/hci_ath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

#12 lore raw

Re: [PATCH] Bluetooth: dtl1: Fix memleak in probe()

In reply to David Herrmann

Hi David,

Quoted 8 lines · David Herrmann

We currently leak the driver info structure if dtl1_config fails. If we add a kfree() to dtl1_release to fix this, then dtl1_release and dtl1_detach are identical so this merges both functions.

---
 drivers/bluetooth/dtl1_cs.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan