Re: [PATCH] Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>


Le 18/10/2022 à 00:41, Luiz Augusto von Dentz a écrit :
From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

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@xxxxxxxxx>
---
  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@xxxxxxxxx



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux