All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suraj Sumangala <suraj@atheros.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Vikram Kandukuri <Vikram.Kandukuri@Atheros.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"Luis Rodriguez" <Luis.Rodriguez@Atheros.com>,
	Jothikumar Mothilal <Jothikumar.Mothilal@Atheros.com>,
	Zhongyi Chen <Zhongyi.Chen@Atheros.com>
Subject: link starvation during multi profile scenario
Date: Fri, 26 Feb 2010 14:09:57 +0530	[thread overview]
Message-ID: <4B8788DD.8080706@atheros.com> (raw)
In-Reply-To: <4B836ABE.70505@atheros.com>

Hi Marcel,

I am facing an issue on Bluetooth Multiprofile secnario on CSR board as 
well as Atheros board on Ubuntu git tree head source.
The scenario is
1. From Ubuntu make A2DP connection
2. Start Streaming
3. From Ubuntu do FTP connection
4. Send file from Ubuntu to remote device.
5. Take A2DP sink (Headset) out of range.
6. FTP operation stops.

 From my observation, it looks like the stalled A2DP connection is using 
up all HCI buffers and starving the FTP connection of HCI buffers.
I have written a small enhancement for this scenario.
Please have a look at it and let me know if you have a cleaner and 
better implementation.

Please find my changes below,

Regards
Suraj

Author: Suraj Sumangala <suraj@atheros.com>
Date: Fri Feb 26 12:16:50 2010 +0530

Avoid link starvation in multi-link scenario
Signed-off-by: <suraj@atheros.com>

diff --git a/include/net/bluetooth/hci_core.h 
b/include/net/bluetooth/hci_core.h
index ce3c99e..fcae633 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -181,6 +181,9 @@ struct hci_conn {

unsigned int sent;

+
+ unsigned int acl_avail;
+
struct sk_buff_head data_q;

struct timer_list disc_timer;
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 4ad2319..10b80c4 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1359,6 +1359,9 @@ static inline struct hci_conn *hci_low_sent(struct 
hci_dev *hdev, __u8 type, int
if (c->state != BT_CONNECTED && c->state != BT_CONFIG)
continue;

+ if (c->acl_avail == 0)
+ continue;
+
num++;

if (c->sent < min) {
@@ -1423,6 +1426,10 @@ static inline void hci_sched_acl(struct hci_dev 
*hdev)

hdev->acl_cnt--;
conn->sent++;
+
+ if (conn->acl_avail != 0)
+ conn->acl_avail--;
+
}
}
}
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 592da5c..18dbdc2 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -900,6 +900,7 @@ static inline void hci_conn_complete_evt(struct 
hci_dev *hdev, struct sk_buff *s
if (conn->type == ACL_LINK) {
struct hci_cp_read_remote_features cp;
cp.handle = ev->handle;
+ conn->acl_avail = hdev->acl_pkts;
hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES,
sizeof(cp), &cp);
}
@@ -1447,6 +1448,9 @@ static inline void hci_num_comp_pkts_evt(struct 
hci_dev *hdev, struct sk_buff *s
if (conn->type == ACL_LINK) {
if ((hdev->acl_cnt += count) > hdev->acl_pkts)
hdev->acl_cnt = hdev->acl_pkts;
+
+ conn->acl_avail = count;
+
} else {
if ((hdev->sco_cnt += count) > hdev->sco_pkts)
hdev->sco_cnt = hdev->sco_pkts;

  reply	other threads:[~2010-02-26  8:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-09 11:43 [PATCH] Added support for Atheros AR300x UART Bluetooth Chip Vikram Kandukuri
2010-02-17  9:55 ` Vikram Kandukuri
2010-02-22  2:29 ` Marcel Holtmann
2010-02-22  8:54   ` Suraj Sumangala
2010-02-22 16:11     ` Luis R. Rodriguez
2010-02-23  5:42   ` Suraj Sumangala
2010-02-26  8:39     ` Suraj Sumangala [this message]
2010-03-01  9:53     ` Suraj Sumangala
2010-03-11 13:18 ` [PATCH] Added support for Atheros AR300x " Suraj Sumangala
2010-03-11 17:15   ` Marcel Holtmann
2010-03-11 17:35     ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B8788DD.8080706@atheros.com \
    --to=suraj@atheros.com \
    --cc=Jothikumar.Mothilal@Atheros.com \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=Vikram.Kandukuri@Atheros.com \
    --cc=Zhongyi.Chen@Atheros.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.