2012-01-02 22:18:10

by Andre Guedes

[permalink] [raw]
Subject: [PATCH 1/2] Bluetooth: Fix adv_work delay

This patch fixes the adv_work delay. It should be set to ADV_
CLEAR_TIMEOUT instead of (jiffies + ADV_CLEAR_TIMEOUT) since
queue_delayed_work() receives the number of jiffies to wait
before queueing. It also removes the unnecessary cancel_delayed_
work_sync() call in case LE scan has been disabled.

Signed-off-by: Andre Guedes <[email protected]>
---
net/bluetooth/hci_event.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 919e3c0..871a864 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1047,9 +1047,8 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
case LE_SCANNING_DISABLED:
clear_bit(HCI_LE_SCAN, &hdev->dev_flags);

- cancel_delayed_work_sync(&hdev->adv_work);
queue_delayed_work(hdev->workqueue, &hdev->adv_work,
- jiffies + ADV_CLEAR_TIMEOUT);
+ ADV_CLEAR_TIMEOUT);
break;

default:
--
1.7.8.1



2012-01-03 00:28:00

by Gustavo Padovan

[permalink] [raw]
Subject: Re: [PATCH 2/2] Bluetooth: Queue adv_work on system workqueue

Hi Andre,

* Andre Guedes <[email protected]> [2012-01-02 19:18:11 -0300]:

> This patch queues hdev->adv_work on the system-wide workqueue
> instead of on hdev->workqueue. This way we keep only tx/rx works
> on hdev->workqueue.
>
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> net/bluetooth/hci_event.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)

All applied, thanks.

Gustavo

2012-01-02 22:24:32

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 2/2] Bluetooth: Queue adv_work on system workqueue

Hi Andre,

> This patch queues hdev->adv_work on the system-wide workqueue
> instead of on hdev->workqueue. This way we keep only tx/rx works
> on hdev->workqueue.
>
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> net/bluetooth/hci_event.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)

Acked-by: Marcel Holtmann <[email protected]>

Regards

Marcel



2012-01-02 22:23:57

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 1/2] Bluetooth: Fix adv_work delay

Hi Andre,

> This patch fixes the adv_work delay. It should be set to ADV_
> CLEAR_TIMEOUT instead of (jiffies + ADV_CLEAR_TIMEOUT) since
> queue_delayed_work() receives the number of jiffies to wait
> before queueing. It also removes the unnecessary cancel_delayed_
> work_sync() call in case LE scan has been disabled.
>
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> net/bluetooth/hci_event.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)

Acked-by: Marcel Holtmann <[email protected]>

Regards

Marcel



2012-01-02 22:18:11

by Andre Guedes

[permalink] [raw]
Subject: [PATCH 2/2] Bluetooth: Queue adv_work on system workqueue

This patch queues hdev->adv_work on the system-wide workqueue
instead of on hdev->workqueue. This way we keep only tx/rx works
on hdev->workqueue.

Signed-off-by: Andre Guedes <[email protected]>
---
net/bluetooth/hci_event.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 871a864..3184f17 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1047,8 +1047,7 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
case LE_SCANNING_DISABLED:
clear_bit(HCI_LE_SCAN, &hdev->dev_flags);

- queue_delayed_work(hdev->workqueue, &hdev->adv_work,
- ADV_CLEAR_TIMEOUT);
+ schedule_delayed_work(&hdev->adv_work, ADV_CLEAR_TIMEOUT);
break;

default:
--
1.7.8.1