Skip to content

Commit da5ca22

Browse files
author
Paolo Abeni
committed
Merge tag 'for-net-2025-01-29' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - btusb: mediatek: Add locks for usb_driver_claim_interface() - L2CAP: accept zero as a special value for MTU auto-selection - btusb: Fix possible infinite recursion of btusb_reset - Add ABI doc for sysfs reset - btnxpuart: Fix glitches seen in dual A2DP streaming * tag 'for-net-2025-01-29' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: L2CAP: accept zero as a special value for MTU auto-selection Bluetooth: btnxpuart: Fix glitches seen in dual A2DP streaming Bluetooth: Add ABI doc for sysfs reset Bluetooth: Fix possible infinite recursion of btusb_reset Bluetooth: btusb: mediatek: Add locks for usb_driver_claim_interface() ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents f7bf624 + 5c61419 commit da5ca22

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
What: /sys/class/bluetooth/hci<index>/reset
2+
Date: 14-Jan-2025
3+
KernelVersion: 6.13
4+
5+
Description: This write-only attribute allows users to trigger the vendor reset
6+
method on the Bluetooth device when arbitrary data is written.
7+
The reset may or may not be done through the device transport
8+
(e.g., UART/USB), and can also be done through an out-of-band
9+
approach such as GPIO.

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4078,6 +4078,7 @@ S: Supported
40784078
W: http://www.bluez.org/
40794079
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git
40804080
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
4081+
F: Documentation/ABI/stable/sysfs-class-bluetooth
40814082
F: include/net/bluetooth/
40824083
F: net/bluetooth/
40834084

drivers/bluetooth/btnxpuart.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,13 +1381,12 @@ static void btnxpuart_tx_work(struct work_struct *work)
13811381

13821382
while ((skb = nxp_dequeue(nxpdev))) {
13831383
len = serdev_device_write_buf(serdev, skb->data, skb->len);
1384-
serdev_device_wait_until_sent(serdev, 0);
13851384
hdev->stat.byte_tx += len;
13861385

13871386
skb_pull(skb, len);
13881387
if (skb->len > 0) {
13891388
skb_queue_head(&nxpdev->txq, skb);
1390-
break;
1389+
continue;
13911390
}
13921391

13931392
switch (hci_skb_pkt_type(skb)) {

drivers/bluetooth/btusb.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -899,11 +899,6 @@ static void btusb_reset(struct hci_dev *hdev)
899899
struct btusb_data *data;
900900
int err;
901901

902-
if (hdev->reset) {
903-
hdev->reset(hdev);
904-
return;
905-
}
906-
907902
data = hci_get_drvdata(hdev);
908903
/* This is not an unbalanced PM reference since the device will reset */
909904
err = usb_autopm_get_interface(data->intf);
@@ -2639,8 +2634,15 @@ static void btusb_mtk_claim_iso_intf(struct btusb_data *data)
26392634
struct btmtk_data *btmtk_data = hci_get_priv(data->hdev);
26402635
int err;
26412636

2637+
/*
2638+
* The function usb_driver_claim_interface() is documented to need
2639+
* locks held if it's not called from a probe routine. The code here
2640+
* is called from the hci_power_on workqueue, so grab the lock.
2641+
*/
2642+
device_lock(&btmtk_data->isopkt_intf->dev);
26422643
err = usb_driver_claim_interface(&btusb_driver,
26432644
btmtk_data->isopkt_intf, data);
2645+
device_unlock(&btmtk_data->isopkt_intf->dev);
26442646
if (err < 0) {
26452647
btmtk_data->isopkt_intf = NULL;
26462648
bt_dev_err(data->hdev, "Failed to claim iso interface");

net/bluetooth/l2cap_sock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,12 +710,12 @@ static bool l2cap_valid_mtu(struct l2cap_chan *chan, u16 mtu)
710710
{
711711
switch (chan->scid) {
712712
case L2CAP_CID_ATT:
713-
if (mtu < L2CAP_LE_MIN_MTU)
713+
if (mtu && mtu < L2CAP_LE_MIN_MTU)
714714
return false;
715715
break;
716716

717717
default:
718-
if (mtu < L2CAP_DEFAULT_MIN_MTU)
718+
if (mtu && mtu < L2CAP_DEFAULT_MIN_MTU)
719719
return false;
720720
}
721721

0 commit comments

Comments
 (0)