linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect
@ 2022-10-17 22:41 Luiz Augusto von Dentz
  2022-10-17 23:15 ` bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2022-10-17 22:41 UTC (permalink / raw)
  To: linux-bluetooth

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

When disconnecting an ISO link the controller may not generate
HCI_EV_NUM_COMP_PKTS for unacked packets which needs to be restored in
hci_conn_del otherwise the host would assume they are still in use and
would not be able to use all the buffers available.

Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_conn.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 5d6ee5075642..df914f521c9d 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1067,10 +1067,21 @@ int hci_conn_del(struct hci_conn *conn)
 			hdev->acl_cnt += conn->sent;
 	} else {
 		struct hci_conn *acl = conn->link;
+
 		if (acl) {
 			acl->link = NULL;
 			hci_conn_drop(acl);
 		}
+
+		/* Unacked ISO frames */
+		if (conn->type == ISO_LINK) {
+			if (hdev->iso_pkts)
+				hdev->iso_cnt += conn->sent;
+			else if (hdev->le_pkts)
+				hdev->le_cnt += conn->sent;
+			else
+				hdev->acl_cnt += conn->sent;
+		}
 	}
 
 	if (conn->amp_mgr)
-- 
2.37.3


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

* RE: Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect
  2022-10-17 22:41 [PATCH] Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect Luiz Augusto von Dentz
@ 2022-10-17 23:15 ` bluez.test.bot
  2022-10-18 22:02 ` [PATCH] " Frédéric Danis
  2022-10-19 19:00 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2022-10-17 23:15 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1259 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=686004

---Test result---

Test Summary:
CheckPatch                    PASS      1.36 seconds
GitLint                       PASS      0.79 seconds
SubjectPrefix                 PASS      0.65 seconds
BuildKernel                   PASS      34.19 seconds
BuildKernel32                 PASS      30.08 seconds
Incremental Build with patchesPASS      42.19 seconds
TestRunner: Setup             PASS      507.77 seconds
TestRunner: l2cap-tester      PASS      17.15 seconds
TestRunner: iso-tester        PASS      15.95 seconds
TestRunner: bnep-tester       PASS      6.26 seconds
TestRunner: mgmt-tester       PASS      103.35 seconds
TestRunner: rfcomm-tester     PASS      10.05 seconds
TestRunner: sco-tester        PASS      9.43 seconds
TestRunner: ioctl-tester      PASS      10.72 seconds
TestRunner: mesh-tester       PASS      7.76 seconds
TestRunner: smp-tester        PASS      9.41 seconds
TestRunner: userchan-tester   PASS      6.51 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH] Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect
  2022-10-17 22:41 [PATCH] Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect Luiz Augusto von Dentz
  2022-10-17 23:15 ` bluez.test.bot
@ 2022-10-18 22:02 ` Frédéric Danis
  2022-10-19 19:00 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Frédéric Danis @ 2022-10-18 22:02 UTC (permalink / raw)
  To: Luiz Augusto von Dentz, linux-bluetooth

Hi Luiz,

I tested this patch and I'm not able to reproduce the issue after 
applying it.

Tested-by: Frédéric Danis <frederic.danis@collabora.com>


Le 18/10/2022 à 00:41, Luiz Augusto von Dentz a écrit :
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> When disconnecting an ISO link the controller may not generate
> HCI_EV_NUM_COMP_PKTS for unacked packets which needs to be restored in
> hci_conn_del otherwise the host would assume they are still in use and
> would not be able to use all the buffers available.
> 
> Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>   net/bluetooth/hci_conn.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
> index 5d6ee5075642..df914f521c9d 100644
> --- a/net/bluetooth/hci_conn.c
> +++ b/net/bluetooth/hci_conn.c
> @@ -1067,10 +1067,21 @@ int hci_conn_del(struct hci_conn *conn)
>   			hdev->acl_cnt += conn->sent;
>   	} else {
>   		struct hci_conn *acl = conn->link;
> +
>   		if (acl) {
>   			acl->link = NULL;
>   			hci_conn_drop(acl);
>   		}
> +
> +		/* Unacked ISO frames */
> +		if (conn->type == ISO_LINK) {
> +			if (hdev->iso_pkts)
> +				hdev->iso_cnt += conn->sent;
> +			else if (hdev->le_pkts)
> +				hdev->le_cnt += conn->sent;
> +			else
> +				hdev->acl_cnt += conn->sent;
> +		}
>   	}
>   
>   	if (conn->amp_mgr)

-- 
Frédéric Danis                       Embedded Linux Consultant
frederic.danis.oss@gmail.com

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

* Re: [PATCH] Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect
  2022-10-17 22:41 [PATCH] Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect Luiz Augusto von Dentz
  2022-10-17 23:15 ` bluez.test.bot
  2022-10-18 22:02 ` [PATCH] " Frédéric Danis
@ 2022-10-19 19:00 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2022-10-19 19:00 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 Mon, 17 Oct 2022 15:41:47 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> When disconnecting an ISO link the controller may not generate
> HCI_EV_NUM_COMP_PKTS for unacked packets which needs to be restored in
> hci_conn_del otherwise the host would assume they are still in use and
> would not be able to use all the buffers available.
> 
> [...]

Here is the summary with links:
  - Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect
    https://git.kernel.org/bluetooth/bluetooth-next/c/62294445832e

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] 4+ messages in thread

end of thread, other threads:[~2022-10-19 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-17 22:41 [PATCH] Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect Luiz Augusto von Dentz
2022-10-17 23:15 ` bluez.test.bot
2022-10-18 22:02 ` [PATCH] " Frédéric Danis
2022-10-19 19:00 ` patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).