]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: HCI: Fix using LE/ACL buffers for ISO packets
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 27 Jun 2025 15:18:30 +0000 (11:18 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Sat, 27 Sep 2025 15:37:01 +0000 (11:37 -0400)
ISO packets shall not use LE/ACL buffer pool, that feature seem to be
exclusive to LE-ACL only.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_conn.c
net/bluetooth/hci_core.c
net/bluetooth/hci_event.c

index e524bb59bff2349065694835b7d853506e42380d..091cff2155e6e0debf119b2d7c0b1f5f46fd349b 100644 (file)
@@ -924,10 +924,9 @@ static struct hci_conn *__hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t
        case CIS_LINK:
        case BIS_LINK:
        case PA_LINK:
-               if (hdev->iso_mtu)
-                       /* Dedicated ISO Buffer exists */
-                       break;
-               fallthrough;
+               if (!hdev->iso_mtu)
+                       return ERR_PTR(-ECONNREFUSED);
+               break;
        case LE_LINK:
                if (hdev->le_mtu && hdev->le_mtu < HCI_MIN_LE_MTU)
                        return ERR_PTR(-ECONNREFUSED);
index 55e0722fd06622310fb0b28b380860c49b9b277a..e2bffad9816f1288cf1b08f98989cdc3fb34dadd 100644 (file)
@@ -3399,8 +3399,7 @@ static inline void hci_quote_sent(struct hci_conn *conn, int num, int *quote)
        case CIS_LINK:
        case BIS_LINK:
        case PA_LINK:
-               cnt = hdev->iso_mtu ? hdev->iso_cnt :
-                       hdev->le_mtu ? hdev->le_cnt : hdev->acl_cnt;
+               cnt = hdev->iso_cnt;
                break;
        default:
                cnt = 0;
@@ -3759,8 +3758,7 @@ static void hci_sched_iso(struct hci_dev *hdev, __u8 type)
        if (!hci_conn_num(hdev, type))
                return;
 
-       cnt = hdev->iso_pkts ? &hdev->iso_cnt :
-               hdev->le_pkts ? &hdev->le_cnt : &hdev->acl_cnt;
+       cnt = &hdev->iso_cnt;
        while (*cnt && (conn = hci_low_sent(hdev, type, &quote))) {
                while (quote-- && (skb = skb_dequeue(&conn->data_q))) {
                        BT_DBG("skb %p len %d", skb, skb->len);
index fe49e8a7969ffcf49d2b33d45d74c3bd55192a75..d790b0d4eb9ace6719d1ff062bda1131f28d730c 100644 (file)
@@ -4461,19 +4461,9 @@ static void hci_num_comp_pkts_evt(struct hci_dev *hdev, void *data,
                case CIS_LINK:
                case BIS_LINK:
                case PA_LINK:
-                       if (hdev->iso_pkts) {
-                               hdev->iso_cnt += count;
-                               if (hdev->iso_cnt > hdev->iso_pkts)
-                                       hdev->iso_cnt = hdev->iso_pkts;
-                       } else if (hdev->le_pkts) {
-                               hdev->le_cnt += count;
-                               if (hdev->le_cnt > hdev->le_pkts)
-                                       hdev->le_cnt = hdev->le_pkts;
-                       } else {
-                               hdev->acl_cnt += count;
-                               if (hdev->acl_cnt > hdev->acl_pkts)
-                                       hdev->acl_cnt = hdev->acl_pkts;
-                       }
+                       hdev->iso_cnt += count;
+                       if (hdev->iso_cnt > hdev->iso_pkts)
+                               hdev->iso_cnt = hdev->iso_pkts;
                        break;
 
                default: