public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: L2CAP: Fix send LE flow credits in ACL link
@ 2026-03-19  9:32 zhangchen200426
  2026-03-19 10:09 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: zhangchen200426 @ 2026-03-19  9:32 UTC (permalink / raw)
  To: luiz.von.dentz, frederic.danis, pav, pmenzel, ceggers, research,
	b23, surban
  Cc: linux-bluetooth, Zhang Chen

From: Zhang Chen <zhangchen01@kylinos.cn>

When the L2CAP channel mode is L2CAP_MODE_ERTM/L2CAP_MODE_STREAMING,
l2cap_publish_rx_avail will be called and le flow credits will be sent in
l2cap_chan_rx_avail, even though the link type is ACL.

The logs in question as follows:
> ACL Data RX: Handle 129 flags 0x02 dlen 12
      L2CAP: Unknown (0x16) ident 4 len 4
        40 00 ed 05
< ACL Data TX: Handle 129 flags 0x00 dlen 10
      L2CAP: Command Reject (0x01) ident 4 len 2
        Reason: Command not understood (0x0000)

Bluetooth: Unknown BR/EDR signaling command 0x16
Bluetooth: Wrong link type (-22)

Fixes: ce60b9231b66 ("Bluetooth: compute LE flow credits based on recvbuf space")
Cc: linux-bluetooth@vger.kernel.org
Signed-off-by: Zhang Chen <zhangchen01@kylinos.cn>
---
 net/bluetooth/l2cap_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index ead51dc0f3f1..d444ec5be88f 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -6633,7 +6633,7 @@ void l2cap_chan_rx_avail(struct l2cap_chan *chan, ssize_t rx_avail)
 
 	chan->rx_avail = rx_avail;
 
-	if (chan->state == BT_CONNECTED)
+	if (chan->state == BT_CONNECTED && chan->conn->hcon->type == LE_LINK)
 		l2cap_chan_le_send_credits(chan);
 }
 
-- 
2.25.1


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

end of thread, other threads:[~2026-03-19 10:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19  9:32 [PATCH] Bluetooth: L2CAP: Fix send LE flow credits in ACL link zhangchen200426
2026-03-19 10:09 ` bluez.test.bot

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