All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open()
@ 2012-01-07 14:19 David Herrmann
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-h4: " David Herrmann
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: David Herrmann @ 2012-01-07 14:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: padovan, marcel, 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.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] Bluetooth: hci-uart-h4: Use GFP_ATOMIC in open()
  2012-01-07 14:19 [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() David Herrmann
@ 2012-01-07 14:19 ` David Herrmann
  2012-01-07 21:03   ` Marcel Holtmann
  2012-01-08 20:36   ` Johan Hedberg
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-bcsp: " David Herrmann
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 15+ messages in thread
From: David Herrmann @ 2012-01-07 14:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: padovan, marcel, 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.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] Bluetooth: hci-uart-bcsp: Use GFP_ATOMIC in open()
  2012-01-07 14:19 [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() David Herrmann
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-h4: " David Herrmann
@ 2012-01-07 14:19 ` David Herrmann
  2012-01-07 21:03   ` Marcel Holtmann
  2012-01-08 20:36   ` Johan Hedberg
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-ath: " David Herrmann
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 15+ messages in thread
From: David Herrmann @ 2012-01-07 14:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: padovan, marcel, 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.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] Bluetooth: hci-uart-ath: Use GFP_ATOMIC in open()
  2012-01-07 14:19 [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() David Herrmann
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-h4: " David Herrmann
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-bcsp: " David Herrmann
@ 2012-01-07 14:19 ` David Herrmann
  2012-01-07 21:04   ` Marcel Holtmann
  2012-01-08 20:36   ` Johan Hedberg
  2012-01-07 14:19 ` [PATCH] Bluetooth: dtl1: Fix memleak in probe() David Herrmann
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 15+ messages in thread
From: David Herrmann @ 2012-01-07 14:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: padovan, marcel, 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.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] Bluetooth: dtl1: Fix memleak in probe()
  2012-01-07 14:19 [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() David Herrmann
                   ` (2 preceding siblings ...)
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-ath: " David Herrmann
@ 2012-01-07 14:19 ` David Herrmann
  2012-01-07 21:04   ` Marcel Holtmann
  2012-01-08 20:37   ` Johan Hedberg
  2012-01-07 21:03 ` [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() Marcel Holtmann
  2012-01-08 20:34 ` Johan Hedberg
  5 siblings, 2 replies; 15+ messages in thread
From: David Herrmann @ 2012-01-07 14:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: padovan, marcel, 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.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open()
  2012-01-07 14:19 [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() David Herrmann
                   ` (3 preceding siblings ...)
  2012-01-07 14:19 ` [PATCH] Bluetooth: dtl1: Fix memleak in probe() David Herrmann
@ 2012-01-07 21:03 ` Marcel Holtmann
  2012-01-08 20:34 ` Johan Hedberg
  5 siblings, 0 replies; 15+ messages in thread
From: Marcel Holtmann @ 2012-01-07 21:03 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/hci_ll.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: hci-uart-h4: Use GFP_ATOMIC in open()
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-h4: " David Herrmann
@ 2012-01-07 21:03   ` Marcel Holtmann
  2012-01-08 20:36   ` Johan Hedberg
  1 sibling, 0 replies; 15+ messages in thread
From: Marcel Holtmann @ 2012-01-07 21:03 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/hci_h4.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: hci-uart-bcsp: Use GFP_ATOMIC in open()
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-bcsp: " David Herrmann
@ 2012-01-07 21:03   ` Marcel Holtmann
  2012-01-08 20:36   ` Johan Hedberg
  1 sibling, 0 replies; 15+ messages in thread
From: Marcel Holtmann @ 2012-01-07 21:03 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/hci_bcsp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: hci-uart-ath: Use GFP_ATOMIC in open()
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-ath: " David Herrmann
@ 2012-01-07 21:04   ` Marcel Holtmann
  2012-01-08 20:36   ` Johan Hedberg
  1 sibling, 0 replies; 15+ messages in thread
From: Marcel Holtmann @ 2012-01-07 21:04 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/hci_ath.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: dtl1: Fix memleak in probe()
  2012-01-07 14:19 ` [PATCH] Bluetooth: dtl1: Fix memleak in probe() David Herrmann
@ 2012-01-07 21:04   ` Marcel Holtmann
  2012-01-08 20:37   ` Johan Hedberg
  1 sibling, 0 replies; 15+ messages in thread
From: Marcel Holtmann @ 2012-01-07 21:04 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/dtl1_cs.c |   20 +++-----------------
>  1 files changed, 3 insertions(+), 17 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open()
  2012-01-07 14:19 [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() David Herrmann
                   ` (4 preceding siblings ...)
  2012-01-07 21:03 ` [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() Marcel Holtmann
@ 2012-01-08 20:34 ` Johan Hedberg
  5 siblings, 0 replies; 15+ messages in thread
From: Johan Hedberg @ 2012-01-08 20:34 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan, marcel

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/hci_ll.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: hci-uart-h4: Use GFP_ATOMIC in open()
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-h4: " David Herrmann
  2012-01-07 21:03   ` Marcel Holtmann
@ 2012-01-08 20:36   ` Johan Hedberg
  1 sibling, 0 replies; 15+ messages in thread
From: Johan Hedberg @ 2012-01-08 20:36 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan, marcel

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/hci_h4.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: hci-uart-bcsp: Use GFP_ATOMIC in open()
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-bcsp: " David Herrmann
  2012-01-07 21:03   ` Marcel Holtmann
@ 2012-01-08 20:36   ` Johan Hedberg
  1 sibling, 0 replies; 15+ messages in thread
From: Johan Hedberg @ 2012-01-08 20:36 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan, marcel

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/hci_bcsp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: hci-uart-ath: Use GFP_ATOMIC in open()
  2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-ath: " David Herrmann
  2012-01-07 21:04   ` Marcel Holtmann
@ 2012-01-08 20:36   ` Johan Hedberg
  1 sibling, 0 replies; 15+ messages in thread
From: Johan Hedberg @ 2012-01-08 20:36 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan, marcel

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/hci_ath.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Bluetooth: dtl1: Fix memleak in probe()
  2012-01-07 14:19 ` [PATCH] Bluetooth: dtl1: Fix memleak in probe() David Herrmann
  2012-01-07 21:04   ` Marcel Holtmann
@ 2012-01-08 20:37   ` Johan Hedberg
  1 sibling, 0 replies; 15+ messages in thread
From: Johan Hedberg @ 2012-01-08 20:37 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan, marcel

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 <dh.herrmann@googlemail.com>
> ---
>  drivers/bluetooth/dtl1_cs.c |   20 +++-----------------
>  1 files changed, 3 insertions(+), 17 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-01-08 20:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-07 14:19 [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() David Herrmann
2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-h4: " David Herrmann
2012-01-07 21:03   ` Marcel Holtmann
2012-01-08 20:36   ` Johan Hedberg
2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-bcsp: " David Herrmann
2012-01-07 21:03   ` Marcel Holtmann
2012-01-08 20:36   ` Johan Hedberg
2012-01-07 14:19 ` [PATCH] Bluetooth: hci-uart-ath: " David Herrmann
2012-01-07 21:04   ` Marcel Holtmann
2012-01-08 20:36   ` Johan Hedberg
2012-01-07 14:19 ` [PATCH] Bluetooth: dtl1: Fix memleak in probe() David Herrmann
2012-01-07 21:04   ` Marcel Holtmann
2012-01-08 20:37   ` Johan Hedberg
2012-01-07 21:03 ` [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open() Marcel Holtmann
2012-01-08 20:34 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.