Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO
@ 2025-02-18 21:43 Luiz Augusto von Dentz
  2025-02-18 22:31 ` [v1] " bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2025-02-18 21:43 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This enables buffer flow controler for SCO/eSCO which apparently for
some reason has not been in use up until now which caused sco_cnt to
never be updated, but recently this has caused the following problem:

< HCI Command: Read Buffer Size (0x04|0x0005) plen 0
> HCI Event: Command Complete (0x0e) plen 11
      Read Buffer Size (0x04|0x0005) ncmd 1
        Status: Success (0x00)
        ACL MTU: 1021 ACL max packet: 5
        SCO MTU: 240  SCO max packet: 8
...
< SCO Data TX: Handle 257 flags 0x00 dlen 120
< SCO Data TX: Handle 257 flags 0x00 dlen 120
< SCO Data TX: Handle 257 flags 0x00 dlen 120
< SCO Data TX: Handle 257 flags 0x00 dlen 120
< SCO Data TX: Handle 257 flags 0x00 dlen 120
< SCO Data TX: Handle 257 flags 0x00 dlen 120
< SCO Data TX: Handle 257 flags 0x00 dlen 120
< SCO Data TX: Handle 257 flags 0x00 dlen 120
< SCO Data TX: Handle 257 flags 0x00 dlen 120
> HCI Event: Hardware Error (0x10) plen 1
        Code: 0x0a

Fixes: 7fedd3bb6b77 ("Bluetooth: Prioritize SCO traffic")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index e7ec12437c8b..5c88d3816c6a 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3564,6 +3564,7 @@ static void hci_sched_sco(struct hci_dev *hdev)
 			BT_DBG("skb %p len %d", skb, skb->len);
 			hci_send_frame(hdev, skb);
 
+			hdev->sco_cnt--;
 			conn->sent++;
 			if (conn->sent == ~0)
 				conn->sent = 0;
@@ -3588,6 +3589,7 @@ static void hci_sched_esco(struct hci_dev *hdev)
 			BT_DBG("skb %p len %d", skb, skb->len);
 			hci_send_frame(hdev, skb);
 
+			hdev->sco_cnt--;
 			conn->sent++;
 			if (conn->sent == ~0)
 				conn->sent = 0;
-- 
2.48.1


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

* RE: [v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO
  2025-02-18 21:43 [PATCH v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO Luiz Augusto von Dentz
@ 2025-02-18 22:31 ` bluez.test.bot
  2025-02-20 18:10 ` [PATCH v1] " patchwork-bot+bluetooth
  2025-02-20 20:26 ` Pauli Virtanen
  2 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2025-02-18 22:31 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 2109 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=935304

---Test result---

Test Summary:
CheckPatch                    PENDING   0.35 seconds
GitLint                       PENDING   0.21 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      25.09 seconds
CheckAllWarning               PASS      28.51 seconds
CheckSparse                   PASS      30.92 seconds
BuildKernel32                 PASS      24.34 seconds
TestRunnerSetup               PASS      438.23 seconds
TestRunner_l2cap-tester       PASS      21.00 seconds
TestRunner_iso-tester         PASS      35.53 seconds
TestRunner_bnep-tester        PASS      4.83 seconds
TestRunner_mgmt-tester        FAIL      122.70 seconds
TestRunner_rfcomm-tester      PASS      8.32 seconds
TestRunner_sco-tester         PASS      10.33 seconds
TestRunner_ioctl-tester       PASS      8.36 seconds
TestRunner_mesh-tester        PASS      5.95 seconds
TestRunner_smp-tester         PASS      7.26 seconds
TestRunner_userchan-tester    PASS      4.95 seconds
IncrementalBuild              PENDING   0.75 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 490, Passed: 483 (98.6%), Failed: 3, Not Run: 4

Failed Test Cases
LL Privacy - Add Device 3 (AL is full)               Failed       0.193 seconds
LL Privacy - Set Flags 2 (Enable RL)                 Failed       0.130 seconds
LL Privacy - Start Discovery 1 (Disable RL)          Failed       0.170 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO
  2025-02-18 21:43 [PATCH v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO Luiz Augusto von Dentz
  2025-02-18 22:31 ` [v1] " bluez.test.bot
@ 2025-02-20 18:10 ` patchwork-bot+bluetooth
  2025-02-20 20:26 ` Pauli Virtanen
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2025-02-20 18:10 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue, 18 Feb 2025 16:43:44 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This enables buffer flow controler for SCO/eSCO which apparently for
> some reason has not been in use up until now which caused sco_cnt to
> never be updated, but recently this has caused the following problem:
> 
> < HCI Command: Read Buffer Size (0x04|0x0005) plen 0
> > HCI Event: Command Complete (0x0e) plen 11
>       Read Buffer Size (0x04|0x0005) ncmd 1
>         Status: Success (0x00)
>         ACL MTU: 1021 ACL max packet: 5
>         SCO MTU: 240  SCO max packet: 8
> ...
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > HCI Event: Hardware Error (0x10) plen 1
>         Code: 0x0a
> 
> [...]

Here is the summary with links:
  - [v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO
    https://git.kernel.org/bluetooth/bluetooth-next/c/eaaf44d2e680

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO
  2025-02-18 21:43 [PATCH v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO Luiz Augusto von Dentz
  2025-02-18 22:31 ` [v1] " bluez.test.bot
  2025-02-20 18:10 ` [PATCH v1] " patchwork-bot+bluetooth
@ 2025-02-20 20:26 ` Pauli Virtanen
  2025-02-20 20:38   ` Luiz Augusto von Dentz
  2 siblings, 1 reply; 5+ messages in thread
From: Pauli Virtanen @ 2025-02-20 20:26 UTC (permalink / raw)
  To: Luiz Augusto von Dentz, linux-bluetooth

Hi Luiz,

ti, 2025-02-18 kello 16:43 -0500, Luiz Augusto von Dentz kirjoitti:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This enables buffer flow controler for SCO/eSCO which apparently for
> some reason has not been in use up until now which caused sco_cnt to
> never be updated, but recently this has caused the following problem:

Should this first check or explicitly enable
Synchronous_Flow_Control_Enable setting, via
HCI_Read/Write_Synchronous_Flow_Control_Enable?

IIRC SCO packets by default don't generate Number of Completed Packets,
so is there something that is incrementing sco_cnt?

> < HCI Command: Read Buffer Size (0x04|0x0005) plen 0
> > HCI Event: Command Complete (0x0e) plen 11
>       Read Buffer Size (0x04|0x0005) ncmd 1
>         Status: Success (0x00)
>         ACL MTU: 1021 ACL max packet: 5
>         SCO MTU: 240  SCO max packet: 8
> ...
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > HCI Event: Hardware Error (0x10) plen 1
>         Code: 0x0a
> 
> Fixes: 7fedd3bb6b77 ("Bluetooth: Prioritize SCO traffic")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>  net/bluetooth/hci_core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index e7ec12437c8b..5c88d3816c6a 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -3564,6 +3564,7 @@ static void hci_sched_sco(struct hci_dev *hdev)
>  			BT_DBG("skb %p len %d", skb, skb->len);
>  			hci_send_frame(hdev, skb);
>  
> +			hdev->sco_cnt--;
>  			conn->sent++;
>  			if (conn->sent == ~0)
>  				conn->sent = 0;
> @@ -3588,6 +3589,7 @@ static void hci_sched_esco(struct hci_dev *hdev)
>  			BT_DBG("skb %p len %d", skb, skb->len);
>  			hci_send_frame(hdev, skb);
>  
> +			hdev->sco_cnt--;
>  			conn->sent++;
>  			if (conn->sent == ~0)
>  				conn->sent = 0;

-- 
Pauli Virtanen

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

* Re: [PATCH v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO
  2025-02-20 20:26 ` Pauli Virtanen
@ 2025-02-20 20:38   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2025-02-20 20:38 UTC (permalink / raw)
  To: Pauli Virtanen; +Cc: linux-bluetooth

Hi Pauli,

On Thu, Feb 20, 2025 at 3:26 PM Pauli Virtanen <pav@iki.fi> wrote:
>
> Hi Luiz,
>
> ti, 2025-02-18 kello 16:43 -0500, Luiz Augusto von Dentz kirjoitti:
> > From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> >
> > This enables buffer flow controler for SCO/eSCO which apparently for
> > some reason has not been in use up until now which caused sco_cnt to
> > never be updated, but recently this has caused the following problem:
>
> Should this first check or explicitly enable
> Synchronous_Flow_Control_Enable setting, via
> HCI_Read/Write_Synchronous_Flow_Control_Enable?
>
> IIRC SCO packets by default don't generate Number of Completed Packets,
> so is there something that is incrementing sco_cnt?

Yeah, totally forgot this exists for SCO, we will need to check if it
is supported before we can turn it on.

> > < HCI Command: Read Buffer Size (0x04|0x0005) plen 0
> > > HCI Event: Command Complete (0x0e) plen 11
> >       Read Buffer Size (0x04|0x0005) ncmd 1
> >         Status: Success (0x00)
> >         ACL MTU: 1021 ACL max packet: 5
> >         SCO MTU: 240  SCO max packet: 8
> > ...
> > < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > < SCO Data TX: Handle 257 flags 0x00 dlen 120
> > > HCI Event: Hardware Error (0x10) plen 1
> >         Code: 0x0a
> >
> > Fixes: 7fedd3bb6b77 ("Bluetooth: Prioritize SCO traffic")
> > Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> > ---
> >  net/bluetooth/hci_core.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> > index e7ec12437c8b..5c88d3816c6a 100644
> > --- a/net/bluetooth/hci_core.c
> > +++ b/net/bluetooth/hci_core.c
> > @@ -3564,6 +3564,7 @@ static void hci_sched_sco(struct hci_dev *hdev)
> >                       BT_DBG("skb %p len %d", skb, skb->len);
> >                       hci_send_frame(hdev, skb);
> >
> > +                     hdev->sco_cnt--;
> >                       conn->sent++;
> >                       if (conn->sent == ~0)
> >                               conn->sent = 0;
> > @@ -3588,6 +3589,7 @@ static void hci_sched_esco(struct hci_dev *hdev)
> >                       BT_DBG("skb %p len %d", skb, skb->len);
> >                       hci_send_frame(hdev, skb);
> >
> > +                     hdev->sco_cnt--;
> >                       conn->sent++;
> >                       if (conn->sent == ~0)
> >                               conn->sent = 0;
>
> --
> Pauli Virtanen



-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2025-02-20 20:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-18 21:43 [PATCH v1] Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO Luiz Augusto von Dentz
2025-02-18 22:31 ` [v1] " bluez.test.bot
2025-02-20 18:10 ` [PATCH v1] " patchwork-bot+bluetooth
2025-02-20 20:26 ` Pauli Virtanen
2025-02-20 20:38   ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox