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

Subsystems: bluetooth drivers, the rest

STALE5358d

15 messages, 3 authors, 2012-01-08 · open the first message on its own page

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

From: David Herrmann <hidden>
Date: 2012-01-07 14:19:37

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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_ll.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 7e4b435..b874c0e 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -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;
 
-- 
1.7.8.1

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

From: David Herrmann <hidden>
Date: 2012-01-07 14:19:38

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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_h4.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index 2fcd8b3..7483294 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -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;
 
-- 
1.7.8.1

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

From: David Herrmann <hidden>
Date: 2012-01-07 14:19:39

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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_bcsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 9c5b2dc..8bf0c3e 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -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;
 
-- 
1.7.8.1

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

From: David Herrmann <hidden>
Date: 2012-01-07 14:19:40

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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_ath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c
index 4093935..12172a6 100644
--- a/drivers/bluetooth/hci_ath.c
+++ b/drivers/bluetooth/hci_ath.c
@@ -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;
 
-- 
1.7.8.1

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

From: David Herrmann <hidden>
Date: 2012-01-07 14:19:41

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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/dtl1_cs.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 969bb22..b2db5e9 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -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),
-- 
1.7.8.1

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

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-01-07 21:03:03

Hi David,
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_ll.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel

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

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-01-07 21:03:25

Hi David,
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_h4.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel

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

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-01-07 21:03:47

Hi David,
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_bcsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel

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

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-01-07 21:04:09

Hi David,
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_ath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel

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

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-01-07 21:04:50

Hi David,
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/dtl1_cs.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)
Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel

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

From: Johan Hedberg <hidden>
Date: 2012-01-08 20:34:23

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_ll.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Applied to my bluetooth-next tree. Thanks.

Johan

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

From: Johan Hedberg <hidden>
Date: 2012-01-08 20:36:01

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_h4.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Applied to my bluetooth-next tree. Thanks.

Johan

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

From: Johan Hedberg <hidden>
Date: 2012-01-08 20:36:24

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_bcsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Applied to my bluetooth-next tree. Thanks.

Johan

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

From: Johan Hedberg <hidden>
Date: 2012-01-08 20:36:48

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/hci_ath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Applied to my bluetooth-next tree. Thanks.

Johan

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

From: Johan Hedberg <hidden>
Date: 2012-01-08 20:37:12

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
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.

Signed-off-by: David Herrmann <redacted>
---
 drivers/bluetooth/dtl1_cs.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)
Applied to my bluetooth-next tree. Thanks.

Johan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help